asp.net5/dnx Unable to resolve reference when published but can debug?

自古美人都是妖i 提交于 2019-12-10 11:46:18

问题


So this seems a bit odd, I have a dnx command line application that is a single solution referencing 4 other .net 4.5 classic (aka .csproj) projects. I can execute the code and debug into it without problems. However I can not run it once it is published.

The app starts up and shows some output from a Console.Write and then tries to run some code that queries the db using Entity Framework v6.1.3.

The error I get is "Could not load file or assembly 'EntityFramework, Version=6.0.0.0"

which seems odd as all references are to 6.1.3 and it runs fine from VisualStudio but not using any of the commands when published.

I am using dnx 1.0.0 rc1 update1

--Update Just to make sure something wasn't wrong with the solution. I blew it away and recreated it dropping in the source files needed.... Still the same problem. I am adding the project.json

 {
  "version": "1.0.0-*",
  "description": "What.BotApprover Console Application",
  "authors": [ "bferr" ],
  "tags": [ "" ],
  "projectUrl": "",
  "licenseUrl": "",

  "compilationOptions": {
    "emitEntryPoint": true
  },

    "dependencies": {
        "Microsoft.Extensions.Configuration": "1.0.0-rc1-final",
        "Microsoft.Extensions.Configuration.CommandLine": "1.0.0-rc1-final",
        "Microsoft.Extensions.Configuration.Json": "1.0.0-rc1-final"
    },

    "commands": {
        "What.BotApprover": "What.BotApprover",
        "run": "What.BotApprover --appconfig C:\\dev\\What.com\\Trunk\\AutoSpark\\src\\AutoSpark\\configs\\app.config --test true",
        "AutoSpark.BotApprover": "What.BotApprover"
    },

  "frameworks": {
    "dnx451": {
        "dependencies": {
            "What.Common": "1.0.0-*",
            "What.Common.Utilities": "1.0.0-*",
            "What.Data": "1.0.0-*",
            "What.EventCache": "1.0.0-*"
        }
    }
  }
}

来源:https://stackoverflow.com/questions/34079129/asp-net5-dnx-unable-to-resolve-reference-when-published-but-can-debug

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