@echo off
setlocal

echo === 1. Bereinige alte Build-Dateien ===
dotnet clean
if errorlevel 1 exit /b %errorlevel%

echo === 2. Baue die gesamte Solution ===
dotnet build
if errorlevel 1 exit /b %errorlevel%

echo === 3. Starte den Server ^& oeffne Browser ===
start "timetracker-browser" powershell -NoProfile -Command "Start-Sleep -Seconds 3; Start-Process 'http://localhost:5065'"

dotnet run --project timetracker.Server\timetracker.Server.csproj
exit /b %errorlevel%