13
votes

I did upgrade of my app to aspnetcore 2.2 but due to some legacy limitations which I am planing to remove later I must target .NET Framework.

New hosting model InProcess bring improvements so I want to use it but when I deploy to azure I am getting error.

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <location path="." inheritInChildApplications="false">
    <system.webServer>
      <handlers>
        <!--AspNetCoreModuleV2 switch back when its released on azure-->
        <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
      </handlers>
      <aspNetCore processPath=".\Flymark.Online.Web.exe" arguments="" stdoutLogEnabled="true" stdoutLogFile="../stdout" hostingModel="InProcess" />
    </system.webServer>
  </location>
</configuration>

And my error

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

If I change same app to be outofprocess and module to v1 it works as expected

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <location path="." inheritInChildApplications="false">
    <system.webServer>
      <handlers>
        <!--AspNetCoreModuleV2 switch back when its released on azure-->
        <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
      </handlers>
      <aspNetCore processPath=".\Flymark.Online.Web.exe" arguments="" stdoutLogEnabled="true" stdoutLogFile="../stdout" hostingModel="OutOfProcess" />
    </system.webServer>
  </location>
</configuration>

I am publishing my app using Azure pipelines and MSbuild.

2
Changing modules="AspNetCoreModuleV2" to modules="AspNetCoreModule" worked for me too. (Not saying that is the correct thing to do!) But it worked for me.Lee Englestone
@Henke if you read titles carefully you will find out that mine saying "targeting .net framework" other question saying using ".netcore"Vova Bilyachat
@VolodymyrBilyachat, I completely agree. My mistake and apologies. I believe your accepted self-answer is correct. And also that you are right in your comment to Kinjal Parmar, saying that the In-Process IIS hosting model will most likely never be supported for the .NET Framework. (In case you wonder why I did not answer before - I got 50+ in reputation no earlier than today. :-) )Henke

2 Answers

7
votes

As of today it seems In-Process is not supported when targeting .Net Framework. Issue on github

0
votes

In my case, I get the shared web.config from my colleague and the build path is not correct for me. Correct the path then it works!

enter image description here