asp.net-core - 使用 ASP.NET Core 应用程序 (VS2017) 从命令行运行 IIS Express 时出错
问题描述
我正在尝试手动运行 IISExpress,以便稍后添加 OpenCover 覆盖范围。这是一个 .NET Core 2.2 应用程序。我能够从 Visual Studio 中启动该应用程序,并且一切运行良好。现在我想在命令行上手动启动它。我使用VS生成的applicationhost.config。
我按照OpenCover for ASP.Net Core application running on IIS Express的回答中所说的话,即适应了我的环境:
我是从 C:\Program Files\IIS Express> 中的(非管理员)命令提示符执行此操作的
set LAUNCHER_PATH=C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\Extensions\Microsoft\Web Tools\ProjectSystem\VSIISExeLauncher.exe
set LAUNCHER_ARGS=-p "C:\Program Files\dotnet\dotnet.exe" -a "exec ""C:\Workspace\wk1\nSKEP\Dev\WebAccess\Dscp.Api\bin\Debug\netcoreapp2.2\Dscp.Api.dll"""
iisexpress.exe /config:"C:\Workspace\wk1\nSKEP\Dev\WebAccess\.vs\config\applicationhost.config" /site:Dscp.Api
IISExpress 启动并运行。但是当我尝试连接到我的网站时,我得到以下响应:
HTTP Error 500.0 - ANCM In-Process Handler Load Failure
Common causes of this issue:
* The specified version of Microsoft.NetCore.App or Microsoft.AspNetCore.App was not found.
* The in process request handler, Microsoft.AspNetCore.Server.IIS, was not referenced in the application.
* ANCM could not find dotnet.
Troubleshooting steps: Check the system event log for error messages
Enable logging the application process' stdout messages
Attach a debugger to the application process and inspect
For more information visit: https://go.microsoft.com/fwlink/?LinkID=2028526
我访问了链接的网站并用谷歌搜索,但没有找到任何帮助。
在 Win10 系统事件查看器中,我收到“IIS Express AspNetCore Module V2”的以下错误:
Application 'C:\Workspace\wk1\nSKEP\Dev\WebAccess\Dscp.Api\' wasn't able to start. Application .dll was not found at C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\Extensions\Microsoft\Web Tools\ProjectSystem\VSIISExeLauncher.dll
显然很有趣的是,当我在路径中指定了 VSIISExeLauncher.exe 时,它谈到了 VSIISExeLauncher.dll。
怎么了?
解决方案
推荐阅读
- laravel - Sum by cases using just Eloquent
- javascript - 迭代 document.getElementsByClassName
- html - CSS - Position outside div absolute relative to another
- webpack - 使用 webpack-dev-server 在 chrome 中调试:未捕获的引用错误,{variable} 未定义
- javascript - ASP.Net C# 不接收 ajax 数据
- excel - 1 分钟活动后的 VBA Excel 应用程序 OnTime
- c++ - C++ MapViewOfFile 在尝试映射超过文件大小 1/2 的视图时抛出错误(5 访问被拒绝),任何小于 1/2 的内容都返回有效句柄
- excel - 如何在 Excel 中使用通用运算符
- ruby-on-rails - Rails 5 ckeditor gem not referencing compiled asset names
- typescript - 在 typescript 的模块导入中默认使用 JS 扩展