在浏览器外运行时调试服务器项目?

时间:2012-06-16 14:53:49

标签: silverlight debugging out-of-browser

当我在VS 2010中使用调试启动Silverlight 4和5应用程序时,我可以在客户端项目以及为应用程序提供服务的服务器项目中设置断点。

在浏览器外运行应用程序(即在浏览器外配置应用程序并将其设置为启动项目)但是,调试器将不会再连接到服务器,尽管服务器项目仍然存在正确启动。

有解决这个问题的方法吗?

1 个答案:

答案 0 :(得分:1)

您可以在要中断的位置设置启动或中断语句。

// Will launch a debugger once and will break once
System.Diagnostics.Debugger.Launch();

//Will launch a debugger and break any time the code is hit
System.Diagnostics.Debugger.Break();