【发布时间】:2016-07-27 16:37:14
【问题描述】:
我在编译代码时遇到了问题。代码运行成功,我将其上传到 Team Foundation Server。但是,当人们(包括我自己)从 Team Foundation Server 下载代码时,代码产生了错误:
“错误 CS0246 找不到类型或命名空间名称“Xamarin”(是否缺少 using 指令或程序集引用?)”
我有最新版本的 Xamarin.Forms。
代码:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Xamarin.Forms;
namespace XamlSamples
{
public class App : Application
{
public App()
{
// The root page of your application
MainPage = new HelloXamlPage();
}
};
}
【问题讨论】:
-
检查项目的 References - 是否有对 Xamarin 的有效引用?
-
Xamarin 有 3 个引用:Xamarin.Forms.Core、Xamarin.Forms.Platform 和 Xamarin.Forms.Xaml。在属性上,它们都具有 Copy Local= False,而我的本地副本具有 Copy Local= True。我怎样才能解决这个问题?我尝试将 False 更改为 True,但它只是切换回来了。
-
尝试从 Nuget 恢复 Xamarin.Forms 以查看您的问题是否仍然存在。
标签: c# tfs xamarin.ios