"Why my Visual Studio debugger is not working for my Silverlight application?" - it's not a new question. People ask this several time in different forums. If you search on net, you may probably find the solution. But, in this post I am just sharing the solution once again for my blog readers and anyone on the net who may face similar issue in future.
In this post, I will share you 4 small tips. Just follow the steps from top to bottom and let me know which one resolved your problem. This tip might not be a new thing for you but don't forget to share to others. This could be useful for them.
One of my blog reader "Raksha" was facing an issue with her Visual Studio debugger. She was not able to find out the way to enable the debugging feature and came to my blog to ask me this question for help:
While working with the Silverlight application, I found that it is not following the breakpoints while running the application. Please suggest a way so that I can debug the Silverlight application using the breakpoints.
There could be some possibilities for that, but let me first tell you that the debugger works in Internet Explorer only. If you are using any browser other than Internet Explorer, you may notice this issue. There are some hacks but I am not interested on that to discuss here. So in such case, just use the IE and that could help you.
If you are facing the same issue in Internet Explorer and my friend @debug_mode is still searching the way to debug it , you should first check whether the Silverlight debugging is enabled for your Silverlight project. To do this, just follow the below mentioned steps:
- Right click on the Web Application project that comes with Silverlight project
- From the context menu, chose "Properties". This will open the properties window in the screen
- As shown in the above screenshot, click the tab named "Web" from the left panel. This will open the web settings window in the right panel
- Scroll the Window down until you see the "Debuggers" group (as shown above)
- There the checkbox for "Silverlight" should be checked by default, if not click it to check.
- Save settings and restart the application in debug mode by pressing F5
Generally this is one of the main reason and people face it due to this option is unchecked.
If the above two solutions fails, there could be an issue with your Visual Studio debugger. It may fail to attach the respective process in memory. To resolve this, run the Silverlight application in debug mode and check whether the breakpoint details are loaded in memory. If not, attach the process of the Silverlight application to the IE and this could load the breakpoint now.
If you are still facing the same issue after following the above three steps, you may try out a different process which is not recommended though, but sometime that helps. Many time I faced same issue where it was unable to load the debugging information and the above mentioned solutions failed. So, what to do in such scenario? Follow the below steps:
- First of all, clean the solution from the Visual Studio
- Close the IDE once you cleaned the solution
- Go to the solution directory and remove all "bin" and "obj" directories
- Go to the "ClientBin" folder and remove the .XAP files
- Open the solution in Visual Studio now
- Rebuild the solution and hit F5 to start the debugging
This time it will load for sure and if not, try to reset the Visual Studio settings by calling the "devenv /resetsettings" command. Again, the final solution is not recommended unless you failed to resolve this by following the first three steps.
Still have issues?
Drop a line below with your findings. If you have any better solution for that, also share it here. This could help other to resolve it by following your steps. Thank you for reading this tip. Don't forget to share with others.