Debugging A Silverlight Project With Windows 7 & VS2012
This is something I tend to forget from time to time. When I look on the Internet I do find some help but the names do not line up exactly the same for me. For this post I am using Windows 7 and Visual Studio 2012.
With Silverlight, if you start it in debug mode you may end up debugging the client or the server. I find it much easier to do the following.
- Start Internet Explorer, I suppose you could use any browser of choice but for Silverlight debugging I prefer to stay in IE.
Browse to your Silverlight application using http://localhost…. I get that url by running it in Visual Studio and just adding it to my favorites.
- In Visual Studio click on the Debug menu item at the top, then click on Attach to Process.
- There are three processes I attach it to:
- Two of these, one is listed with the title of the Silverlight home page the other has a type of Silverlight
- For my environment this has a Type of Managed and a User Name of IIS APPOOL\DefaultAppPool
- You may receive an Attach warning (see image below). You selected this and know what it is so click Attach.
For me that’s it, I’m now debugging a large Silverlight 4 application and hitting my various break points. I hope this helps some people other than just me.