【问题标题】:Why are there multiple levels of dependecies in aspnet5 project.json?为什么aspnet5 project.json中有多层依赖?
【发布时间】:2016-04-09 18:15:55
【问题描述】:

为什么在 project.json 中存在任何目标“框架”之外的“依赖项”元素?依赖关系什么时候去那里,而不是 \frameworks\net451\frameworkAssemblies 或 \frameworks\dnxcore50\dependencies

    "frameworks": {
        "net451": {
            "frameworkAssemblies": {
                "System": "4.0.0.0",
            }
        },
        "dnxcore50": {
****        "dependencies": {
                "Microsoft.CSharp": "4.0.1-beta-23516",
                "System.Collections": "4.0.11-beta-23516",
                "System.Console": "4.0.0-beta-23516",
            }
        }
    },
****"dependencies": {
      "System.Diagnostics.Tools": "4.0.1-beta-23516",
      "System.Threading.Timer": "4.0.1-beta-23516"
    }

【问题讨论】:

    标签: .net-core coreclr


    【解决方案1】:
    • 每个框架 (net451/dnxcore50) 可以有不同的依赖关系。假设您要移植一个旧版应用程序,该应用程序依赖于某些仅适用于桌面 CLR 的第 3 方 NuGet 库。在这种情况下,您可以将其添加到 net451 中的依赖项中,然后为 dnxcore50 模拟它。这样,您就不会遇到编译错误。
    • frameworkAssemblies vs dependencies = GAC vs NuGet 包。 frameworkAssemblies 仅适用于桌面 CLR,用于引用 GAC 程序集。

    【讨论】:

    • 是的,但是还有一个依赖部分既不在 net451 也不在 dnxcore50 下。它有什么用?
    猜你喜欢
    • 2015-11-11
    • 2014-08-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-12-04
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多