[英]An invalid request URI was provided. (No helpful info in the stack trace)
Pulling my hair out here. 在这里拉我的头发。 All was working fine, and then out of the blue, I started to get some errors around
Microsoft.Owin.Security
. 一切工作正常,然后突然出现了一些关于
Microsoft.Owin.Security
错误。 Following some tips on this site, I un-installed that package and all the ones that depended on it (there were a lot) and then re-installed them all. 按照此站点上的一些技巧,我卸载了该软件包以及所有依赖于该软件包的软件包(很多),然后重新安装了所有软件包。
Now when I run the site in debug, I get this: 现在,当我在调试中运行站点时,得到以下信息:
An invalid request URI was provided.
提供了无效的请求URI。 The request URI must either be an absolute URI or BaseAddress must be set.
请求URI必须是绝对URI或必须设置BaseAddress。
What's frustrating is that nowhere in the stack trace is there anything that I can make any sense of. 令人沮丧的是,堆栈跟踪中没有任何地方我可以理解。 I'll paste it all below.
我将其全部粘贴在下面。
.NET 4.7.1 Web Application in Visual Studio 2017 Visual Studio 2017中的.NET 4.7.1 Web应用程序
Any tips on how to troubleshoot would be helpful. 有关如何进行故障排除的任何提示将很有帮助。 I've already deleted the entire solution and re-pulled it from TFS.
我已经删除了整个解决方案,并将其从TFS中重新拉出。 Teammates using the same source code are not seeing this.
使用相同源代码的队友没有看到此消息。
EDIT: 编辑:
The only place I am able to hit a breakpoint is on the constructor in the index controller. 我唯一能遇到断点的地方是索引控制器中的构造函数。 That constructor is empty.
该构造函数为空。 The breakpoint hits, and then even if I step in debug, the next thing that happens is the error is thrown.
断点命中,然后即使我进行调试,下一件事就是抛出错误。 It would be nice if I could nail down exactly where/what is causing the error, but I'm having trouble even with that.
如果我能准确确定导致错误的原因/原因,那将是很好的,但是即使那样我也遇到了麻烦。
Stack Trace:
[InvalidOperationException: An invalid request URI was provided. The request URI must either be an absolute URI or BaseAddress must be set.]
System.Net.Http.HttpClient.PrepareRequestMessage(HttpRequestMessage request) +335995
System.Net.Http.HttpClient.SendAsync(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationToken cancellationToken) +99
System.Net.Http.HttpClient.GetAsync(Uri requestUri, HttpCompletionOption completionOption, CancellationToken cancellationToken) +65
Microsoft.IdentityModel.Protocols.<GetDocumentAsync>d__8.MoveNext() +196
[IOException: IDX20804: Unable to retrieve document from: '[PII is hidden]'.]
Microsoft.IdentityModel.Protocols.<GetDocumentAsync>d__8.MoveNext() +662
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +99
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +58
Microsoft.IdentityModel.Protocols.OpenIdConnect.<GetAsync>d__3.MoveNext() +291
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +99
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +58
System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task) +25
Microsoft.IdentityModel.Protocols.<GetConfigurationAsync>d__24.MoveNext() +1129
[InvalidOperationException: IDX20803: Unable to obtain configuration from: '[PII is hidden]'.]
Microsoft.IdentityModel.Protocols.<GetConfigurationAsync>d__24.MoveNext() +1586
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +99
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +58
Microsoft.Owin.Security.OpenIdConnect.<ApplyResponseChallengeAsync>d__8.MoveNext() +432
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +99
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +58
Microsoft.Owin.Security.Infrastructure.<ApplyResponseCoreAsync>d__40.MoveNext() +272
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +99
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +58
Microsoft.Owin.Security.Infrastructure.<ApplyResponseAsync>d__39.MoveNext() +271
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +99
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +58
Microsoft.Owin.Security.Infrastructure.<TeardownAsync>d__34.MoveNext() +158
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +99
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +58
Microsoft.Owin.Security.Infrastructure.<Invoke>d__5.MoveNext() +659
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +99
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +58
Microsoft.Owin.Host.SystemWeb.IntegratedPipeline.<RunApp>d__7.MoveNext() +179
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +99
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +58
Microsoft.Owin.Security.Infrastructure.<Invoke>d__5.MoveNext() +519
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +99
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +58
Microsoft.Owin.Security.Infrastructure.<Invoke>d__5.MoveNext() +519
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +99
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +58
Microsoft.Owin.Host.SystemWeb.IntegratedPipeline.<RunApp>d__7.MoveNext() +179
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +99
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +58
Microsoft.Owin.Host.SystemWeb.IntegratedPipeline.<DoFinalWork>d__12.MoveNext() +180
Microsoft.Owin.Host.SystemWeb.IntegratedPipeline.StageAsyncResult.End(IAsyncResult ar) +69
Microsoft.Owin.Host.SystemWeb.IntegratedPipeline.IntegratedPipelineContext.EndFinalWork(IAsyncResult ar) +64
System.Web.AsyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +380
System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) +48
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +159
In order to log additional details of PII related exceptions, try setting ShowPII = true
in Configure
method in Startup
class like 为了记录与PII相关的异常的其他详细信息,请尝试在
Startup
类的Configure
方法中将ShowPII = true
设置ShowPII = true
Microsoft.IdentityModel.Logging.IdentityModelEventSource.ShowPII = true;
This should log additional details to the output window. 这应该将其他详细信息记录到输出窗口。
Please check this thread , and this thread . 请检查该线程和该线程 。 I believe you need to take care of the "Unable to obtain configuration from" exception, hope these'll help.
我相信您需要注意“无法从中获取配置”异常,希望这些对您有所帮助。 :)
:)
I spend two days on this. 我花了两天时间。 The problem was incorrect Authority URL.
问题是授权URL不正确。 Check the Authority URL you have set in Azure and your application if is the same.
检查您在Azure和应用程序中设置的授权URL是否相同。
Hope this help someone. 希望这对某人有所帮助。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.