用实时(jit)调试_用模糊结束年份:JIT调试失败,出现以下错误

用实时(jit)调试

用实时(jit)调试

Here’s a yummy and odd thing.  I hooked up some global error handling in my big ASP.NET app.  I put it in two places. 

这是一件好吃又奇怪的事情。 我在大型ASP.NET应用程序中连接了一些全局错误处理。 我把它放在两个地方。

The first place was a handler for the Error event in the base class for all my pages.  I had a call to log4net to log the error and a Redirect that would show the user a friendly explanation of what went wrong.

首先是我所有页面的基类中Error事件的处理程序。 我打电话给log4net来记录错误,然后进行了重定向,向用户显示了发生问题的友好说明。

The second place was the Application Error handler in Global.Asax.cs.  Same drill.  This handler is for errors that happen outside the scope of my base class (like ASHX files, etc).

第二名是Global.Asax.cs中的Application Error处理程序。 同样的演习。 该处理程序用于发生在我的基类范围之外的错误(例如ASHX文件等)。

Remember that the call to Redirect (Transfer in one case) was commented out for development.  It was commented out for months and months.  I uncommented it today.

请记住,对重定向的调用(在一种情况下为Transfer)已被注释掉以进行开发。 评论了好几个月了。 我今天没有评论。

Suddenly I started seeing this ominous dialog when running Visual Studio.NET.  NOTE: I said RUNNING VS.NET, not running the app.  I get this as soon as the CSProj gets loaded!  Eek!

突然我在运行Visual Studio.NET时开始看到这个不祥的对话框。 注意:我说正在运行VS.NET,而不是运行应用程序。 CSProj加载后,我会立即收到它! ek!

This stumped me, as this dialog is the kind of thing you see when you’re not the DebuggerUsers Group, yada yada yada.  I googled some, and all the references to this dialog refer to permissions and such, and this was clearly not a permission thing as nothing had changed in that ‘hood.

这让我感到很困惑,因为当您不是DebuggerUsers组yada yada yada时,会看到这种对话框。 我在Google上搜索了一些,所有对此对话框的引用都涉及到权限等,这显然不是权限,因为在那一幕上没有任何变化。

Since I had log4net (glorious, BTW) hooked up, I setup the FileAppender to log all my copious Debug statements to a file.  I launched VS.NET and loaded the project.  Turned out some of my pages were being flat-out executed either as VS.NET asked for them from IIS or as they were loaded into the Designer (I’ve complained about this designer thing before).  In my Init() of a deep base class a I was checking Request.UserLanguages[0] for the user’s preferred language.  Yeah, I know, I didn’t check to see if [0] was there.  It always has been!  Well, apparently it’s not there when VS.NET calls with HTTP to IIS.

由于我连接了log4net(光荣的BTW),因此我将FileAppender设置为将所有丰富的Debug语句记录到文件中。 我启动了VS.NET并加载了该项目。 事实证明,我的某些页面被完全执行,要么是VS.NET从IIS请求它们,要么是它们被加载到Designer中(我之前曾抱怨过这个Designer东西)。 在我的深基类的Init()中,我正在检查Request.UserLanguages [0]以了解用户的首选语言。 是的,我知道,我没有检查是否存在[0]。 一直如此! 好吧,当VS.NET使用HTTP到IIS进行调用时,显然不存在。

Long story short, a NullReferenceException occurred which was now CAUGHT by my Exception handler and I tried to call Response.Transfer which boogered up VS.NET who decided that Debugging was never going to work.  Preventing that exception stopped this strange VS.NET startup error.

长话短说,发生了一个NullReferenceException,现在由我的异常处理程序进行了提示,我试图调用Response.Transfer,它使VS.NET变得更加笨拙,从而决定调试将永远无法进行。 防止该异常停止了此奇怪的VS.NET启动错误。

Happy New Year!

新年快乐!

翻译自: https://www.hanselman.com/blog/ending-the-year-with-obscurity-jit-debugging-failed-with-the-following-error

用实时(jit)调试

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值