Search code examples
dnx

FileNotFoundException when DNX Web App Published


I published a DNX app with the command:

dnu publish --runtime active --no-source -o ..\artifacts\bin\Release\2016-04-10-3

This created the output as expected with my code compiled into a DLL in the approot/packages folder.

The web.cmd file executes the below command at the end:

@"%DNX_PATH%" --project "%~dp0packages\MyProject\1.0.0\root" --configuration Release web %*

However, when I run it, I get the below exception:

Application startup exception: System.IO.FileNotFoundException: Could not load file or assembly 'MyProject' or one of its dependencies. The system cannot find the file specified.

My initial thoughts are that the DNX command is missing the --packages param, but it throws an error when I add this. I'm not sure, what I'm doing wrong. Any ideas?

Thanks. ARK


Solution

  • Turns out this was due to me having a global.json and specific runtime in the project settings. Removed these and it worked.