question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Using AspNetCoreModuleV2 and hostingModel="InProcess" gives 200 OK, but no content in response

See original GitHub issue

Hi!

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:

  1. Added this in the project file:
<PropertyGroup>
  <AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel>
</PropertyGroup>
  1. Installed .NET Core Runtime 2.2.0 on Windows Server 2008 R2

  2. 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-->
  1. 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).

  2. 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:closed
  • Created 5 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
yberstadcommented, Jan 15, 2019

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:

image

0reactions
muratgcommented, Jan 11, 2019

@yberstad Any updates on this?

Read more comments on GitHub >

github_iconTop Results From Across the Web

ASP.NET Core: request returns 200 OK with no content
I'm trying to run an ASP.NET Core server. My server requests are returning 200 OK, but no content is coming back, and from...
Read more >
Tutorial: Create a minimal API with ASP.NET Core
Learn how to build a minimal API with ASP. ... The response code for this return type is 200 OK, assuming there are...
Read more >
Tutorial: Create a web API with ASP.NET Core
Press Ctrl+F5 to run without the debugger. ... The response code for this return type is 200 OK, assuming there are no unhandled...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found