Author : MD TAREQ HASSAN | Updated : 2021/03/15

Unable to connect to iis express

Possible cause: launchSettings.json

Solution:

No database provider has been configured for this DbContext

Other probable reason: https://stackoverflow.com/questions/38338475/no-database-provider-has-been-configured-for-this-dbcontext-on-signinmanager-p

HTTP Error 500.30 - ANCM In-Process Start Failure

Possible Cuase and solution 1

Possible Cuase and solution 2

Program.cs

// CreateHostBuilder()

var builtConfig = config.Build();

var keyVaultName = builtConfig[builtConfig["KeyVaultNameIdentifierKey"]];
var secretClient = new SecretClient(new Uri($"https://{keyVaultName}.vault.azure.net/"), new DefaultAzureCredential());

config.AddAzureKeyVault(secretClient, new KeyVaultSecretManager());

// ... ... ...

Solution

InvalidOperationException: The ConfigureServices method must either be parameterless or take only one parameter of type IServiceCollection

Reason: you tried to add parameter to ConfigureServices for DI i.e. IWebHostEnvironment env

// ... ... ...

public void ConfigureServices(IServiceCollection services, IWebHostEnvironment env)
{
    services.AddRazorPages();
    services.AddServerSideBlazor();

    if (env.IsDevelopment())
    {

    }
}

Splution: remove added parameter and use constructor injection

// ... ... ...

public IWebHostEnvironment Environment { get; set; }

public Startup(IConfiguration configuration, IWebHostEnvironment env) // constructor injection
{
    Configuration = configuration;
    Environment = env;
}

public void ConfigureServices(IServiceCollection services)
{
    services.AddRazorPages();
    services.AddServerSideBlazor();

    if (Environment.IsDevelopment())
    {

    }

}