Reputation: 139
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?
Upvotes: 11
Views: 4958
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:
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
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