HTTP Error 500.30 - ANCM In-Process Start Failure error in ASP.NET Core 2.2
Asked Answered
H

10

13

I am configuring this application Confirming the account and recovering passwords in ASP.NET Core but I have an error:

HTTP Error 500.30 - ANCM In-Process Start Failure Common causes of this issue: The application failed to start The application started but then stopped The application started but threw an exception during startup Troubleshooting steps: Check the system event log for error messages Enable logging the application process' stdout messages Attach to debugger to the application process and inspect http 500 when replacing this code in IdentityHostingStartup

Below is my configuration:

[assembly: HostingStartup(typeof(Misioneros.Stella.Maris.Web.Areas.Identity.IdentityHostingStartup))]
namespace Misioneros.Stella.Maris.Web.Areas.Identity
{
    public class IdentityHostingStartup : IHostingStartup
    {
        public void Configure(IWebHostBuilder builder)
        {
            builder.ConfigureServices((context, services) => {
                services.AddDbContext<ApplicationDbContext>(options =>
                    options.UseSqlServer(
                        context.Configuration.GetConnectionString("DefaultConnection")));

                services.AddDefaultIdentity<IdentityUser>(config =>
                {
                    config.SignIn.RequireConfirmedEmail = true;
                })
                    .AddEntityFrameworkStores<ApplicationDbContext>();
            });
        }
    }
}

Any idea what is the problem?

Hereford answered 18/1, 2019 at 5:23 Comment(1)
Possible duplicate of Using .netcore 2.2 and using the `In Process` Hosting ModelGrecize
M
12

I got the reason. May be you are registering Identity twice in your application as follows:

One in ConfigureServices method of the startup class:

services.AddDefaultIdentity<IdentityUser>()
                .AddDefaultUI(UIFramework.Bootstrap4)
                .AddEntityFrameworkStores<ApplicationDbContext>();

And other in the IdentityHostingStartup :

services.AddDefaultIdentity<IdentityUser>(config =>
                {
                    config.SignIn.RequireConfirmedEmail = true;
                }).AddEntityFrameworkStores<ApplicationDbContext>();

Register Identity just in one place i.e either in ConfigureServices method or in IdentityHostingStartup.

Hope this will help you.

Myriapod answered 18/1, 2019 at 5:39 Comment(0)
B
13

I've had the 500.30 error due to the duplicate identity problem cited by TanvirArjel, but I also just encountered the error when my appsettings.json file had some bad JSON in it. Not sure if that would only occur if you're actually trying to use configuration values in Startup.

Blalock answered 22/1, 2019 at 0:32 Comment(2)
This turned out to be the problem for me, thanks for posting the fix!Ephemeris
I missed one comma in secrets.json and this was reason for errorElectrostatic
M
12

I got the reason. May be you are registering Identity twice in your application as follows:

One in ConfigureServices method of the startup class:

services.AddDefaultIdentity<IdentityUser>()
                .AddDefaultUI(UIFramework.Bootstrap4)
                .AddEntityFrameworkStores<ApplicationDbContext>();

And other in the IdentityHostingStartup :

services.AddDefaultIdentity<IdentityUser>(config =>
                {
                    config.SignIn.RequireConfirmedEmail = true;
                }).AddEntityFrameworkStores<ApplicationDbContext>();

Register Identity just in one place i.e either in ConfigureServices method or in IdentityHostingStartup.

Hope this will help you.

Myriapod answered 18/1, 2019 at 5:39 Comment(0)
E
6

I had this error come up. It turned out the root was because the app I was working with used Azure Key Vault, and I was using the wrong identity to authenticate with Azure.

I had to go to Tools > Options > Azure Service Authentication and change the identity used for Azure service authentication.

enter image description here

Eosinophil answered 23/7, 2019 at 14:35 Comment(0)
N
4

If you have no idea what the reason of that behavior, you can enable logging in the web.config file

<aspNetCore processPath="dotnet" arguments=".\WMC.Web.dll" stdoutLogEnabled="true" stdoutLogFile=".\logs\stdout" hostingModel="inprocess" />

and then in the logs folder you will find the detailed description of your exception

Nicobarese answered 22/12, 2019 at 21:1 Comment(0)
F
2

What solved this exact error for me (in .NET Core 2.2) on the production IIS server was disabling 32-bit application support in my application pool. Everything worked fine on my local Win10 IIS Express setup.

I published my application from Visual Studio 2019 (Publish > Settings tab) as "Deployment Mode: Framework dependent" and "Target Runtime: win-x64." I'm not sure if the former option matters or not.

To remedy the error on the IIS Server, I needed to go into "Advanced Settings" on my application pool and set "Enable 32-bit Applications" to "False." You can also do this at the global level if it makes sense to. You'll find the global "Advanced Settings" on the right in the "Actions" pane.

Feretory answered 10/8, 2019 at 22:51 Comment(0)
T
1

I had the same issue when I had a web application and a web api site (from the same solution) using the same application pool. I resolved the issue when I created a new application pool for the web api so that it was no longer sharing the app pool with the web application.

Ticktock answered 11/12, 2019 at 5:12 Comment(0)
P
0

I got 500.30 when updating openiddict 2.0.0-rc2-final to openiddict 2.0.0

TanvirArjel's answer, pointed me to remove .AddOAuthValidation(); from StartUp.cs

public void ConfigureServices(IServiceCollection services)
{
    // updated openiddict
    services.AddOpenIddict()
            .AddCore(options => { /*removed for brevity*/ })
            .AddServer(options => { /*removed for brevity*/ })
            .AddValidation();

    services.AddAuthentication(options => { /*removed for brevity*/ })
            .AddCookie()
            .AddOAuthValidation(); // this line
}
Plumber answered 2/9, 2019 at 16:7 Comment(0)
O
0

Add try catch block in program.cs may help to solve the issue

public static void Main(string[] args)
        {
            try { 
            CreateWebHostBuilder(args).Build().Run();
            }
            catch (Exception exception)
            {
                Console.WriteLine(exception.Message);
            }
        }
Overhasty answered 11/9, 2019 at 19:11 Comment(0)
Y
-1

I received this problem after visual studio updating at version 16.4.1, I resolved it with changing a package reference in cs.proj:

from PackageReference Include="Microsoft.AspNetCore" Version="2.2.0"

to PackageReference Include="Microsoft.AspNetCore.Http.Abstractions" Version="2.2.0"

enter image description here

Youngling answered 13/12, 2019 at 7:43 Comment(0)
C
-2

I just try to enable all the feature relate to ASP in the Windows features > Internet Information Services > World Wide Web Services > Application Development Features.

Carillonneur answered 10/3, 2020 at 12:5 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.