Christopher Bennage

Sponsors

The Lounge

Wicked Cool Jobs

Syndication

Silverlight Breakpoints Not Being Hit

Just a quick and simple reminder. If you run into the case where you are not hitting breakpoints in your Silverlight code, take a look at the properties of your hosting web project (if applicable).

On the Web tab, under Debuggers is a set of checkboxes.

Web Project Properties

First, ensure that Silverlight is checked.

If it is already checked, then uncheck it, save the project, check it back, and save again.

I’ve had this fix the problem at least once.


Posted 01-17-2010 3:55 PM by Christopher Bennage

[Advertisement]

Comments

Henning Anderssen wrote re: Silverlight Breakpoints Not Being Hit
on 01-18-2010 4:33 AM

That alone doesn't always fix the problem. I 've encountered the same problem many times, on the same project, and I have checked Silverlight debugging.

What I found was that the code was not always compiling, or atleast not copied to the appropriate directory. We use TFS as our source control system, and TFS marks every file as Read only, which sometimes poses a problem for silverlight builds. I had to check out the XAP file and then it usually worked, but still no guarantees :(

Christopher Bennage wrote re: Silverlight Breakpoints Not Being Hit
on 01-18-2010 8:53 AM

Yes, I've also had an issue when using something other than IE as my default browser.

Lakshmi wrote re: Silverlight Breakpoints Not Being Hit
on 01-18-2010 10:57 AM

just another point: when attaching to a running process, the type of code needs to be "Silverlight"

new learners often keep this as "managed code"

Cornel wrote re: Silverlight Breakpoints Not Being Hit
on 01-26-2010 9:57 AM

If you want to debug your javascript code under Silverlight you have to uncheck the 'Silverlight' checkbox. You cannot debug both at the same time according to msdn.

Michael Urvan wrote re: Silverlight Breakpoints Not Being Hit
on 02-20-2010 5:51 AM

That checkbox is saved in the "csproj.user" file in the web site project that hosts the Silverlight application, so that file must be writable and have the property:

<WebProjectProperties>

...

  <SilverlightDebugging>True</SilverlightDebugging>

...

</WebProjectProperties>

When working on teams where the .user files are not in source control (and rightfully not), every time a fresh copy is retrieved from source control that user will not have silverlight debugging enabled and their breakpoints will not hit because the .user file will not exist yet.

Also, merely setting the checkbox and saving the project does not necessarily enable debugging either (possibly because it does not cause a rebuild of the xap in clientbin)..

I know that in the web project properties - Silverlight Applications tab, you can remove and re-add the silverlight project which enables debugging properly.

Add a Comment

(required)  
(optional)
(required)  
Remember Me?

About The CodeBetter.Com Blog Network
CodeBetter.Com FAQ

Our Mission

Advertisers should contact Brendan

Subscribe
Google Reader or Homepage

del.icio.us CodeBetter.com Latest Items
Add to My Yahoo!
Subscribe with Bloglines
Subscribe in NewsGator Online
Subscribe with myFeedster
Add to My AOL
Furl CodeBetter.com Latest Items
Subscribe in Rojo

Member Projects
DimeCasts.Net - Derik Whittaker

Friends of Devlicio.us
Red-Gate Tools For SQL and .NET

NDepend

SlickEdit
 
SmartInspect .NET Logging
NGEDIT: ViEmu and Codekana
LiteAccounting.Com
DevExpress
Fixx
NHibernate Profiler
Unfuddle
Balsamiq Mockups
Scrumy
JetBrains - ReSharper
<-- NEW Friend!

 



Site Copyright © 2007 CodeBetter.Com
Content Copyright Individual Bloggers

 

Community Server (Commercial Edition)

CodeBetter.Com