Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

DNX Web command throwing 'unable to resolve project' error after publishing from VS2015

Tags:

asp.net

dnx

dnvm

This is about an obsolete pre-release version of .net core.

I have created a basic project in pre-release ASP.Net 5 (later on was renamed to asp.net core) using a beta/preview of visual studio 2015, I have published the project to a file system and am trying to run it from there using the command

    dnx . web

the error that results is 'unable to resolve project'. I have checked that dnvm is using the default framework. My published directory has web, web.cmd, wwwroot, and approot folders. Is there anything else I should be checking?

I am using: asp.net core 1.0.0-beta4 clr

like image 878
Stradosphere Avatar asked Jun 29 '15 20:06

Stradosphere


1 Answers

For ASP.NET Core projects, instead of running from the solution directory, you should go down a few folders further.

So for me, for example, I find that if I am at the solution directory I get the same error as you.

/home/myname/AspNetWebApplication <-- solution root folder

versus

/home/myname/AspNetWebApplication/src/AspNetWebApplication <-- project root folder

For me however there are still more things wrong on my setup, as I get "Error unable to load application or execute command".

In early betas and RC1, dnx web or dnx kestrel is the command to run, and that the dot you're typing in between is not needed in my case. In 1.0 rtm it's dotnet run to run from the project source directory and dotnet <yourassemblynamehere>.dll to run your binary, replace with the name of YOUR main binary assembly.

It is good to check that the tool (dnx or dotnet) is in the path, and that my environment is installed as per the ASP.NET Core installation instructions.

like image 108
Warren P Avatar answered Sep 23 '22 22:09

Warren P