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

烂漫一生 提交于 2020-01-11 09:26:29

问题


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:


You have to also set environment variables, which I documented clearly in the following blog post,

https://blog.lextudio.com/how-visual-studio-launches-iis-express-to-debug-asp-net-core-apps-d7fd3677e3c3



来源:https://stackoverflow.com/questions/47122376/invoking-iisexpress-using-command-line-to-host-asp-net-core-app

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!