1

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-*"
        }
    }
  }
}
runxc1 Bret Ferrier
  • 8,096
  • 14
  • 61
  • 100
  • Have you tried `dnu list --details` to be certain that your project is resolving the dependencies you expect? – Stafford Williams Dec 04 '15 at 04:35
  • `SET DNX_TRACE=1` might give you more info. If that doesn't work, can you share the the project.json with us? – Victor Hurdugaci Dec 04 '15 at 07:50
  • So I have updated it to add the project.json. I found dnu list to be helpful as it did show that it wasn't finding EntityFramework 6.1.3 which is in the packages folder. So at least its looking for the correct version and not 6.0.0. – runxc1 Bret Ferrier Dec 04 '15 at 23:28
  • Setting DNX_Trace didn't really show any other useful information to my eyes. As a side note I also added EntityFramework as a dependency and didn't find that that helped. – runxc1 Bret Ferrier Dec 04 '15 at 23:29
  • Adding `--debug` switch to `dnx` and attaching Visual Studio may help to investigate exception details - maybe there is a problem with some library that Entity Framework depends on? Also, where do you publish the application to? Local file system? – qbik Dec 07 '15 at 12:19

0 Answers0