微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

VSCode“您必须添加对程序集“ netstandard”的引用”,但编译良好

如何解决VSCode“您必须添加对程序集“ netstandard”的引用”,但编译良好

我不经常重启计算机,今天早上才这样做。 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).

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。