我将IdentityServer4从2.2更新到3.1,无法运行pass app.UseEndpoints。这是例外
无法加载一个或多个请求的类型。\ r \ n无法从程序集“ IdentityModel,版本= 4.1.1.0,文化=中性,PublicKeyToken = e7877f4675df049f”中加载类型“ IdentityModel.Client.DiscoveryResponse”
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();
});
}
我进行了搜索,找到了以下链接。https://github.com/IdentityModel/IdentityModel/issues/245但是,我仍然无法找出问题所在。
问题已解决。这是解决方案的链接。https://github.com/IdentityServer/IdentityServer4/issues/3986
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句