Base solution for your next web application
Starts in:
01 DAYS
01 HRS
01 MIN
01 SEC
Open Closed

Startup configuration problem on deployed ASP.NET Core & Angular #6460


User avatar
0
abdourahmani created

Hi ! Can some one give me some guidance to correct this issue ? The App runs fines in developpment and crashes when deployed.

I'm using ASP.NET CORE & Angular V.6.0.0

` Unhandled Exception: System.ArgumentNullException: Value cannot be null.

Parameter name: value

at System.Boolean.Parse(String value)

at Lbi.Immob.Web.Startup.AuthConfigurer.Configure(IServiceCollection services, IConfiguration configuration)

at Lbi.Immob.Web.Startup.Startup.ConfigureServices(IServiceCollection services) in D:\MyWorkingDir\Immob\aspnet-core\src\Lbi.Immob.Web.Host\Startup\Startup.cs:line 101

--- End of stack trace from previous location where exception was thrown ---

at Microsoft.AspNetCore.Hosting.ConventionBasedStartup.ConfigureServices(IServiceCollection services)

at Microsoft.AspNetCore.Hosting.Internal.WebHost.EnsureApplicationServices()

at Microsoft.AspNetCore.Hosting.Internal.WebHost.Initialize()

at Microsoft.AspNetCore.Hosting.WebHostBuilder.Build()

at Lbi.Immob.Web.Startup.Program.Main(String[] args) in D:\MyWorkingDir\Immob\aspnet-core\src\Lbi.Immob.Web.Host\Startup\Program.cs:line 10`


4 Answer(s)
  • User Avatar
    0
    ryancyq created
    Support Team

    Hi, please share your appSettings.json and appSettings.production.json

  • User Avatar
    0
    abdourahmani created

    Hi @ryancyq,

    Here they are :

    AppSettings.json

    {
        "ConnectionStrings": {
            "Default": "Server=localhost; Database=ImmobDb; Trusted_Connection=True;"
        },
        "AbpZeroLicenseCode": "xxxxxxxxxxxx"
    }
    

    AppSettings.production.json

    {
        "ConnectionStrings": {
            "Default": "Server=10.0.75.1; Database=ImmobDb; User=xyza; Password=xxxxx;"
        },
        "App": {
            "WebSiteRootAddress": "http://localhost:9901/",
            "ClientRootAddress": "http://localhost:4200/",
            "CorsOrigins": "http://localhost:9902"
        }
    }
    
  • User Avatar
    1
    aaron created
    Support Team

    You are missing:

    • "Authentication:JwtBearer:IsEnabled"
    • "IdentityServer:IsEnabled"

    Don't arbitrarily remove settings from appSettings.json.

  • User Avatar
    0
    abdourahmani created

    Thank you, It runs fine now.

    I didn't notice the removal of these items