只有类库应该更改为面向 net4x 和 dotnet5.x.为了类库推荐的转换步骤是:在 project.json 中:将 dnx4x 更改为 net4x(例如 dnx451 到 net451)将 dnxcore50 更改为dotnet5.4 在您的 CS 文件中:将#if DNX451改为#if NET451 将#if DNXCORE50改为#if DOTNET5_4I 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 框架支持?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云! 08-18 15:21