Using AspNetCoreModuleV2 and hostingModel="InProcess" gives 200 OK, but no content in response
See original GitHub issueHi!
Trying to run my self-contained web api with .NET Core 2.2 on IIS as InProcess. I doing a GET request to the server, I get an 200 OK, but with no content / payload. Only switching the hostingModel to “OutOfProcess”, the web api starts returning content again.
I have done the following:
- Added this in the project file:
<PropertyGroup>
<AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel>
</PropertyGroup>
-
Installed .NET Core Runtime 2.2.0 on Windows Server 2008 R2
-
Changed web.config
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<location path="." inheritInChildApplications="false">
<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath=".\NAS.AppsProxy.Api.exe" stdoutLogEnabled="true" stdoutLogFile=".\logs\stdout" hostingModel="InProcess">
<environmentVariables>
<environmentVariable name="ASPNETCORE_ENVIRONMENT" value="Stage" />
</environmentVariables>
</aspNetCore>
</system.webServer>
</location>
</configuration>
<!--ProjectGuid: BEB1A5AA-1DA2-4CBA-80DD-30EEEB3AD047-->
-
The runtimeIdentifier is set to win7-x64, the app pool has enable 32-bit set to false, and the .NET Core Runtime is x64 (but x86 is also installed on server).
-
Verified that the AspNetCoreModuleV2, %ProgramFiles%\IIS\Asp.Net Core Module\V2\aspnetcorev2.dll is visible under Modules on IIS
Setting hostingModel=“InProcess” to hostingModel=“OutOfProcess” made things work.
The stdout does not log any errors, and this is the output enabling the enhanced diagnostic logs:
[aspnetcorev2_inprocess.dll] Initializing logs for 'C:\www\appsproxynetcore\aspnetcorev2_inprocess.dll'. Process Id: 4604.. File Version: 12.2.18316.0. Description: IIS ASP.NET Core Module V2 Request Handler. Commit: ce8cf65589734f82b0536c543aba5bd60d0a5a98.
[aspnetcorev2_inprocess.dll] Waiting for initialization
[aspnetcorev2_inprocess.dll] Starting in-process worker thread
[aspnetcorev2_inprocess.dll] Resolving hostfxr parameters for application: '.\NAS.AppsProxy.Api.exe' arguments: '' path: 'C:\www\appsproxynetcore\'
[aspnetcorev2_inprocess.dll] Known dotnet.exe location: ''
[aspnetcorev2_inprocess.dll] Process path '.\NAS.AppsProxy.Api.exe' is not dotnet, treating application as standalone or portable with bootstrapper
[aspnetcorev2_inprocess.dll] Checking application.dll at 'C:\www\appsproxynetcore\.\NAS.AppsProxy.Api.dll'
[aspnetcorev2_inprocess.dll] Checking hostfxr.dll at 'C:\www\appsproxynetcore\.\hostfxr.dll'
[aspnetcorev2_inprocess.dll] hostfxr.dll found app local at 'C:\www\appsproxynetcore\.\hostfxr.dll', treating application as standalone
[aspnetcorev2_inprocess.dll] Parsed hostfxr options: dotnet location: '' hostfxr path: 'C:\www\appsproxynetcore\.\hostfxr.dll' arguments:
[aspnetcorev2_inprocess.dll] Argument[0] = 'C:\www\appsproxynetcore\.\NAS.AppsProxy.Api.exe'
[aspnetcorev2_inprocess.dll] In-process callbacks set
[aspnetcorev2_inprocess.dll] Event Log: 'Application 'C:\www\appsproxynetcore\' started the coreclr in-process successfully.'
End Event Log Message.
Does anyone else experience the same? I have tired to follow the https://docs.microsoft.com/en-us/aspnet/core/host-and-deploy/aspnet-core-module?view=aspnetcore-2.2, but I may have missed something?
Any help is much appreciated.
Thanks in advance!
Issue Analytics
- State:
- Created 5 years ago
- Comments:8 (4 by maintainers)
Hi! Sorry late response.
Yes I got it to work. To be quite honest, I do not know exactly what caused it to work. But tweaking the the project file with these changes I was able to make it work:
@yberstad Any updates on this?