-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] nx run my-web-api:serve:development
in .net8
project produces invalid executing command
#865
Comments
Interesting, I'm not sure what changed on the CLI side for that. Outside of Nx, can you get it to work? |
After some research, I found that these commands work for both .net7 and .net8 # explicitly pass msbuild property
dotnet watch run --project .\my-web-api\NxDotnetExample.MyWebApi.csproj --property:Configuration=Release
dotnet watch run --project .\my-web-api\NxDotnetExample.MyWebApi.csproj --property:Configuration=Debug
# disable hot reload so dotnet watch switches to old behavior:
dotnet watch run --project .\my-web-api\NxDotnetExample.MyWebApi.csproj --configuration Release --no-hot-reload
dotnet watch run --project .\my-web-api\NxDotnetExample.MyWebApi.csproj --configuration Debug --no-hot-reload I've checked it by adding this to the
The reason why > $env:DOTNET_CLI_CONTEXT_VERBOSE='true'; nx run my-web-api:serve:development
> nx run my-web-api:serve
Executing Command: dotnet "watch" "--project" "C:\tmp\nx-dotnet7-example\my-web-api\NxDotnet7Example.MyWebApi.csproj" "run" "--configuration" "Debug"
Telemetry is: Enabled
Running C:\Program Files\dotnet\dotnet.exe "C:\Program Files\dotnet\sdk\7.0.410\DotnetTools\dotnet-watch\7.0.410-servicing.24272.9\tools\net7.0\any\dotnet-watch.dll" --project C:\tmp\nx-dotnet7-example\my-web-api\NxDotnet7Example.MyWebApi.csproj run --configuration Debug
Process ID: 15364
dotnet watch ⌚ Did not find a HotReloadProfile or running a non-default command. Watching with legacy behavior.
dotnet watch ⌚ Evaluating dotnet-watch file set.
dotnet watch ⌚ Running MSBuild target 'GenerateWatchList' on 'C:\tmp\nx-dotnet7-example\my-web-api\NxDotnet7Example.MyWebApi.csproj'
dotnet watch 🚀 Started 'C:\Program Files\dotnet\dotnet.exe' 'msbuild /nologo C:\tmp\nx-dotnet7-example\my-web-api\NxDotnet7Example.MyWebApi.csproj /p:_DotNetWatchListFile=C:\Users\bendrikov\AppData\Local\Temp\tmp88E9.tmp /nologo /v:n /t:GenerateWatchList /p:DotNetWatchBuild=true /p:DesignTimeBuild=true /p:CustomAfterMicrosoftCommonTargets=C:\Program Files\dotnet\sdk\7.0.410\DotnetTools\dotnet-watch\7.0.410-servicing.24272.9\tools\net7.0\any\DotNetWatch.targets /p:CustomAfterMicrosoftCommonCrossTargetingTargets=C:\Program Files\dotnet\sdk\7.0.410\DotnetTools\dotnet-watch\7.0.410-servicing.24272.9\tools\net7.0\any\DotNetWatch.targets' with process id 12776
dotnet watch ⌚ Process id 12776 ran for 1062ms
dotnet watch ⌚ Watching 4 file(s) for changes
dotnet watch ⌚ Watch command can be configured to use --no-restore.
dotnet watch ⌚ No restore arguments: run --no-restore --configuration Debug
dotnet watch ⌚ dotnet-watch is configured to launch a browser on ASP.NET Core application startup.
dotnet watch ⌚ Configuring the app to use browser-refresh middleware.
Telemetry is: Enabled
Running C:\Program Files\dotnet\dotnet.exe "C:\Program Files\dotnet\sdk\7.0.410\DotnetTools\dotnet-dev-certs\7.0.20-servicing.24269.7\tools\net7.0\any\dotnet-dev-certs.dll" https --check --quiet
Process ID: 15724
dotnet watch ⌚ Refresh server running at wss://localhost:59572,ws://localhost:59573.
dotnet watch 🚀 Started 'C:\Program Files\dotnet\dotnet.exe' 'run --configuration Debug' with process id 1252
dotnet watch ⌚ Running dotnet with the following arguments: run --configuration Debug
dotnet watch 🚀 Started
Telemetry is: Enabled
Building...
Running C:\tmp\nx-dotnet7-example\dist\my-web-api\net7.0\NxDotnet7Example.MyWebApi.exe
Process ID: 15704
The current configuration is Debug
info: Microsoft.Hosting.Lifetime[14]
Now listening on: http://localhost:5241
dotnet watch ⌚ Launching browser.
info: Microsoft.Hosting.Lifetime[0]
Application started. Press Ctrl+C to shut down.
info: Microsoft.Hosting.Lifetime[0]
Hosting environment: Development
info: Microsoft.Hosting.Lifetime[0]
Content root path: C:\tmp\nx-dotnet7-example\my-web-api but in .net8 this command started to enable HotReload (check Also, here are some interesting places in SDK that show previous and new behavior: |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Current Behavior
While moving from net7 to net8, running
nx serve
with custom configuration started to produce an invalid executing command.Now it passes configuration to the app as an argument:
Expected Behavior
Configuration should be passed to the run (?) subcommand (not to the dll we serve).
Github Repo
No response
Steps to Reproduce
npx create-nx-workspace@19 nx-dotnet-example cd nx-dotnet-example npm install --save-dev @nx-dotnet/core npx nx g @nx-dotnet/core:init nx g @nx-dotnet/core:application --name=my-web-api --language=C# --template=webapi --testTemplate=nunit --pathScheme=nx nx run my-web-api:serve:development
Nx Report
nx.json
Failure Logs
Additional Information
Disabling
hot-reload
workarounds it in my case:It looks like there are some breaking changes in net8 related to
dotnet watch
+hot reload
so that is why it worksThe text was updated successfully, but these errors were encountered: