VSCode "you must add a reference to assembly 'netstandard'" 但编译正常

VSCode "you must add a reference to assembly 'netstandard'" but compiles fine

我不经常重启电脑,今天早上重启了。当 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 提出了一个很好的问题。我认为对于页面的下一个访问者来说,这里应该是一个批准的答案。

遵循这些 steps 帮助我解决了问题:

 * 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).