如何调试我的 Silverlight 4 应用程序?
我不知道如何让我的断点纳入我的 silverlight 应用程序。我尝试过设置测试页面,但似乎没有任何效果。
以下是我尝试过的一些操作:
启用 Silverlight 调试:在我的 Web 项目中,我已设置 'Web' => '调试器' =>选中“Silverlight”。
附加到进程:我使用的是 Chrome,但我需要附加调试器的页面在“附加到进程”窗口中被禁用。
使用 Firefox:我关注了 Tim Heuer 的 帖子 其中他描述了在 about:config 页面中关闭 npctrl。
在过去的几个小时里我也尝试了很多其他的事情,但没有任何效果。我担心我错过了一些东西。
更新:2011 年 10 月 20 日
修复了问题并在下面发布了我的答案。
I cannot figure out how to get my breakpoints to take in my silverlight application. I've tried setting up a test page, but nothing seems to work.
Here are some of the things I've tried:
Enable Silverlight Debugging: In my Web project, I've set the 'Web' => 'Debuggers' => 'Silverlight' to checked.
Attach to Process: I'm using Chrome, but the page I need to attach my debugger to is disabled in my 'Attach to Process' window.
Using Firefox: I followed Tim Heuer's post where he describes turning off npctrl in the about:config page.
I've tried many other things as well over the last few hours, but nothing is working. I fear that I'm missing something.
UPDATE: October 20, 2011
Fixed the problem and posted my answer below.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
已修复! 我通过删除所有自动生成的文件(*.user、*.suo、/bin 和 /obj)解决了该问题。这是一个多么可怕的错误啊。以下是我检查的所有内容:
确保我的 ASP.NET MVC 应用程序具有“Silverlight 调试”
检查过。通过导航到我的 Web 项目的属性页 => 来完成此操作
网页选项卡 => {滚动到底部} =>检查“Silverlight”
将我的默认浏览器设置为 Internet Explorer。这样做是对的
单击我的 Web 项目中的 TestPage.aspx =>浏览... =>
Internet Explorer(不确定是否需要这样做,但我确实这样做了,所以..)
从 Internet Explorer 中清除了我的 Web 缓存。通过打开 IE => 来做到这一点[工具=>选项...] => [常规选项卡] => 【浏览历史记录组】=>删除历史记录按钮!
从 Visual Studio 中删除了所有自动生成的文件。这是通过手动查找所有 *.csproj.user 文件、*.suo 文件以及所有“/obj”和“/bin”文件夹来完成的。
交叉我的手指! (重要的一步!)
打开我的项目...在我的 Silverlight 代码中设置断点...单击“运行”!
令我惊讶的是,一切都开始起作用了。我很高兴。 :) 最终这是由于我自动生成的文件,因为我一遍又一遍地执行前 5 个步骤,但无济于事。我确实相信每一步都在让我再次调试应用程序方面发挥了关键作用,但最后一步对我来说是更重要的。
在这次“冒险”过程中,我一度甚至重新安装了 VS2010、VS2010 SP1、Resharper 6、Silverlight 4 开发工具等等……基本上,我的完整开发环境。这是因为我认为我的机器上有无效版本的 Silverlight 4。在尝试“修复”Silverlight 4 开发人员工具时,安装告诉我 Visual Studio 2010 没有正确安装...因此出现了脱轨路径...呃!尝试调试我的 Silverlight 应用程序花费了很多时间。然而,现在世界一切都好。
我希望我的帖子对某人有所帮助!
Fixed! I fixed the problem by removing all auto generated files (*.user, *.suo, /bin, and /obj). What a nightmare of a bug this has been. Here was everything I checked:
Ensured my ASP.NET MVC application had 'Silverlight Debugging'
checked. Did this by navigating to my Web project's Property Page =>
Web Tab => {Scroll to bottom} => Check 'Silverlight'
Set my default browser to Internet Explorer. Did this by right
clicking on my TestPage.aspx in my web project => Browse with... =>
Internet Explorer (not sure if this was needed but I did do this, so..)
Cleared my Web Cache from Internet Explorer. Did this by opening IE => [Tools => Options...] => [General Tab] => [Browsing History Group] => Delete History button!
Removed all my auto-generated files from Visual Studio. Did this by manually finding all *.csproj.user files, *.suo file, and all "/obj" and "/bin" folders.
Cross my fingers! (Important step!)
Open my project... set a break point in my Silverlight code... clicked Run!
To my surprise it all began working. I rejoiced. :) Ultimately it was due to my auto generated files, because I did the first 5 steps over and over and over, to no avail. I do believe that each step played a key role in getting me to debug my application again, but the last step was the kicker for me.
At one point during this "adventure", I went so far as to reinstall VS2010, VS2010 SP1, Resharper 6, Silverlight 4 Developer Tools, etc, etc... Basically, my full dev environment. This was because I thought I had an invalid version of Silverlight 4 on my machine. Upon trying to "Repair" the Silverlight 4 Developer Tools, the install told me that Visual Studio 2010 wasn't properly installed... hence the derailing path... Ugh!! Many hours were lost trying to debug my Silverlight application. However, all is good with the world now.
I hope my post helps somebody!