【问题标题】:Creating ASP.NET vNext NuGet that can target multiple frameworks创建可以针对多个框架的 ASP.NET vNext NuGet
【发布时间】:2015-03-13 03:31:42
【问题描述】:

我正在尝试创建一个适用于 ASP.NET vNext(桌面和 CoreCLR)以及 .NET Framework 4.5 的 NuGet 包。

我查看了http://json.schemastore.org/project 的架构,但似乎没有关于什么“框架”可以接受的指导。这是我当前的 project.json,但我不确定它是否正确。

“框架”可能有哪些值?

"frameworks": {
        "aspnet50": {
            "frameworkAssemblies": {
                "System.Net.Http": "4.0.0.0",
                "System.Runtime.Serialization": "4.0.0.0",
                "System.Xml": "4.0.0.0",
                "System.Xml.Linq": "4.0.0.0"
            }
        },
        "aspnetcore50": {
            "dependencies": {
                "System.Runtime": "4.0.20-beta-22231",
                "System.Runtime.Serialization.Primitives": "4.0.0-beta-22231",
                "System.Xml.ReaderWriter": "4.0.10-beta-22231",
                "System.Xml.XDocument": "4.0.0-beta-22231",
                "System.Net.Http": "4.0.0-beta-22231",
                "System.Globalization": "4.0.10-beta-22231",
                "System.Diagnostics.Debug": "4.0.10-beta-22231",
                "System.Diagnostics.TraceSource": "4.0.0-beta-22231",
                "System.Collections": "4.0.10-beta-22231",
                "System.Linq": "4.0.0-beta-22231",
                "System.Linq.Parallel": "4.0.0-beta-22231",
                "System.Runtime.Extensions": "4.0.10-beta-22231",
                "System.IO.Compression": "4.0.0-beta-22231",
                "System.Reflection": "4.0.10-beta-22231",
                "System.IO.FileSystem": "4.0.0-beta-22231",
                "System.Threading.Thread": "4.0.0-beta-22231",
                "System.Threading": "4.0.0-beta-22231",
                "System.Reflection.Extensions": "4.0.0-beta-22231"
            }
        },
        "framework45": {
            "dependencies": {
                "Newtonsoft.Json": "6.0.4"
            }
        },
    }

【问题讨论】:

  • 你想定位什么框架?
  • 我想以 .NET Framework 4.5 为目标。

标签: nuget asp.net-core


【解决方案1】:

以下是您可以针对其他框架的方法:https://github.com/aspnet/EntityFramework/blob/dev/src/EntityFramework.Core/project.json

在 .NET 4.5 中使用 net45

【讨论】:

  • 你能定位 .net40 吗?
  • 是的,您可以定位 net40。
  • 你知道如何在 VS2017RC 中使用 MSBuild 做到这一点吗?
猜你喜欢
  • 1970-01-01
  • 2016-05-18
  • 1970-01-01
  • 2014-12-06
  • 1970-01-01
  • 2015-05-20
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多