Search code examples
asp.net-core-mvc.net-core.net-core-rc2

.net core rc2 - Package dependencies are not resolved


I have a solution with two class libraries (.NET Core), named ProjectA and ProjectB.

In the project.json file of ProjectA, I add a reference to ProjectB like so:

{
  "version": "1.0.0-*",

  "dependencies": {
    "NETStandard.Library": "1.5.0-rc2-24027",
    "ProjectB": ""
  },
  "frameworks": {
    "netstandard1.5": {
      "imports": "dnxcore50"
    }
  }
}

But I'm getting the following compilation error:

Package dependencies must specify a version range.

Not sure why.


Solution

  • Your ProjectB package must specify what version of ProjectB you want. This would be the same as the version property of ProjectB's project.json file. So if ProjectB's version property is set to "1.0.0", you would add this to your dependencies:

    "ProjectB": "1.0.0"