locked
unable to launch application RRS feed

  • Question

  • User-278624196 posted

    Hi Expert.

    I am unable to launch the application getting error message

    System.ArgumentNullException: Value cannot be null.
    Parameter name: certificate
       at Microsoft.IdentityModel.Tokens.X509SecurityKey..ctor(X509Certificate2 certificate)

       at System.Linq.Enumerable.SelectArrayIterator`2.MoveNext()
       at System.Collections.Generic.LargeArrayBuilder`1.AddRange(IEnumerable`1 items)
       at System.Collections.Generic.EnumerableHelpers.ToArray[T](IEnumerable`1 source)
       at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)

    Any help appreciated
    Wednesday, February 24, 2021 3:11 AM

All replies

  • User1065476709 posted

    Hi Roemesh,

    System.ArgumentNullException: Value cannot be null.
    Parameter name: certificate

    This error indicates that there is a problem with your certificate. How did you configure your certificate? you can refer to this link about how to config certificate.

    https://github.com/IdentityServer/IdentityServer3.Samples/tree/master/source/Certificates

    Best regards,

    Sam

    Wednesday, February 24, 2021 8:38 AM
  • User-278624196 posted

    Hi Expert ,

    I got this error message today after yesterday fix. and got an


    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:19 AM
  • User1065476709 posted

    Hi Roemesh,

    IdentityException: Could not load the signing certificate(s)

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

    Can you show me the code about AddmdfIdentityServer?

    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)

    Host file in this path:

    %windir%\system32\drivers\etc

    Best regards,

    Sam

    Thursday, February 25, 2021 7:11 AM
  • User-278624196 posted

    It is Microsoft Identity model token ...how to install it and get certificate

    Thursday, February 25, 2021 5:38 PM
  • User-278624196 posted

    Hi Expert,

    here is the code which creates problem added to folder but still same issue

      <member name="M:mdf.Identity.Api.Helpers.ServiceCollectionExtensions.AddmdfIdentityServer(Microsoft.Extensions.DependencyInjection.IServiceCollection,Microsoft.AspNetCore.Hosting.IHostingEnvironment)">
                <summary>
                Adds mdf specific IdentityServer to the container.
                </summary>
                <param name="services">The <see cref="T:Microsoft.Extensions.DependencyInjection.IServiceCollection" /> to add the services to.</param>
                <param name="env">The <see cref="T:Microsoft.AspNetCore.Hosting.IHostingEnvironment" /> for the service.</param>
                <returns>The <see cref="T:Microsoft.Extensions.DependencyInjection.IServiceCollection" /> so that additional calls can be chained.</returns>
            </member>

    So added file as below mentioned in host folder as  IServiceCollection.file but still same error

    public interface IServiceCollection : System.Collections.Generic.ICollection<Microsoft.Extensions.DependencyInjection.ServiceDescriptor>, System.Collections.Generic.IEnumerable<Microsoft.Extensions.DependencyInjection.ServiceDescriptor>, System.Collections.Generic.IList<Microsoft.Extensions.DependencyInjection.ServiceDescriptor>

    Thursday, February 25, 2021 11:58 PM
  • User1065476709 posted

    Hi Roemesh,

    here is the code which creates problem added to folder but still same issue

    So added file as below mentioned in host folder as  IServiceCollection.file but still same error

    I mean I need to check the code on line 156 in your ServiceCollectionExtensions.cs file.

    Best regards,

    Sam

    Monday, March 1, 2021 9:30 AM