我如何使用的.Net核心类库(.NetStandard V1.5)到.Net框架4.6.2应用 [英] How can I use .Net Core Class Library (.NetStandard v1.5) into .Net Framework 4.6.2 Application

查看:1489
本文介绍了我如何使用的.Net核心类库(.NetStandard V1.5)到.Net框架4.6.2应用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

据的映射的.NET平台为标准平台的.NET平台标准1.5必须与.NET框架4.6.2兼容。我曾尝试使用它(作出新的.NET平台标准类库,那么新的.Net框架4.6.2控制台应用程序),但库不被认可。什么?我做错了。

According to Mapping the .NET Platform Standard to platforms .NET Platform Standard 1.5 have to be compatible with .NET Framework 4.6.2. I have tried to use it (make new .NET Platform Standard class library, then new .Net Framework 4.6.2 console application), but the library is not recognized. What I am doing wrong?

project.json类库:

project.json in class library:

{
  "version": "1.0.0-*",

  "dependencies": {
    "NETStandard.Library": "1.5.0-rc2-24027"
  },

    "frameworks": {
        "netstandard1.5": {
            "imports": "dnxcore50",
            "buildOptions": { "embed": "true" }
        }
    }
}


推荐答案

你真的需要.Net框架4.6.2应用程序?

Do you really need .Net Framework 4.6.2 app?

我刚刚创建PCL(便携式类库)针对.NETStandard1.4,我可以用它在WPF应用程序,它是针对.NET框架4.6.1。
这里是我的project.json怎么看起来像PCL项目:

I just created PCL (Portable class library) targeting .NETStandard1.4 and I can use it in WPF app which is targeting .NET Framework 4.6.1. Here is how my project.json looks like in PCL project:

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

这篇关于我如何使用的.Net核心类库(.NetStandard V1.5)到.Net框架4.6.2应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆