Extension Not Playing Nice, unable to Debug Code
See original GitHub issueEnvironment data
dotnet --info
output:
.NET Core SDK (reflecting any global.json): Version: 2.1.401 Commit: 91b1c13032
Runtime Environment: OS Name: Windows OS Version: 10.0.17134 OS Platform: Windows RID: win10-x64 Base Path: C:\Program Files\dotnet\sdk\2.1.401\
Host (useful for support): Version: 2.1.3 Commit: 124038c13e
.NET Core SDKs installed: 2.1.302 [C:\Program Files\dotnet\sdk] 2.1.401 [C:\Program Files\dotnet\sdk]
.NET Core runtimes installed: Microsoft.AspNetCore.All 2.1.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.All 2.1.3 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.App 2.1.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 2.1.3 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.NETCore.App 2.1.2 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.1.3 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
To install additional .NET Core runtimes or SDKs: https://aka.ms/dotnet-download
VS Code version: 1.27.1 C# Extension version: 1.16.1
Steps to reproduce
VS Code installed an update upon closing. Re-opened and all of my C# code was underlined in red and showing over 10k errors. Uninstalled / Re-installed / Reloaded extension, still getting errors like “Predefined type ‘System.Object’ is not defined or imported”.
Upon removing, all errors go away, but unable to compile code. Re-installing the C# Extension returns all of the errors. Please help, I cannot debug/compile!
Expected behavior
No errors showing. 😃
Actual behavior
Errors are showing. 😦
I feel like the only person having this problem, haven’t found any other forum entries since the VS Code update. I noticed old/new versions in the dotnet --info output, but I do not know how to manage these items or if I even need to delete the older versions.
Issue Analytics
- State:
- Created 5 years ago
- Comments:15 (3 by maintainers)
Top GitHub Comments
Okay, after reading through what feels like hundreds of issues posts, I finally have everything working on Laptop #2 (completely fresh install).
For some reason, the line
<Project Sdk="Microsoft.NET.Sdk">
does not cross to the physical directory for the SDK. I am not sure if there is a pointer file or something I am missing? However, the age-old work around of setting some mystical MSBuildSdksPath variable never worked for me – or I didn’t know how to do it right.Eventually, I simply altered the line to read:
<Project Sdk="C:\Program Files\dotnet\sdk\2.1.402\Sdks\Microsoft.NET.Sdk">
and… viola! …everything now works!Unfortunately, no good on Laptop #1 still. A little disappointed that upgrading VS Code broke everything. I really wish I could just go back to using Community at this point. Silly class requirements!
Anyhow, I’m operational at this point. If you can think of anything that could possibly help me with the other laptop, please let me know!
I suspect there were several issues related to this, as this kind of problem doesn’t reproduce.