如何调试 Silverlight 4 应用程序? [英] How do I debug my Silverlight 4 application?

查看:25
本文介绍了如何调试 Silverlight 4 应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不知道如何在我的 Silverlight 应用程序中设置断点.我试过设置测试页,但似乎没有任何效果.

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:

启用 Silverlight 调试:在我的 Web 项目中,我已将 'Web' => 'Debuggers' => 'Silverlight' 设置为选中.

Enable Silverlight Debugging: In my Web project, I've set the 'Web' => 'Debuggers' => 'Silverlight' to checked.

附加到进程:我正在使用 Chrome,但我需要附加调试器的页面在我的附加到进程"窗口中被禁用.

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.

使用 Firefox:我关注了 Tim Heuerpost 他描述了关闭 npctrl在 about:config 页面中.

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.

更新:2011 年 10 月 20 日

解决了问题并在下面发布了我的答案.

Fixed the problem and posted my answer below.

推荐答案

已修复! 我通过删除所有自动生成的文件(*.user、*.suo、/bin 和/对象).这是一个错误的噩梦.这是我检查的所有内容:

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:

  1. 确保我的 ASP.NET MVC 应用程序具有Silverlight 调试"检查.通过导航到我的 Web 项目的属性页 =>网页标签 => {滚动到底部} => 选中Silverlight"

  1. 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'

将我的默认浏览器设置为 Internet Explorer.这样做是对的单击我的 Web 项目中的 TestPage.aspx => 浏览... =>Internet Explorer(不确定是否需要,但我确实这样做了,所以..)

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..)

从 Internet Explorer 清除了我的 Web 缓存.通过打开 IE => [工具 => 选项...] => [常规选项卡] => [浏览历史记录组] => 删除历史记录按钮来做到这一点!

Cleared my Web Cache from Internet Explorer. Did this by opening IE => [Tools => Options...] => [General Tab] => [Browsing History Group] => Delete History button!

从 Visual Studio 中删除了我所有自动生成的文件.通过手动查找所有 *.csproj.user 文件、*.suo 文件以及所有/obj"和/bin"文件夹来做到这一点.

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!)

打开我的项目...在我的 Silverlight 代码中设置一个断点...点击运行!

Open my project... set a break point in my Silverlight code... clicked Run!

令我惊讶的是,这一切都开始奏效了.我很高兴.:) 最终是由于我自动生成的文件,因为我一遍又一遍地执行前 5 个步骤,但无济于事.我确实相信每一步都在让我再次调试我的应用程序方面发挥了关键作用,但最后一步对我来说是关键.

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.

在这次冒险"中的某个时刻,我什至重新安装了 VS2010、VS2010 SP1、Resharper 6、Silverlight 4 开发工具等……基本上,我的完整开发环境.这是因为我认为我的机器上有一个无效的 Silverlight 4 版本.在尝试修复"Silverlight 4 开发人员工具时,安装告诉我 Visual Studio 2010 没有正确安装......因此出轨路径......呃!在调试我的 Silverlight 应用程序时浪费了很多时间.然而,现在世界一切都很好.

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!

这篇关于如何调试 Silverlight 4 应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆