缺少“系统"关于ubuntu和.net Core 3.0的参考 [英] missing "System" reference on ubuntu and .net core 3.0

查看:162
本文介绍了缺少“系统"关于ubuntu和.net Core 3.0的参考的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在Ubuntu计算机上使用.Net Core 3.0开发一个简单的Web应用程序. 我通过此链接设置了.Net Core SDK和运行时.我设置了VS Code,然后使用以下命令dotnet new webapp -o RazorPagesMovie code -r RazorPagesMovie

I'm trying to develop a simple web app using .Net Core 3.0 on an Ubuntu machine. I setup the .Net Core SDK and the runtime from this link. I setup VS Code and then I create a project using the following commands dotnet new webapp -o RazorPagesMovie code -r RazorPagesMovie

我建立了项目,并且正在运行.但是在VS Code中,它显示以下错误:

I built the project and it is working. But in VS Code, it shows the following error:

The type or namespace name 'System' could not be found (are you missing a using directive or an assembly reference?) 

vs屏幕截图

推荐答案

关于您的问题, omnisharp-vscode (例如 3289 3290 )GitHub存储库.可用的一些解决方法如下:

Regarding your problem, there are multiple open issues on omnisharp-vscode (e.g. 3289, 3290) GitHub repository. A few workarounds are available as follows:

  • 对于Windows:安装Visual Studio 2019社区版或MsBuild Tools 2019
  • 对于Linux/MacOS:安装Mono 6.0.0或更高版本

或卸载.NET Core的早期版本.如果您不喜欢这些解决方法,则解决此问题的最佳解决方案是暂时安装新的(测试版)OmniSharp版本.

Or uninstall the previous versions of .NET Core. If you don't like these workarounds, the best solution to fix the issue is that installing the new (beta) OmniSharp build for the time being.

您可以通过将以下行添加到VS Code settings.json 中来安装此版本:

You can install this build by adding the following line into your VS Code settings.json:

"omnisharp.path": "1.34.4-beta.7"  

保存设置后,将安装带有修复程序的新版omnisharp-vscode.安装后,如果需要,请重新启动IDE.我可以确认该修复程序适用于Windows.

Once you save the settings, the new build of omnisharp-vscode with fix will be installed. After the installation, restart IDE if required. I can confirm that the fix works for Windows.

这篇关于缺少“系统"关于ubuntu和.net Core 3.0的参考的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆