3

我正在研究 Xamarin Studio 和它的初学者。我正在使用 Forms 制作跨平台应用程序。ut 基本项目在我构建它时出现此错误“错误 CS0246:找不到类型或命名空间名称‘页面’(您是否缺少 using 指令或程序集引用?)”如果有人知道答案,请帮助我。这是app.cs的代码:

using System;
using Xamarin.Forms;

namespace CrossPlatformAppForms
{
public class App
{
    public static Page GetMainPage ()    //This is the line where i'm getting the error
    {
        return new ContentPage { 
            Content = new Label {
                Text = "Hello, Forms !",
                VerticalOptions = LayoutOptions.CenterAndExpand,
                HorizontalOptions = LayoutOptions.CenterAndExpand,
            },
        };
    }
}
}

MyApp.Android 中的另一件事是我收到目标框架不兼容的警告(.Net framework 4.5 ...)

4

1 回答 1

-2

它不是xamarin studio 中缺少的类型或命名空间名称“Xamarin”的副本(解决链接中问题的解决方案是在参考中添加 Xarmin.Forms.Addin.dll),但我目前面临这个问题在我的 Xamarin Studio 中也是如此,我认为它与 .NET 4.5 框架兼容性有关。

于 2014-06-09T10:51:47.900 回答