title: Exception: In process hosting is not supported for AspNetCoreModule. Change the AspNetCoreModule to atleast AspNetCoreModuleV2
body: <p>I am trying to publish asp.net core 2.1 application to azure app service through visual studio and getting following exception. How to resolve this?</p>
  
  <pre><code>C:\Program Files\dotnet\sdk\2.2.108\Sdks\Microsoft.NET.Sdk.Publish\build\netstandard1.0\TransformTargets\Microsoft.NET.Sdk.Publish.TransformFiles.targets(49,5): 
  Error MSB4018: The "TransformWebConfig" task failed unexpectedly.
  System.Exception: In process hosting is not supported for AspNetCoreModule. Change the AspNetCoreModule to atleast AspNetCoreModuleV2.
     at Microsoft.NET.Sdk.Publish.Tasks.WebConfigTransform.TransformAspNetCore(XElement aspNetCoreElement, String appName, Boolean configureForAzure, Boolean useAppHost, String extension, String aspNetCoreModuleName, String aspNetCoreHostingModel)
     at Microsoft.NET.Sdk.Publish.Tasks.WebConfigTransform.Transform(XDocument webConfig, String appName, Boolean configureForAzure, Boolean useAppHost, String extension, String aspNetCoreModuleName, String aspNetCoreHostingModel, String environmentName)
     at Microsoft.NET.Sdk.Publish.Tasks.TransformWebConfig.Execute()
     at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
     at Microsoft.Build.BackEnd.TaskBuilder.d__26.MoveNext()
  </code></pre>
  
  <p><strong>Solution:</strong></p>
  
  <p>Removing <code>&lt;AspNetCoreHostingModel&gt;InProcess&lt;/AspNetCoreHostingModel&gt;</code> from <code>.csproj</code> resolved my issue.</p>