简体   繁体   English

找不到 Android、Xamarin 和 XamarinForms 的命名空间

[英]Namespace of Android, Xamarin and XamarinForms not found

I cloned a Xamarin.Forms project from GitHub and opened it in Visual Studio.我从 GitHub 克隆了一个 Xamarin.Forms 项目并在 Visual Studio 中打开它。 There I get 194 errors, because of namespace/usings that are not found.由于未找到名称空间/用法,我收到 194 个错误。 These usings are red underlined (all except "using System"):这些用法都带有红色下划线(除了“using System”):

  • using Foundation使用基金会
  • using UIKit使用 UIKit
  • using Android使用 Android
  • using Windows使用 Windows
  • using Xamarin使用 Xamarin

The project should work because my team member who pushed it to git can build it on his pc.该项目应该可以运行,因为将它推送到 git 的我的团队成员可以在他的电脑上构建它。 I'm very new in Xamarin.Forms and Visual Studio, so please write a detailed answer.我是 Xamarin.Forms 和 Visual Studio 的新手,所以请写一个详细的答案。 :) Should I install these namespaces, or why doesn't Visual Studio recognize them? :) 我应该安装这些名称空间吗?为什么 Visual Studio 不能识别它们?

Step1: Close VisualStudio第一步:关闭VisualStudio

Step2: Go to these root folders:步骤 2: Go 到这些根文件夹:

Mac:苹果:

Mac: ~/.local/share/Xamarin/   
Mac: ~/.local/share/Xamarin.Android/

Windows: Windows:

C:\Users\Me\AppData\Local\Xamarin\
C:\Users\Me\AppData\Local\Xamarin.Android\

Delete all the files there.删除那里的所有文件。 And also clear Temp Folders from you machine并从您的机器上清除临时文件夹

Step3: Go to your project in Visual Studio and close all the tabs from Windows -> Close All Tabs and then click on Build -> Clean Solution and then click on Build -> Rebuild Solution.3 步: Go 到您在 Visual Studio 中的项目并关闭 Windows 中的所有选项卡 -> 关闭所有选项卡,然后单击生成 -> 清理解决方案,然后单击生成 -> 重建解决方案。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM