Click here to Skip to main content
13,045,564 members (70,183 online)
Click here to Skip to main content
Add your own
alternative version


9 bookmarked
Posted 22 Dec 2011

Silverlight Debugging - Beginner's Guide

, 22 Dec 2011
Rate this:
Please Sign up or sign in to vote.
Debug or attach the debugger to any local process running a Silverlight-based application in all supported browsers in your system.


Sometimes people have difficulties to debug Silverlight applications. Let me give you a hint to make it easy. The key thing is to understand that there are two applications (processes) you might want to debug – server and client. If you typically hit F5 sometimes only server gets debugged. That’s why I do it another way.

How To Start Debugging?

  1. At the beginning, Start Without Debugging:


    This will run the server and open the client in your default browser. Because of easier finding of the right process, I close the browser and open client URL in Internet Explorer, since I don’t use it for other tasks (you will see in a minute). You don’t have to start it again as long as the ASP.NET Development Server is running.

  2. Then, before you want to debug your application, you just need to build the solution (in larger applications, rebuilding of the affected project should be enough).
  3. Attach to Process (or press CTRL+ALT+P)


  4. If you want to debug server, attach to process called WebDev.WebServer40.EXE (press keys w,e,b and the listbox will find it for you):


    If you want to debug client, attach to process of your browser (make sure to choose the process of Type Silverlight!). In my case, it is iexplore.exe:


    So, if you want to debug your client app opened in the only Internet Explorer instance running, press: CTRL+ALT+P, i, e, ENTER. Just don’t forget to build the solution and refresh your browser (so that the latest version of client gets loaded).

    1. If you would like to change Default Browser of your Silverlight application, then you may do the following steps:


    2. It will open window "Browse With" with list of all installed browsers in your system. You may set any one to your default or favorites browser for this application.


      In my case, "Firefox (Default)" was default brwoser, now I like "Internet Explorer". Select Browser from list > click on Set as Default button.

  5. Set a Breakpoint

    In a source window, click a line of executable code where you want to set a breakpoint.


    On the Standard Toolbar menu, click on Start Debugging or Press F5 to run the application.

    1. Start or run application


    2. Active or Highlight Debugger

      After debugger hits the breakpoint, you may need to execute the code line by line. "Step Over" [ F10 ] command is used to execute the code line by line, when you are debugging inside a method. If you press "Step Into [F11]" within the current method, then the execution will complete the execution of the method and will pause at the next statement from where it called.



This article basically covers fundamentals of debugging in Silverlight application. It describes how to debug an application using Visual Studio.

Comments or Suggestions

If you find some issues or bugs with it, just leave a comment or drop me an email. If you make any notes on this, let me know that too so I don't have to redo any of your hard work.

Please provide a "Vote" if this would be helpful.


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Sunasara Imdadhusen
Software Developer (Senior) Infostretch Ahmedabad-Gujarat
India India
Aspiring for a challenging carrier wherein I can learn, grow, expand and share my existing knowledge in meaningful and coherent way.

sunaSaRa Imdadhusen


  1. 2nd Best Mobile Article of January 2015

  2. 3rd Best Web Dev Article of May 2014

  3. 2nd Best Asp.Net article of MAY 2011

  4. 1st Best Asp.Net article of SEP 2010

Read More Articles...

You may also be interested in...

Comments and Discussions

QuestionVery good article Pin
craig61a26-Jul-12 11:15
membercraig61a26-Jul-12 11:15 
AnswerRe: Very good article Pin
Sunasara Imdadhusen19-May-13 19:49
professionalSunasara Imdadhusen19-May-13 19:49 
GeneralMy vote of 5 Pin
Savalia_Manoj15-May-12 18:55
memberSavalia_Manoj15-May-12 18:55 
GeneralRe: My vote of 5 Pin
Sunasara Imdadhusen19-May-13 19:49
professionalSunasara Imdadhusen19-May-13 19:49 
QuestionExcellent! my vote of 5 Pin
Savalia_Manoj22-Dec-11 22:44
memberSavalia_Manoj22-Dec-11 22:44 
AnswerRe: Excellent! my vote of 5 Pin
Sunasara Imdadhusen19-May-13 19:49
professionalSunasara Imdadhusen19-May-13 19:49 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.170713.1 | Last Updated 23 Dec 2011
Article Copyright 2011 by Sunasara Imdadhusen
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid