ASP.NET Core 2.2 (release) produces an error and stops w3wp

南笙酒味 提交于 2019-12-10 22:29:13

问题


Just upgraded one of our ASP.NET Core 2.1.5 projects to v 2.2 released today. After deploying to a production server it fails and shuts down a worker process.

Project runs fine locally on Windows 10 (1803 / 17134.441) but not on production server. Windows Server 2016 (1607 / 14393.2639) with all the latest Windows Updates.

I get the following error from IIS AspNetCore Module V2:

Could not find inprocess request handler. Captured output from invoking hostfxr: Process Id: 5688. File Version: 12.2.18316.0. Description: IIS ASP.NET Core Module V2. Commit: ce8cf65589734f82b0536c543aba5bd60d0a5a98

Next error shows:

Faulting application name: w3wp.exe, version: 10.0.14393.0, time stamp: 0x57899b8a Faulting module name: ucrtbase.dll, version: 10.0.14393.2636, time stamp: 0x5bda7e9c Exception code: 0xc0000409 Fault offset: 0x000000000006e83e Faulting process id: 0x1638 Faulting application start time: 0x01d48c39225c1989 Faulting application path: c:\windows\system32\inetsrv\w3wp.exe Faulting module path: C:\Windows\System32\ucrtbase.dll Report Id: 685582aa-a590-4e03-b09a-5e3c36d7b758 Faulting package full name: Faulting package-relative application ID:

I have re-installed the x64 Hosting Bundle as well as the SDK.

C:\Users\Administrator>dotnet --version
2.2.100 

Did all 2.1-2.2 migrations too: https://docs.microsoft.com/en-us/aspnet/core/migration/21-to-22?view=aspnetcore-2.2&tabs=visual-studio

What could be wrong?


回答1:


The answer for me was bitness (deployed x86 to x64) - comments by pakrym here solved the matter:

https://github.com/aspnet/AspNetCore/issues/4413#issuecomment-444624391

To summarise:

  1. Install Windows Hosting Bundle
  2. Make sure standalone apps are published with the same bitness as IIS they are running in (usually x64)
  3. Make sure Enable 32-Bit Applications option is not set on the app pool.
  4. Clean publish directory before switching from standalone to portable (framework-dependent) publish.
  5. There is a known issue where CurrentDirectory returns c:\windows\system32\inetsrv when running In-Process please refer to https://github.com/aspnet/AspNetCore/issues/4206 for more details on that.
  6. Consider switching to portable publish, it has a lot of advantages over standalone.


来源:https://stackoverflow.com/questions/53623972/asp-net-core-2-2-release-produces-an-error-and-stops-w3wp

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