Debug.Assert的(假)不会在Win8中的地铁应用程序触发会在、应用程序、地铁、Debug

2023-09-03 16:08:37 作者:余季辞

我注意到Debug.Assert的不能在地铁应用程序触发,但是,如果该项目是一个传统的像控制台或WinForm的,但它确实触发。是的,我在调试模式下。

I notice Debug.Assert does not trigger in Metro apps, however, if the project is a traditional one like Console or WinForm, it does trigger. And yes, I am in Debug mode.

这难道不是在Visual Studio(11测试版)设置正确的设置?或者Debug.Assert的目的是在地铁应用程序被禁用?

Is it a setting not properly set in Visual Studio (11 Beta)? Or Debug.Assert is intended to be disabled in metro apps?

我知道很多例外的地铁应用程序的执行过程中吞噬,但Debug.Assert的是如此得心应手,我想不出一个原因,它应该被禁用。

I know many exceptions are swallowed during the execution of Metro apps, but Debug.Assert is so handy that I can't think of a reason why it should be disabled.

推荐答案

它的确实的触发,看在输出窗口。它只是不会自动提示你要问,如果你想有一个调试器打破,因此只是保持驾驶。

It does trigger, look in the Output window. It just doesn't automatically prompt you to ask if you want a debugger break and thus just keeps motoring.

在DefaultTraceListener.AssertUIEnabled属性为false。这是一个实施的问题,不能在Metro UI的顶部显示一个消息框。这不实际工作,但显示器切换到桌面,pretty的不受欢迎的时候,你会喜欢点击号难以解决和待办事项列表上毫无疑问的。你不能轻易得到的财产将其设置为true,这是从元数据不可访问。菲利普的解决方法听起来半体面。

The DefaultTraceListener.AssertUIEnabled property is false. That's an implementation problem, can't display a message box on top of Metro UI. Which does actually work but the monitor switches to the desktop, pretty undesirable when you would have liked to click No. Hard to solve and no doubt on the todo list. You can't easily get to the property to set it to true, it is inaccessible from the metadata. Filip's workaround sounds half-decent.

 
精彩推荐
图片推荐