109221793
109221793

Reputation: 16897

Debugging Silverlight in Visual Studio 2010

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.

Upvotes: 7

Views: 14497

Answers (5)

RayLoveless
RayLoveless

Reputation: 21108

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

Upvotes: 3

Ervin Czimskey
Ervin Czimskey

Reputation: 101

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:

  1. Start debugging your Silverlight app. Your app should be running in Chrome.
  2. From the Debug menu, select Attach to Process...
  3. Scroll through the available processes and locate the chrome.exe process that shows the type as 'Silverlight x86'.

  4. Select that process and click Attach.

Upvotes: 4

sanket
sanket

Reputation: 32

Right Click on Web.UI project in solution. go to Web , check Debuggers --> Silverlight save and Debug.. Make sure you have silverlight developer installed.

Upvotes: 1

Mart
Mart

Reputation: 5798

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.

Upvotes: -1

Noah
Noah

Reputation: 15340

Be sure to set the Silverlight Debugging checkbox on the project properties Web tab

Upvotes: 17

Related Questions