【发布时间】:2018-06-13 07:35:11
【问题描述】:
我有一个使用 IdentityServer 4 的 .net core 2.0 应用程序。它在开发模式下完美运行。然后我将其发布为生产模式并进行了测试。当我单击一个(该操作具有生成 accesstoken 的方法)链接时,出现如下错误,
发生未处理的异常:URL 格式错误
然后在production(Release)模式下出现错误:
var disco = await IdentityModel.Client.DiscoveryClient.GetAsync(_configuration.GetSection("Settings").GetSection("DiscoveryClient").Value);
DiscoveryClient 以上是 http 而不是 https
这是错误的完整描述..
Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware[0]
An unhandled exception has occurred: Malformed URL
System.InvalidOperationException: Malformed URL
at IdentityModel.Client.DiscoveryClient.ParseUrl(String input)
at IdentityModel.Client.DiscoveryClient..ctor(String authority, HttpMessageHandler innerHandler)
at IdentityModel.Client.DiscoveryClient.<GetAsync>d__1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
这是因为'https'。我不知道发生了什么。希望您对此有所帮助。
【问题讨论】:
标签: release identityserver4 .net-core-2.0 malformedurlexception