Invoking IISExpress using command line to host ASP.NET Core App

Viewed 4052

I have a service that depends on lot of other services, during the development time, I just start all other services (manually using VS 2017). In order to avoid that step, I am trying to create a batch file with the below command to Host my ASP.NET Core Web API using IISExpress.

dotnet build 
"C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\Extensions\Microsoft\Web Tools\ProjectSystem\VSIISExeLauncher.exe" -p "C:\Program Files\dotnet\dotnet.exe" -a "exec \".\Service\bin\Debug\netcoreapp2.0\MyService.dll\"" -pidFile [System.IO.Path]::GetTempFileName() -wd ".\"

When invoking the batch file from PS command prompt(Administrator) I am getting the below error

Failed to launch processs: C:\Program Files\dotnet\dotnet.exe

Last error = 267

Is there anything wrong with the above command?

1 Answers
Related