VSCode 1.20.0 on Windows 10, with C# extension ms-vscode.csharp 1.14.0. VSCode Terminal points to bash (Windows Subsystem for Linux) VSCode is opened on a folder containing a .NET CORE 2.0 C# project
Everything is fine, intellisense works, project references are understood.
Whenever I switch focus to the VS Code terminal and type "dotnet build" or "dotnet test", VSCode gets confused. Red Squigglies underline every line of source code, intellisense stops working, and VSCode opens two info boxes that say
Info: There are unresolved dependencies from src\Project.csproj. Please execute the restore command to continue.
Info: There are unresolved dependencies from test\Project.Tests.csproj. Please execute the restore command to continue.
When I click the "Restore" button inside the info box, about 15 seconds later the project works again. But why, this happens all the time, I tend to dotnet build frequently. Can I configure VS Code differently to avoid this problem? It doesn't seem right that building code would break the editor functionality so I must be doing something wrong.
EDIT:
This problem seems to repro only if I dotnet build
or dotnet test
in WSL\bash (whether Internal or External Terminal). It doesn't seem to repro when I build or test in an external cmd.exe
EDIT:
cmd.exe dotnet --info
.NET Command Line Tools (2.1.4)
Product Information: Version: 2.1.4 Commit SHA-1 hash: 5e8add2190
Runtime Environment: OS Name: Windows OS Version: 10.0.16299 OS Platform: Windows RID: win10-x64 Base Path: C:\Program Files\dotnet\sdk\2.1.4\
Microsoft .NET Core Shared Framework Host
Version : 2.0.5 Build : 17373eb129b3b05aa18ece963f8795d65ef8ea54
WSL\bash $ dotnet --info
.NET Command Line Tools (2.0.3)
Product Information: Version: 2.0.3 Commit SHA-1 hash: eb1d5ee318
Runtime Environment: OS Name: ubuntu OS Version: 16.04 OS Platform: Linux RID: ubuntu.16.04-x64 Base Path: /usr/share/dotnet/sdk/2.0.3/
Microsoft .NET Core Shared Framework Host
Version : 2.0.3 Build : a9190d4a75f4a982ae4b4fa8d1a24526566c69df
dotnet --info
returns 2.1.4 (see my latest EDIT for the entire output).