我如何确定是什么原因导致httplistenerrequest``iowincontext.request`
我使用OWIN有一个C#API。
在我的一个Owinmiddleware组件中,我读取了一些属性context.request.request
在控制器处理请求之后,有时 this this 以“对象已被处理”错误httplistenerrequest
iowinrequest
深处。
因此,某种东西正在触发该处置。 我相信这是一个错误,因为根据这个问题这不应该发生。
因此,我需要弄清楚导致这种处置的原因...但是我不能因为我不知道它何时是在呼吸(除了“之前”)。
理想情况下,我想做一些导致调试器停止与处置发生密切相关的事情。
我尝试过的事情却没有起作用:
我可以让骑手对.NET代码的一些明显的位置进行反复编译,但是在那里设置的断点不会击中。
I have a C# API using OWIN.
In one of my OwinMiddleware components I read some properties off context.Request
after the Controller processes the request, and sometimes this blows up with an "Object is already disposed" error from the HttpListenerRequest
deep inside the IOwinRequest
.
So, something is triggering that disposal.
I believe this is a bug, because according to this question that shouldn't happen.
So I need to work out what is causing that disposal ... but I can't because I have no idea when it's ocurring (other than "before this point").
Ideally, I want to do something that causes the debugger to stop at some point closely related to when the disposal happens.
Things I've tried and which haven't worked:
I can get Rider to decompile some obvious bits of the .NET code, but Breakpoints set in there don't hit. ????
I can replace the
context.Request
with a wrapped version of itself, and so I thought that I could track the Dispose call on theOwinRequest
down through the layers ... except the Request object isn'tIDisposable
, and I can't see any other obvious way that theOwinRequest
is in control of when the internal disposal happens.I can't find a seam to be able to get at where the inner object gets set up - it looks like WebApi does that for me somewhere that I can't reach.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论