Reputation: 1775
I have an Asp .NET Core 3.1 App which is deployed to Azure App Service (West Europe/Windows based). When I use a Framework dependendant Deployment Mode, the app is starting smoothly.
But, when I try to switch to a Self Contained deployment, the App fails to start and I get an error message : HTTP Error 500.30 - ANCM In-Process Start Failure
Changing the Runtime from win-x86 to x64 didn't solve the problem.
I inspected the App Server runtime versions installed and it looks like runtimes are available (cf. screenshot below).
What am I doing wrong?
Upvotes: 12
Views: 23223
Reputation: 3980
For .net 5 the issue is the same I had to remove the hostingModel="inprocess" from the web.config so it read the following
<?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=".\Hub.WebApi.exe" stdoutLogEnabled="true" stdoutLogFile=".\logs\stdout" />
</system.webServer>
</location>
</configuration>
Edit 07/12/22
The same is true for .net 7 as found out on a new site. You will see here .net 7 and in the csproject I placed AspNetCoreHostingModel and the value OutOfProcess this means when you publish it will always be ok no more editing web.config after.
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<AspNetCoreHostingModel>OutOfProcess</AspNetCoreHostingModel>
</PropertyGroup>
Upvotes: 17
Reputation: 6252
Completely unrelated to the troubleshooting tips this error provides, this can also be caused by insufficient permissions of the app pool account on the source directory of the .NET Core
application.
When the service account only had Read permissions I got this error. After adding Read & Execute permissions (since the application is an .exe
) the error went away.
Upvotes: 1
Reputation: 808
In case the above does not resolve your issue, and in case you missed it within https://github.com/dotnet/aspnetcore/issues/8980, but this solved my issue.
Per DimaSUN commented on Jun 25, 2019:
ASP.NET Core 2.2 or later: For a 64-bit (x64) self-contained deployment that uses the in-process hosting model, disable the app pool for 32-bit (x86) processes.
How to: Open Application Pool within IIS. Select the website > Advanced Settings. Set 32-bit Applications from True to False.
Upvotes: 11
Reputation: 1337
In the event it helps anyone else... I still had UseKestrel()
in my Program.cs
(which makes sense given that others mentioned the hosting model as the culprit).
public static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
.ConfigureWebHostDefaults(webBuilder => {
webBuilder.UseKestrel(k => k.AddServerHeader = false);
webBuilder.UseStartup<Startup>();
});
Removing Kestrel (naturally) alleviates the problem.
I also eventually saw this in the Kudu Debug Console...
Application is running inside IIS process but is not configured to use IIS server
Upvotes: 1
Reputation: 315
Have you tried adding .Net Core 3.1 extension in your app service? Development Tools -> Extensions -> Add -> Asp.Net Core 3.1 with the runtime you require.
I had the same issue yesterday and after adding the extension, the problem was gone.
Upvotes: 1