C# VSCode";必须添加对程序集';netstandard'&引用;但是编译得很好

C# VSCode";必须添加对程序集';netstandard'&引用;但是编译得很好,c#,.net-core,visual-studio-code,omnisharp,C#,.net Core,Visual Studio Code,Omnisharp,我不经常重启电脑,今天早上就重启了。当VSCode启动时,它看起来像做了更新,现在IDE正在抱怨错误 我的应用程序仍然可以正常编译和运行,但在IDE中,我看到30k个错误都表示类似于以下内容: 'The type XXXXXX is defined in an assembly that is not referenced. You must add a reference to assembly 'netstandard, Version=2.0.0.0, Culture=neutral, P

我不经常重启电脑,今天早上就重启了。当VSCode启动时,它看起来像做了更新,现在IDE正在抱怨错误

我的应用程序仍然可以正常编译和运行,但在IDE中,我看到30k个错误都表示类似于以下内容:

'The type XXXXXX is defined in an assembly that is not referenced. You must add a reference to assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. [MyApp.Application]'
看起来omnisharp最晚也会这么做


我也在Mac电脑上。

感谢@Martin Ullrich并向@Chris Kooken提了一个好问题。我认为这应该是一个认可的答案在这里为下一个访问者的网页

以下这些帮助我解决了这个问题:

 * Go to the VSCode settings (File > Preferences > Settings).
 * Search with the keywords omnisharp use global mono to locate the configuration.
 * Change the value to never from either auto or always.
 * REMEMBER to restart the VSCode to activate the change (I restarted it twice to be sure).

你在做什么样的项目。NET框架、标准、核心等。。。?您在本地安装了什么SDK?(
dotnet--version
)我正在运行一个asp.net core 3.1应用程序。安装的SDK是最新的3.1.402。web项目没有显示任何错误,但我的所有其他项目都显示了错误。您有本地mono安装吗?-如果是的话,你能帮忙吗?VSCode还有一个OmniSharp输出(输出窗口),可以有额外的日志。@MartinUllrich非常感谢!这很有效。你知道为什么这一切会突然发生吗?