简体   繁体   English

VSCode“您必须添加对程序集'netstandard'的引用”但编译正常

[英]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.

相关问题 NSubstitute -3.x 'ValueType' 在未引用的程序集中定义。 您必须添加对程序集“netstandard”的引用, - NSubstitute -3.x 'ValueType' is defined in an assembly that is not referenced. You must add a reference to assembly 'netstandard, 在运行时编译期间收到“您必须添加对程序集 'netstandard' 的引用”错误 - Receiving “You must add a reference to assembly 'netstandard'” Errors during Runtime Compilation 您必须添加对程序集“UnityEngine.AndroidJNIModule”的引用 - You must add a reference to assembly 'UnityEngine.AndroidJNIModule 您必须添加对程序集的引用…而无需web.config文件 - You must add reference to assembly… without web.config file 您必须添加对程序集'WindowsBase,Version = 3.0.0.0的引用 - You must add a reference to assembly 'WindowsBase, Version=3.0.0.0 “你必须在奇怪的情况下添加对程序集的引用”编译器错误 - “You must add a reference to assembly” compiler error in weird case .Net Framework 您必须添加对程序集 mscorlib 的引用,版本 = 4.0.0.0 - .Net Framework You must add a reference to assembly mscorlib, Version=4.0.0.0 您必须添加对程序集 mscorlib 的引用,版本=4.0.0 - You must add a reference to assembly mscorlib, version=4.0.0 您必须添加参考 - You must add reference “MarshalByRefObject”类型是在未引用的程序集中定义的。 您必须添加对程序集 'mscorlib, Version=4.0.0.0 的引用 - The type 'MarshalByRefObject' is defined in an assembly that is not referenced. You must add a reference to assembly 'mscorlib, Version=4.0.0.0
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM