在 Visual Studio 2010 中调试 Silverlight
我有一个使用 silverlight 控件的 MVC 应用程序。
在此过程中,silverlight cs 代码中发生了一些不正确的事情。我在 CS silverlight 代码中插入了断点,以便更好地了解正在发生的情况,但由于某种原因,我无法单步执行代码。
我知道代码正在被命中,但它只是没有在调试器中显示给我。
我以为这可能是因为我使用 Chrome 作为默认浏览器,但我将其更改为 Internet Explorer,但仍然不高兴。
我意识到这是一个非常模糊的问题,但是其他人有没有经历过类似的事情,如果有的话,你是如何解决这个问题的?
任何帮助将不胜感激,
谢谢。
I have an MVC application which uses a silverlight control.
Somewhere along the line something is happening in the silverlight cs code that isn't right. I've inserted break points in the CS silverlight code to get a better idea of what's happening, but for some reason I just can't step through the code.
I know code is being hit, but it's just not showing me in the debugger.
I thought it might be because I was using Chrome as the default browser but I changed this to Internet Explorer and still no joy.
I realize this is a very vague question, but has anyone else experience anything similar, and if so, how did you get around it?
Any help would be appreciated,
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
确保在项目属性 Web 选项卡上设置 Silverlight 调试复选框
Be sure to set the Silverlight Debugging checkbox on the project properties Web tab
如果 Chrome 是您的默认浏览器,并且您的断点工具提示显示以下消息:
“当前不会命中断点。此文档没有加载任何符号”
...那么调试器可能在调试启动时附加到错误的 Chrome 进程。解决方法是:
滚动浏览可用进程并找到类型显示为“Silverlight x86”的 chrome.exe 进程。
选择该进程并单击“附加”。
If Chrome is your default browser and your breakpoint tooltip shows this message:
"The breakpoint will not currently be hit. No symbols have been loaded for this document"
... then it is possible the debugger attached to the wrong Chrome process at debug startup. A work-around is:
Scroll through the available processes and locate the chrome.exe process that shows the type as 'Silverlight x86'.
Select that process and click Attach.
我将 Firefox 作为我的默认浏览器,但没有受到任何影响(我什至尝试附加到进程)。最终对我有用的是将 IE 设置为默认值。
现在我遇到了 Silverlight 断点! :)
I had firefox as my default browser and nothing was being hit(I even tried attaching to a process). What finally worked for me was setting IE as the default.
Silverlight break points are now being hit for me! :)
右键单击解决方案中的 Web.UI 项目。转到 Web ,检查调试器 --> Silverlight保存和调试..
确保您安装了 silverlight 开发人员。
Right Click on Web.UI project in solution. go to Web , check Debuggers --> Silverlight save and Debug..
Make sure you have silverlight developer installed.
您的代码可能是用 System.Diagnostics.DebuggerStepThroughAttribute 标记的类的一部分。自动生成的类会发生这种情况(例如添加服务引用)。如果要扩展分部类,则类定义的其他部分可能具有该属性。
尝试取消选中
选项/调试/常规/启用仅我的代码
复选框。否则,将鼠标放在源代码窗口中的红点上,如果调试器禁用它,该红点将变成空圆圈,工具提示将为您提供附加信息。
Your code may be part of a class marked with the
System.Diagnostics.DebuggerStepThroughAttribute
. This happens with auto generated classes (like with Add Service Reference). If you are extending a partial class, other parts of the class definition may have that attribute.Try unckecking the
Options / Debugging / General / Enable Just My Code
checkbox.Otherwise put your mouse over the red dot in the source code window, which becomes an empty circle if the debugger disabled it, a tooltip will give you additional information.