Debugging silverlight application problem

debuggingsilverlight

My VS2010 doesn't stop at breakpoints inside of silverlight application. It appears that no symbols for it have been loaded during debugging. When I hover over the break point it says "The braekpoint will not currently be hit, no symbols have been loaded".

I have tried all of possible solutions offered by google and have no success. The problem occurs even when I create brand new silverlight app hosted by an ASP .NET web project. All of my project configuration looks fine – silverlight debugging is enabled in the Web project.

I am using silverlight 4.
here a link to the sample project created out from the tepmlate.

Any thoughts ?

P.S I just tried to reinstall VS2010 and the problem still exists.

EDIT: I just tested the same project on another machine and it stops at the break point it seams that the problem is somewhere in the configuration of VS or silverlight.

with Matt Dotson's help I managed to attach the debugger manually. However this solution is not good enough for daily use.

Best Answer

Depending on my experience in Silverlight following these steps keep your project debug-gable.

Condition 1>

Firstly we need to be ensure that in Web Project's properties there is a Web section, as you see below Silverlight checkbox must be checked.

enter image description here

Condition 2> Follow In Menu Debug => Attach Debugger>

Visual Studio sometimes can't attach debugging platform you need to lead the way :) . By this way you may debug other platforms,(also you may debug your product platform but pdb files must be sync and don't forget you may suspend your product platform using this).

enter image description here

Condition 3> Your default web browser may be Firefox,Chrome or other than IE.By Visual Studio default try to attach to IE. But when you run VS calls default browser,so you need to have a manual attachment in Condition 2 or set your default browser by right clicking on default page > Browse with .

enter image description here

Condition 4> There is xap file generally located in web project\ClientBin directory. Sometimes after build operations this file can't be replaced and your ProjectDll and your Project PDB files not be sync. This cause wrong line match while debugging or can't find a debugging file attached caution. I strongly suggest delete all generated files in Bus project and delete Clientbin\ProjectName.xap file. After rebuild all it must be ok!

enter image description here

Hope helps.