[英]VSCode "you must add a reference to assembly 'netstandard'" but compiles fine
I don't restart my computer often, and did this morning.我不经常重启我的电脑,今天早上做了。 When VSCode launched, it looks like it did an update and now the IDE is complaining about errors.当 VSCode 启动时,它看起来像是进行了更新,现在 IDE 正在抱怨错误。
My application still compiles and runs fine, but in the IDE, I see 30k errors all saying something similar to the following:我的应用程序仍然可以编译并运行良好,但在 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]'
It looks like omnisharp is at the latest.看起来omnisharp最迟。
I am on a Mac as well.我也在 Mac 上。
Thanks to @Martin Ullrich and for a good question to @Chris Kooken.感谢@Martin Ullrich 并向@Chris Kooken 提出一个很好的问题。 I think it should be an approved answer in here for the next visitors to the page.我认为这应该是该页面的下一个访问者的批准答案。
Following these steps helped me to solve the issue:按照这些步骤帮助我解决了这个问题:
* 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).
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.