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

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

问题描述

我正在尝试开发我的第一个 ASP.Net Web 应用程序,在我的解决方案中,我有两个项目.一个 Web 应用程序Class Library (Package) 并注意到 Web 应用程序在 project.json

中有它的框架

框架":{dnxcore50":{}}

我的理解是代码使我的 Web App 以 Net 5.0 Core 为目标,但如果我查看类库的 project.json,我会看到:

框架":{net451":{},dotnet5.4":{依赖关系":{"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,我从谷歌上读到的东西让我很困惑.我认为 net451 等同于 dnx451 但我不是 100%.

我需要在我的 project.json 中更改什么才能使其面向新的 .Net 5.0 核心?

解决方案

这是即将推出的 .NET 标准平台.您可以在 此处查看有关此特定于 rc1 的更改,主要部分是;<块引用>

只有类库应该更改为面向 net4x 和 dotnet5.x.为了类库推荐的转换步骤是:

在 project.json 中:

  • 将 dnx4x 更改为 net4x(例如 dnx451net451)
  • dnxcore50 更改为dotnet5.4

在您的 CS 文件中:

  • #if DNX451改为#if NET451
  • #if DNXCORE50改为#if DOTNET5_4

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": { }
}

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"
        }
    }
}

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.

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

解决方案

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;

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

In project.json:

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

And in your CS files:

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

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

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