asp.net5/dnx Unable to resolve reference when publ

2019-05-30 08:59发布

问题:

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-*"
        }
    }
  }
}