【问题标题】:Visual Studio 2015 - How to reference a project from another solution?Visual Studio 2015 - 如何从另一个解决方案引用项目?
【发布时间】:2015-12-03 03:36:19
【问题描述】:

我有包含项目的解决方案 A。他们都只实现了.net Core。 A 中的每个项目都可以正常编译。

现在,我有解决方案 B,其项目依赖于一些解决方案 A 项目。编辑 project.json 不起作用:

"frameworks": {
    "dotnet5.4": {
      "dependencies": {
        "SolutionA.Project": "1.0.0-*",
        "SolutionA.AnotherProject": "1.0.0-*",
        "Microsoft.AspNet.Identity.EntityFramework": "3.0.0-rc1-final",
        "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"
      }
    }
  }

解决方案 B 中的此项目无法编译。我得到“The dependency SolutionA.Project >= 1.0.0-* could not be resolved.

我们现在必须将那些 SolutionA 项目添加到 SolutionB 是真的吗?我也很困惑,因为我们也可以执行旧的“添加引用”并浏览到解决方案 A 项目的 .dll。

解决方案 A 项目已创建为 NuGet 包。

如果我遗漏了什么,请告诉我。

【问题讨论】:

    标签: visual-studio-2015 asp.net-core


    【解决方案1】:

    将其他解决方案的src 文件夹路径添加到global.json。比如:

    {
        "projects": [
            "src",
            "../../OtherSolution/src"
        ]
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2010-09-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-11-08
      • 1970-01-01
      相关资源
      最近更新 更多