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?
Basic command-line publishingThe default publish folder format is bin\Debug\{TARGET FRAMEWORK MONIKER}\publish\. For example, bin\Debug\netcoreapp2. 2\publish\. The dotnet publish command calls MSBuild, which invokes the Publish target.
The user can use the “dotnet publish” command to publish a NET Core application, the command provides few options using which the user can tweak the output of the command. For example, the dotnet publish –output “c:\output” command outputs the published artifacts into the c:\output directory.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With