“Dependency could not be resolved” deploying ASP.N

2019-04-28 10:24发布

I have a ASP.NET 5 website with 3 subprojects. The subprojects have a reference to EF 6.1. Locally everything works fine, but when I try to deploy the website to azure using the assistant, I get the error message

Dependency EntityFramework >= 6.1.3 could not be resolved in XXX\wrap\PDWeb.Application\project.json 22

The generated project.json of the PDWeb.Application subproject is

{
  "version": "1.0.0-*",
  "frameworks": {
    "net452": {
      "wrappedProject": "../../Application/PDWeb.Application/PDWeb.Application.csproj",
      "bin": {
        "assembly": "../../Application/PDWeb.Application/obj/{configuration}/PDWeb.Application.dll",
        "pdb": "../../Application/PDWeb.Application/obj/{configuration}/PDWeb.Application.pdb"
      },
      "dependencies": {
        "PDWeb.Model": "1.0.0-*"
      }
    },
    "net45": {
      "wrappedProject": "../../src/Application/PDWeb.Application/PDWeb.Application.csproj",
      "bin": {
        "assembly": "../../src/Application/PDWeb.Application/obj/{configuration}/PDWeb.Application.dll",
        "pdb": "../../src/Application/PDWeb.Application/obj/{configuration}/PDWeb.Application.pdb"
      },
      "dependencies": {
        "PDWeb.Model": "1.0.0-*",
        "EntityFramework": "6.1.3",
        "PDWeb.Services": "1.0.0-*"
      }
    }
  }
}

The complete build output can be found here

2条回答
孤傲高冷的网名
2楼-- · 2019-04-28 11:02

I solved the problem by converting my subprojects to *.xproj...

查看更多
劳资没心,怎么记你
3楼-- · 2019-04-28 11:05

I had exactly the same issue, when I tried to publish my dnx project. I run "dnu restore" in every subfolder into the wrap folder and the problem was solved.

In your solution folder is a wrap folder. In this folder are subfolders with project.json files. Open command prompt, go to every subfolder and execute "dnu restore"

查看更多
登录 后发表回答