question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Retargeting from 6.0 to 7.0, can't run Angular/React ~ individual auth with error:Could not load type 'System.Security.Cryptography.RSA'

See original GitHub issue

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

image

System.TypeLoadException HResult=0x80131522 Message=Could not load type ‘System.Security.Cryptography.RSA’ from assembly ‘System.Security.Cryptography, Version=7.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a’. Source=Microsoft.AspNetCore.ApiAuthorization.IdentityServer StackTrace: at Microsoft.AspNetCore.ApiAuthorization.IdentityServer.ConfigureSigningCredentials.LoadKey() at Microsoft.AspNetCore.ApiAuthorization.IdentityServer.ConfigureSigningCredentials.Configure(ApiAuthorizationOptions options) at Microsoft.Extensions.Options.OptionsFactory1.Create(String name) at Microsoft.Extensions.Options.UnnamedOptionsManager1.get_Value() at Microsoft.Extensions.DependencyInjection.IdentityServerBuilderConfigurationExtensions.<>c.<AddClients>b__8_1(IServiceProvider sp) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitFactory(FactoryCallSite factoryCallSite, RuntimeResolverContext context) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite callSite, RuntimeResolverContext context) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor2.VisitCallSite(ServiceCallSite callSite, TArgument argument) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, RuntimeResolverContext context) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitDisposeCache(ServiceCallSite transientCallSite, RuntimeResolverContext context) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor2.VisitCallSite(ServiceCallSite callSite, TArgument argument) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, RuntimeResolverContext context) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitDisposeCache(ServiceCallSite transientCallSite, RuntimeResolverContext context) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor2.VisitCallSite(ServiceCallSite callSite, TArgument argument) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.Resolve(ServiceCallSite callSite, ServiceProviderEngineScope scope) at Microsoft.Extensions.DependencyInjection.ServiceLookup.DynamicServiceProviderEngine.<>c__DisplayClass2_0.<RealizeService>b__0(ServiceProviderEngineScope scope) at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(Type serviceType, ServiceProviderEngineScope serviceProviderEngineScope) at Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope.GetService(Type serviceType) at Microsoft.AspNetCore.Builder.IdentityServerApplicationBuilderExtensions.TestService(IServiceProvider serviceProvider, Type service, ILogger logger, String message, Boolean doThrow) in //src/IdentityServer/Configuration/IdentityServerApplicationBuilderExtensions.cs:line 150 at Microsoft.AspNetCore.Builder.IdentityServerApplicationBuilderExtensions.Validate(IApplicationBuilder app) in //src/IdentityServer/Configuration/IdentityServerApplicationBuilderExtensions.cs:line 74 at Microsoft.AspNetCore.Builder.IdentityServerApplicationBuilderExtensions.UseIdentityServer(IApplicationBuilder app, IdentityServerMiddlewareOptions options) in /_/src/IdentityServer/Configuration/IdentityServerApplicationBuilderExtensions.cs:line 36 at Program.<Main>$(String[] args) in C:\Users\v-wajian\Angular70Ind\Program.cs:line 46

Expected Behavior

No response

Steps To Reproduce

Install Steps: Clean Win10 21H2 ENU + Dev17.1 Preview 3 + .NET 7.0(7.0.100-alpha.1.21568.2)

Repro Steps:

  1. Add feed for 6.0 and 7.0.
<add key="dotnet6" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet6/nuget/v3/index.json" />
<add key="dotnet7" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet7/nuget/v3/index.json" />
  1. Download and install latest nodejs.org from: https://nodejs.org
  2. Open commandline, create Angular ~ individual auth dotnet new Angular -au individual -o Angular
  3. Open VS, retarget the traget framework from 6.0 to 7.0, and update all package to “7.0.0-xxx”
  4. F5 to run.

Exceptions (if any)

No response

.NET Version

7.0.100-alpha.1.21568.2

Anything else?

No response

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
ericstjcommented, Jan 10, 2022

Let’s close it for now as no-repro. I tried in the repro steps with the latest build and they worked for me.

The part that likely caused this was:

Open VS, retarget the traget framework from 6.0 to 7.0, and update all package to “7.0.0-xxx”

If those packages were newer than the old build of the runtime that was in this installer that explains this. Please reopen as an issue in dotnet/runtime if you can reproduce with the latest build of the SDK.

When you are updating packages, try to choose those from the matching build of the runtime that you are using. Here’s the one I used: https://gist.github.com/ericstj/4dc5ab7b633e0b0fc0f773d03615a971 This was with SDK version 7.0.100-alpha.1.22060.3 which used ASP.NET 7.0.0-alpha.1.22057.17, runtime 7.0.0-alpha.1.22059.2

0reactions
adityamandaleekacommented, Jan 10, 2022

Thanks for looking at this @ericstj and @bartonjs . Should this issue be transferred to the runtime repo?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to npm install Angular-cli after proxy configuration
This configuration worked for me : method1 (command line): npm config set proxy http://user:password@domain_proxy:port/ npm config set ...
Read more >
Untitled
#Aug Home security systems salt lake city, Tricyclic antidepressants in heart failure, ... Jre install did not complete error code 1618, 99ers be...
Read more >
Consume Data from an API
After you build your application, you can start consuming data from an API. Review the following processes to consume data from a SOAP...
Read more >
Untitled
Garage for rent gisborne, Amd radeon program can't start api-ms-win-crt-runtime-l1-1-0.dll, 16a mahoe ave remuera auckland city auckland site qv.co.nz, ...
Read more >
Untitled
Aoc e1649fwu driver download, All time nfl passing stats, 2016 goodreads choice awards, Baby will not stop screaming, How to display military dog...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found