简体   繁体   English

找不到类型或命名空间名称“System”和“Xamarin”

[英]The type or namespace name 'System' and 'Xamarin' could not be found

In visual studio 2017, I created a new Cross-Platform project, Mobile app (Xamarin Forms).在 visual studio 2017 中,我创建了一个新的跨平台项目,移动应用程序 (Xamarin Forms)。 I choose Blank project for the Android platform and shared code.我为 Android 平台和共享代码选择了空白项目。 NET Standard.净标准。

Without entering a new line of code, when solutio was created I get an error that said: "The type or namespace name 'System' could not be found"在不输入新代码行的情况下,当创建解决方案时,我收到一条错误消息:“找不到类型或命名空间名称‘System’”

在此处输入图像描述

Restore NuGet packages, didn't work.恢复 NuGet 包,没有用。 Clean solution, didn't work.干净的解决方案,没有工作。 Buid project, didn't work... Buid项目,没有工作...

Has anyone happened to you?你有没有遇到什么事?

I just unloaded the project and then I reloaded on VS 2019, at least for me worked.我刚刚卸载了项目,然后在 VS 2019 上重新加载,至少对我来说是这样。 I hope this could help someone.我希望这可以帮助某人。

在此处输入图像描述

In my case this worked for me:就我而言,这对我有用:

  1. Right click on the project -> Unload Project右键单击项目 ->卸载项目
  2. Right click on the project -> Reload Project with Dependencies右键单击项目 -> Reload Project with Dependencies

Just clean your project.只需清理您的项目。 You can find it in Build tab.您可以在构建选项卡中找到它。

The solution was reinstall visual studio and all components.解决方案是重新安装 visual studio 和所有组件。 Now, when I create a new project, start with no errors and can compile and execute without any problems.现在,当我创建一个新项目时,开始时没有任何错误,并且可以毫无问题地编译和执行。

Something is wrong with your xamarin installation.您的 xamarin 安装有问题。 I hate to say it but reinstalling xamarin is probably your only option我不想这么说,但重新安装 xamarin 可能是你唯一的选择

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Xamarin-找不到类型或名称空间名称 - Xamarin - type or namespace name could not be found Xamarin - 找不到类型或命名空间名称“App” - Xamarin - The type or namespace name 'App' could not be found 找不到类型或命名空间名称“系统” - The type or namespace name 'System' could not be found 在'system'中找不到类型或命名空间名称'linq' - the type or namespace name 'linq' could not be found in 'system' Xamarin studio 5.9.7无法找到类型或命名空间名称'Xamarin' - Xamarin studio 5.9.7 the type or namespace name 'Xamarin' could not be found 在命名空间“System.Data.SqlClient”中找不到类型名称“SqlConnection” - The type name 'SqlConnection' could not be found in the namespace 'System.Data.SqlClient' 在命名空间“System.Data.OleDb”中找不到类型名称“OleDbDataAdapter” - Type name "OleDbDataAdapter" could not be found in the namespace "System.Data.OleDb" CS0246:找不到类型或命名空间名称“System” - CS0246: The type or namespace name 'System' could not be found 在命名空间“System.IO.Ports”中找不到类型名称“SerialPort” - The type name 'SerialPort' could not be found in the namespace 'System.IO.Ports' 在 Visual Studio Code for Mac 上找不到类型或命名空间名称“System” - The type or namespace name 'System' could not be found on Visual Studio Code for Mac
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM