sanjeev
sanjeev

Reputation: 139

Unable to publish binaries in .net core

I am trying to self host a .net core MVC application. It is working fine with all .cs files. When I published it (dotnet publish -f netcoreapp1.0 -c release) through command window it is shows the following error:

No executable found matching "bower"

and I even tried publishing with VS. It generates the binaries. But when I do dotnet run in command prompt it I get this error message:

project file does not exist 'project.json'

Can anyone suggest how to do self hosting with binaries?

enter image description here

enter image description here

Upvotes: 11

Views: 4958

Answers (2)

JC1001
JC1001

Reputation: 516

When running the dotnet publish command from the command-line, you have to make sure that your path variable contains all the relevant locations.

If you do a publish command from within Visual Studio, and look at the output in the "Build" window, you will notice that it updates the path variable before running the publish command:

enter image description here

From the command line, you can accomplish this by doing something like SET Path=%PATH%;C:\Program Files (x86)\Microsoft Visual Studio 14.0\Web\External; be

In PowerShell you can set it as

$env:path += ";C:\Program Files (x86)\Microsoft Visual Studio 14.0\Web\External;"

You can also look at this GitHub issue: No executable found matching command "bower"

As for your dotnet run question, you have to execute this command in the same directory that contains the project.json file, or use the -p|--project option to specify the location of the project file. Type dotnet run --help on the command-line for more info.

Upvotes: 15

Elijah Lofgren
Elijah Lofgren

Reputation: 1477

I ran into this issue on an Ubuntu box and this was the fix:

npm install -g bower
npm install -g gulp

I found the fix here: https://github.com/dotnet/cli/issues/3293#issuecomment-222993063

Upvotes: 8

Related Questions