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



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

但是,在浏览器外

运行应用程序(即在浏览器外配置应用程序并将其设置为启动项目)时,调试器将不再附加到服务器,尽管服务器项目仍将正确启动。

有没有办法解决这个问题?

您可以在要中断的位置设置 Launch 或 Break 语句。

// 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();

最新更新