怎样在windows media center里面调试add-in assemblies

在我现在安装的Vista版本里面这个已经是自动实现了的。不用自己手动修改注册表。但是还是讲下怎么手动修改注册表以显示调试信息。

 

*************************************************************************************************

2006.7.26博客原文:

As many of you have probably noticed, it can be tricky to debug problems that occur while loading and running an add-in assembly hosted within Windows Media Center.  Fortunately, there are 2 fixes in post-beta 2 builds of Windows Vista (vista 发布的beta2版本) that make Windows Media Center add-in debugging a little easier.

Enabling the Details button for the add-in crash dialog

The first debugging fix we have added is a registry value that will add a Details button to the error dialog that appears when a Windows Media Center add-in crashes.  The registry value is located at:

[HKEY_CURRENT_USER/Software/Microsoft/Windows/CurrentVersion/Media Center/Settings/Extensibility]
EnableErrorDetails = 1 (REG_DWORD)

The Windows Media Center SDK for Windows Vista sets this value automatically starting with the 5456.5 build that is available on the Microsoft Connect site for Windows Vista beta program members, and you can also set it manually on a Windows Vista OS that contains Windows Media Center to gain the same functionality.

When you have this registry value set, you will see a dialog that looks like the following when an add-in crashes:(Add-in Assembly 崩溃时显示一个细节按钮)

The Details button only appears if the registry value is set.  The rest of the dialog will look the same regardless of whether or not you have the registry value set.

When you click on the Details button, Windows Media Center will display the callstack that caused the crash.  It will look something like this:

 

Unfortunately, because of the way that Windows Media Center add-ins are hosted in an external process (ehexthost.exe) and how some of the exceptions thrown by Windows Media Center are wrapped and bubbled back up, the callstack may not always be particularly useful.  However, there are many cases where this has already proven useful to our development team while trying to track down add-in crashes.

Enabling a dialog to allow you to attach a debugger

The second debugging fix we have added is a registry value that will cause a Windows Media Center dialog to appear when attempting to launch any add-in.  The dialog will display the process name and process ID that you can use to attach a debugger, set breakpoints, and step through the code that is called in your add-in when Windows Media Center attempts to load and run it.  The registry value is located at:

[HKEY_CURRENT_USER/Software/Microsoft/Windows/CurrentVersion/Media Center/Settings/Extensibility]
EnableAddInLaunchDebugging = 1 (REG_DWORD)

When you have this registry value set, you will see a dialog that looks like the following when attempting to launch any add-in within Windows Media Center:

While this dialog is on-screen, you can attach your debugger of choice to the specified process name/ID and then press OK to resume the Windows Media Center add-in launch process.

Unlike the previous registry value, the Windows Media Center SDK does not automatically set this value because it noticeably interferes with the ordinary usage of Windows Media Center in non-development scenarios.  You will have to set this registry value yourself to gain this functionality.

Hopefully these new registry tweaks will be useful to you as you develop and debug your Windows Media Center add-ins.

Aaron

***************************************************************************************

i've add the enabledebugdialog key mannually in my registory.

it's useful to developer.

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值