0

I am using .NET Core 3.0 and suddenly I am getting error below, yes it was working fine last week:-

Nonetheless something has changed and I can't workout what - seems to be related to a directory being wrong. I have deleted the .vs hoping it would work after it is regenerated...

Error

I have followed below links but to no avail...

HTTP Error 500.30 - ANCM In-Process Start Failure

Reading and using appsettings.json in Program.cs?

https://forums.asp.net/t/2159371.aspx?Application+LM+W3SVC+10+ROOT+failed+to+start+process+ErrorCode+0x80070005+

Dotnet Core Multiple Startup Classes with In-Process Hosting

The Event Viewer shows:-

enter image description here

Adding StartUp.cs

public class Startup
{
    public Startup(IConfiguration configuration)
    {
        Configuration = configuration;
    }

    public IConfiguration Configuration { get; }

    // This method gets called by the runtime. Use this method to add services to the container.
    public void ConfigureServices(IServiceCollection services)
    {
        services.AddMvc();

        services.AddAuthorization(options =>
        {
            options.AddPolicy("ADGroup", policy =>
                policy.Requirements.Add(new UserHelper.CheckAdGroupRequirement(Configuration["SecuritySettings:ADGroup"])));
        });

        services.AddSingleton<IAuthorizationHandler, UserHelper.CheckAdGroupHandler>();
        services.AddHttpContextAccessor();
    }

    // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
    public static void Configure(IApplicationBuilder app, IWebHostEnvironment env)
    {
        if (env.IsDevelopment())
        {
            app.UseDeveloperExceptionPage();

        }
        else
        {
            app.UseExceptionHandler("/Home/Error/{0}");
            // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
            app.UseHsts();
        }

        app.UseHttpsRedirection();
        app.UseStaticFiles();
        app.UseRouting();

        app.UseAuthentication();
        app.UseAuthorization();

        app.UseEndpoints(endpoints =>
        {
            endpoints.MapRazorPages();
            endpoints.MapControllerRoute(
                name: "default",
                pattern: "{controller=Home}/{action=Index}/{id?}");
        });


    }
}

A nudge in the right direction would be highly appreciated....

Ram
  • 527
  • 1
  • 10
  • 26
  • show us your Startup.cs – JeePakaJP Dec 18 '19 at 12:47
  • @JeePakaJP StartUp.cs added – Ram Dec 18 '19 at 13:26
  • https://docs.jexusmanager.com/tutorials/ancm-diagnostics.html#background A report might rule out a few typical causes, but things like bitness mismatch are not yet implemented so you still have to manually check them. – Lex Li Dec 18 '19 at 14:01
  • @LexLi Am not using JexusManager – Ram Dec 18 '19 at 14:18
  • There's not enough here to help you. Some sort of exception is being thrown at startup, but that could be literally *anything*. You need to implement some sort of logging to see the actual exception, or simply run the application from the console via `dotnet MyApp.dll` on the server. You'll then be able to see any exceptions being thrown in the console window. If you can't solve it yourself at that point, edit your question to include the specific exception(s) being thrown. – Chris Pratt Dec 18 '19 at 14:21
  • @ChrisPratt - it works when I run it from the command line but I need it to work from IIS Express as I need to get the UserPrincipal (Person logged in) – Ram Dec 18 '19 at 14:43
  • One has nothing to do with the other. Running from the command line is just using Kestrel to serve the app instead of IIS Express. You can still login either way. – Chris Pratt Dec 18 '19 at 14:45
  • I agree I should be able to login either way but I am not - with IIS Express it was working last week. – Ram Dec 19 '19 at 05:09
  • Even I am getting a similar error, Web API was working in .Net Core 3.0 but started to get this error after upgrading to 3.1. The same application is still working well in other machine having Core 3.0. It has logged below two errors in event logger. Application '/LM/W3SVC/2/ROOT' with physical root 'C:\application_path\' failed to load clr and managed application. CLR worker thread exited prematurely Application '/LM/W3SVC/2/ROOT' with physical root 'C:\application_path\' hit unexpected managed exception, exception code = '0xe0434352'. Please check the stderr logs for more information. – Krishnaraj Barvathaya Dec 30 '19 at 05:33

0 Answers0