Difference between building/running a .Net Core app using Visual Studio and CLI/VS Code

Viewed 260

I'm trying to figure out the differences between running/building a .Net core project using Visual Studio and the CLI, i.e. what process does Visual Studio follow when running the project?

I spent half a day yesterday debugging an issue where a static web resource could not be found (404) when I ran the project (both F5 and Ctrl+F5) using Visual Studio - both Debug and Release configs using both IIS Express and Project launch options - only to discover that the problem does not occur when I run the exact same project using VS Code's debugger (F5 or Ctrl+F5) or the CLI (dotnet run) directly. And today I wasted yet another 3 hours when I received a new build error message when building using VS, but the same project built and ran 100% using the CLI and VS Code...

I have a clean development environment with only one SDK that was installed along with VS, so they are both using the same SDK.

Given, I am playing around with .net5.0, so I'm using the latest preview build of VS (Version 16.8.0 Preview 2.0), but as far as I'm concerned, there should not be ANY differences when running a project using VS and the CLI. Unfortunately I cannot replicate the same issue using the stable build since both the problems are related to .net5.0 features (Scoped Styles and Blazor WASM).

Could someone please enlighten me on the steps that VS takes when running a .Net Core Web project? I KNOW it is not simpy using dotnet run as one would expect, so I would like to get as much info before I log yet another tooling issue with the dotnet people...

Any reply would be appreciated.

0 Answers
Related