dnxcore50框架是否支持ASP.Net 5类库包项目? [英] dnxcore50 framework support in ASP.Net 5 Class Library Package project?

查看:89
本文介绍了dnxcore50框架是否支持ASP.Net 5类库包项目?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试开发我的第一个ASP.Net Web应用程序,在我的解决方案中,我有两个项目。 Web应用程序类库(软件包),并注意到Web应用程序在<$中包含了它的框架c $ c> project.json

I am trying to develop my first ASP.Net web application and in my solution I have two projects. A Web Application and Class Library (Package) and noticed that the Web App has this for it's framework inside the project.json

"frameworks": {
    "dnxcore50": { }
}

我的理解是代码使我的Web App成为Net 5.0核心但是如果我查看类库的 project.json ,我会看到:

My understanding is that code makes my Web App target Net 5.0 Core but if I look at the project.json for the Class Library I see this:

"frameworks": {
    "net451": { },
    "dotnet5.4": {
        "dependencies": {
            "Microsoft.CSharp": "4.0.1-beta-23516",
            "System.Collections": "4.0.11-beta-23516",
            "System.Linq": "4.0.1-beta-23516",
            "System.Runtime": "4.0.21-beta-23516",
            "System.Threading": "4.0.11-beta-23516"
        }
    }
}

我从没听说过 dotnet5.4 ,而我从Google那里读到的东西却使我感到困惑。我认为 net451 等效于 dnx451 ,但我不是100%。

I have never heard of dotnet5.4 and what I read from google just confuses me. I think the net451 is the equivalent to dnx451 but I am not 100% on that.

我需要在我的 project.json 中进行什么更改,以使其面向新的.Net 5.0内核?

What do I need to change in my project.json to get it to target the new .Net 5.0 core?

推荐答案

这是即将发布的。NET标准平台。您可以在此处看到有关此更改的内容,主要部分是

This is the result of the upcoming .NET Standard Platform. You can see the changes regarding this specific to rc1 here, the main part being;


仅类库应更改为目标net4x和dotnet5.x。对于
类库,建议的转换步骤为:

Only class libraries should change to target net4x and dotnet5.x. For class libraries the recommended conversion steps are:

在project.json中:

In project.json:


  • 将dnx4x更改为net4x(例如,将 dnx451 更改为 net451

  • dnxcore50 更改为
    dotnet5.4

  • Change dnx4x to net4x (e.g. dnx451 to net451)
  • Change dnxcore50 to dotnet5.4

并在您的CS文件中:


  • 更改 #if DNX451 #if NET451

  • 更改 #if DNXCORE50 #if DOTNET5_4

  • Change #if DNX451 to #if NET451
  • Change #if DNXCORE50 to #if DOTNET5_4

这篇关于dnxcore50框架是否支持ASP.Net 5类库包项目?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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