简体   繁体   中英

Dotnet watch with debug Visual Studio Code

right now my PC is very slow and Visual Studio is working really bad so i decided to try Visual Studio Code to create my ASP.NET Core application. In one of Microsoft presentation I have seen running ASP.NET Core application with tool called dotnet watch. This tool recompile code after some soft changes (like in Visual Studio).

So my quesiton is:

  1. Is there anyway to recompile code in fly in Visual Studio Code after a small change in Debug Mode?
  2. Is there any way to make a task to recompile only one project ? My whole solution has many projects and compiling this every time is just really bad idea.

After I try Debug application with dotnet watch, dotnet enviroment crashing :(

Thanks for help :)

VS Code : The Visual Studio Code debugger does not support the "Edit and Continue" feature. This feature has been requested (see https://github.com/OmniSharp/omnisharp-vscode/issues/490 ), however, there are no current plans to implement this in VS Code.

dotnet-watch : if you want to limit which files dotnet-watch watches, then you can alter your ProjectReference 's in your *.csproj file.

<ProjectReference Include="..\Other\other.csproj" Watch="false" />

This will ensure dotnet-watch only re-triggers a build on files from the current project, and not files in the project it references.

It won't , however, prevent MSBuild from re-compiling ProjectReference s when it produces a new build. MSBuild will always attempt to recompile all ProjectReference s, though, re-compilation should be fast if you haven't changed files. MSBuild uses caching to avoid re-invoking the C# compiler unless necessary.

See https://github.com/aspnet/DotNetTools/tree/rel/2.0.0-preview2/src/Microsoft.DotNet.Watcher.Tools#msbuild for more details on configuring dotnet-watch in your *.csproj files.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM