【问题标题】:In VS2015, how do I create a Xamarin xaml forms project that uses .net standard?在 VS2015 中,如何创建使用 .net 标准的 Xamarin xaml 表单项目?
【发布时间】:2016-08-19 16:20:21
【问题描述】:

我不清楚如何将 .net 核心和 .net 标准合并到一个空白的 xamarin xaml 表单应用程序中。有人可以帮我看看吗?

执行此操作,启动 Visual Studio 2015,创建一个 Visual C# / Cross-Platform / Blank Xaml App (Xamarin.Forms Portable) 项目。完成后,集成 .Net Core 和 .Net Standard

【问题讨论】:

    标签: xamarin .net-standard-1.5


    【解决方案1】:

    完全抄袭http://motzcod.es/,但放在这里是因为如果我只是链接到内容就会被标记。对不起詹姆斯...

    有关从 DNX 迁移到 .NET Core CLI 的链接 - https://docs.microsoft.com/en-us/dotnet/articles/core/migrating-from-dnx

    将 PCL 升级到 netstandard 后,您将获得一个 project.json,如下所示:

    {
        "supports": {},
        "dependencies": {
        "Microsoft.NETCore.Portable.Compatibility": "1.0.1",
        "NETStandard.Library": "1.6.0"
    },
    "frameworks": {
        "netstandard1.4": {}
        }
    }
    

    现在,我们需要做的就是添加一个特殊的“imports”标志和我们希望在 netstandard 配置文件下使用的 PCL

    {
        "supports": {},
        "dependencies": {
        "Microsoft.NETCore.Portable.Compatibility": "1.0.1",
        "NETStandard.Library": "1.6.0"
      },
      "frameworks": {
        "netstandard1.4": {
          "imports": [
            "portable-net45+wp80+win8+wpa81"]
       }
      }
    }
    

    那个小小的导入标志基本上告诉 NuGet 这个包将完全与支持它的 PCL 一起工作。现在您应该可以安装任何您想要的 PCL NuGet:

    再次,在http://motzcod.es/ 处直接抄袭 James Montemagno。完全归功于作者。

    【讨论】:

    • 我不打算迁移任何东西,所以我认为这根本没有帮助。我将更新问题以更具体
    • 开始一个新的空白项目,然后迁移它。一直在我的清单上,以弄清楚如何直接从 ide 中创建 xam visx 以获得更好的项目。一天的时间不够。
    【解决方案2】:

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2017-05-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多