Xamarin.Forms - 无法找到“基础”

时间:2016-10-24 13:09:41

标签: c# visual-studio xamarin xamarin.ios xamarin.forms

我在Microsoft Visual Studio Enterprise 2015版本14.0.25123.00 Update 2中创建了一个新的'Blank Xaml App(Xamarin.Forms Shared)'应用程序。

创建项目后,我立刻遇到了217个错误。 重新启动Visual Studio删除了大部分内容,但仍然保留了35个。

前两个错误大约是FoundationUIKit未找到。我相信这两个也可能导致其余的错误。

有没有人对如何解决这些问题有一些想法?

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

1 个答案:

答案 0 :(得分:1)

如果您遗漏了对Xamarin.iOS的引用,请尝试手动重新添加:

在Xamarin.iOS项目下,右键单击References > Add Reference...

在参考对话框的左侧,点击Assemblies,然后点击Framework。搜索Xamarin.iOS并选择它以添加参考。

如果未列出Xamarin.iOS程序集,请查看此路径:

C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\Xamarin.iOS\v1.0

如果该目录中缺少程序集,请尝试修复Xamarin安装 - Windows Programs and Features > Xamarin > Repair