I am updating IdentityServer4 from 2.2 to 3.1, I cannot run pass app.UseEndpoints. Here is the exception
Unable to load one or more of the requested types.\\r\\nCould not load type 'IdentityModel.Client.DiscoveryResponse' from assembly 'IdentityModel, Version=4.1.1.0, Culture=neutral, PublicKeyToken=e7877f4675df049f'
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
if (_environment.IsDevelopment())
{
app.UseDeveloperExceptionPage();
app.UseDatabaseErrorPage();
}
try
{
using (var serviceScope = app.ApplicationServices.GetRequiredService<IServiceScopeFactory>().CreateScope())
{
SeedData.EnsureSeedData(serviceScope, Configuration);
}
}
catch (Exception ex)
{
Debug.WriteLine(ex.Message);
}
//app.UseIdentityServer();
//app.UseCors(builder => builder.AllowAnyOrigin().AllowAnyHeader().AllowAnyMethod().AllowCredentials());
//app.UseStaticFiles();
//app.UseMvcWithDefaultRoute();
app.UseStaticFiles();
app.UseRouting();
app.UseCors();
app.UseIdentityServer();
// app.UseAuthorization();
app.UseEndpoints(endpoints =>
{
endpoints.MapDefaultControllerRoute();
});
}
I did a search, found the following link. https://github.com/IdentityModel/IdentityModel/issues/245 But, I still cannot figure out the problem.
The problem was resolved. Here is the link for solution. https://github.com/IdentityServer/IdentityServer4/issues/3986
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.