“Dependency could not be resolved” deploying ASP.NET 5 website to Azure

一世执手 提交于 2020-01-02 03:59:05

问题


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


回答1:


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




回答2:


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"



来源:https://stackoverflow.com/questions/31627463/dependency-could-not-be-resolved-deploying-asp-net-5-website-to-azure

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!