locked
IIS -Website error-host files-(IServiceCollection services, IHostingEnvironment env) RRS feed

  • Question

  • User-596502440 posted

    Hi Expert ,

    I got this error message in IIS-\Logs\stdout.log" file


    An error occurred while starting the application.
    ArgumentNullException: Value cannot be null.
    Parameter name: certificate

    Microsoft.IdentityModel.Tokens.X509SecurityKey..ctor(X509Certificate2 certificate)

    IdentityException: Could not load the signing certificate(s)

    mdf.Identity.Api.Helpers.ServiceCollectionExtensions.AddmdfIdentityServer(IServiceCollection services, IHostingEnvironment env) in ServiceCollectionExtensions.cs, line 156

    ArgumentNullException: Value cannot be null. Parameter name: certificate
    Microsoft.IdentityModel.Tokens.X509SecurityKey..ctor(X509Certificate2 certificate)
    mdf.Identity.Api.Helpers.ServiceCollectionExtensions+<>c__DisplayClass4_1.<AddmdfIdentityServer>b__7(string x) in ServiceCollectionExtensions.cs
    System.Linq.Enumerable+SelectArrayIterator<TSource, TResult>.MoveNext()
    System.Collections.Generic.LargeArrayBuilder<T>.AddRange(IEnumerable<T> items)
    System.Collections.Generic.EnumerableHelpers.ToArray<T>(IEnumerable<T> source)
    System.Linq.Enumerable.ToArray<TSource>(IEnumerable<TSource> source)
    mdf.Identity.Api.Helpers.ServiceCollectionExtensions.AddmdfIdentityServer(IServiceCollection services, IHostingEnvironment env) in ServiceCollectionExtensions.cs


    Show raw exception details
    IdentityException: Could not load the signing certificate(s)
    mdf.Identity.Api.Helpers.ServiceCollectionExtensions.AddmdfIdentityServer(IServiceCollection services, IHostingEnvironment env) in ServiceCollectionExtensions.cs
    mdf.Identity.Api.Startup.ConfigureServices(IServiceCollection services) in Startup.cs
    Microsoft.AspNetCore.Hosting.ConventionBasedStartup.ConfigureServices(IServiceCollection services)
    Microsoft.AspNetCore.Hosting.Internal.WebHost.EnsureApplicationServices()
    Microsoft.AspNetCore.Hosting.Internal.WebHost.Initialize()
    Microsoft.AspNetCore.Hosting.Internal.WebHost.BuildApplication()


    Show raw exception details
    .NET Core 4.6.28008.01 X64 v4.0.0.0    |   Microsoft.AspNetCore.Hosting version 2.1.1-rtm-30846    |    Microsoft Windows 6.3.9600    |   Need help?


    It is asking for some host file and got following link
    https://docs.microsoft.com/en-us/aspnet/core/fundamentals/?view=aspnetcore-5.0&tabs=windows#servers
    but where to add these host files-(IServiceCollection services, IHostingEnvironment env)

    Thursday, February 25, 2021 4:22 AM

All replies

  • User475983607 posted

    The error indicates your web application (Identity Server???)  cannot find a certificate.  This can be due to incorrect certificate name or the web application does not have access to the certificate.

    Thursday, February 25, 2021 12:31 PM
  • User-596502440 posted

    Hi Expert,

    but which location it is pointing

    Thursday, February 25, 2021 2:07 PM
  • User475983607 posted

    but which location it is pointing

    Only you know the answer to this question since you have startup code and should know what certificate you are using. 

    Thursday, February 25, 2021 2:11 PM
  • User-596502440 posted

    Hi Expert,

    it is microsoft identity server

    Thursday, February 25, 2021 4:48 PM