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...
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?
Dotnet Core Multiple Startup Classes with In-Process Hosting
The Event Viewer shows:-
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....
User contributions licensed under CC BY-SA 3.0