Debugging Silverlight not hitting breakpoints
Asked Answered
U

7

2

i am trying to develop a Silverlight application for a school project.

But I’m having problems with Visual Studio not loading the break point, making it very hard to debug a Silverlight application using ViewModels.

I have tried adding "Silverlight" under "Project Properties" -> "Web" -> "Silverlight", but this have done nothing.

It is strange because it works some times. I have tried using Chrome, Firefox and Internet Explorer. And with Silverlight 4 and 3.

Do any one know a solution for this?

Unpleasantness answered 29/12, 2010 at 18:57 Comment(0)
S
6

I found that it helped if you set your default browser to IE (I've only used IE8 with Silverlight). That way, when you press F5, Visual Studio does seem to be able to connect up the debugger to the Silverlight plugin. You should then be able to use the VS debugger.

I certainly had difficulty trying to debug Silverlight applications with Firefox. Firefox runs plugins (including the Silverlight plugin) in a separate process, and I guess VS isn't smart enough to realise that Silverlight isn't running in the process it started. You can manually attach the VS debugger to the plugin-container process, but (if my memory serves me correctly), I didn't find this to always be reliable. I certainly found debugging a lot more reliable after switching my machine's default browser to IE.

Also, in your comment on Detroitpro's answer, you wrote

It is telling the that no symbols have been loaded even before i connect with a browser, so i don't think that is is that[...]

If you put a breakpoint in before you start your Silverlight app in a browser, then you probably will get a 'no symbols have been loaded' message. When you start debugging, Visual Studio will start the ASP.NET dev server, to serve up an HTML page that contains your Silverlight app if nothing more. The 'no symbols' message means that VS couldn't find the class you put the breakpoint in in any of the processes its debugger is connected to. (At this point, the only process the VS debugger is attached to is the ASP.NET dev server.) Once you open a browser to view a page containing your Silverlight app, and connect the VS debugger to the process running the Silverlight plugin, it should get rid of the 'no symbols' message.

Finally, another way of telling whether the VS debugger has connected to a process running your code is to bring up the Modules window (Debug > Windows > Modules). If your app's DLL isn't in the modules list, you'll get the 'no symbols have been loaded' message if you attempt to put breakpoints in your app's code.

Sexy answered 29/12, 2010 at 22:8 Comment(0)
V
3

You have to Attach the Plugin Container of Firefox to the Debugging Process, as Firefox is not running any Plugins within the main process anymore.

Go to Debug -> Attach to Process... -> Search for Plugin-Container and hit the Attach button.

Now debugging should work again.

Viquelia answered 18/2, 2011 at 11:4 Comment(0)
A
2

Here's what worked for us with Internet Explorer 9

  1. Start the project with Ctrl-F5.

  2. Use the debug menu to attach to the browser process.

  3. Stop the project.

  4. Run the project with F5.

Averyaveryl answered 5/5, 2011 at 15:15 Comment(0)
J
1

Here is the solution that worked for me when debugging was not working in Firefox:

  1. Type "about:config" into the address bar of Firefox
  2. Find the property named "dom.ipc.plugins.enabled"
  3. Change the value from true to false by double clicking
  4. Restart all Firefox browsers
  5. Go back to Visual Studio and start debugging!
Jiggle answered 11/5, 2011 at 13:16 Comment(0)
P
0

I had this sample problem a few weeks ago; that's when I learned that Firefox and Chrome both have bugs that cause them not to be able to debug silverlight. Also, make sure you are using a newer version of IE. There is some random middle version of IE that won't load correctly either.

Prynne answered 29/12, 2010 at 19:7 Comment(2)
It is telling the that no symbols have been loaded even before i connect with a browser, so i don't think that is is that, i should have the newest version of IEUnpleasantness
Firefox has a plugin that allows debugging.Cartage
C
0

click debug->exceptions and check the thrown checkbox near the .net exceptions.

Carnify answered 24/1, 2013 at 9:18 Comment(0)
C
0

Just as an addition to the answers above, I've found that you can launch the application outside of the browser by right clicking the project and going to Properties. Then in the Silverlight tab select the tick box 'Enable running application out of the browser'. It should now hit the breakpoints you've set without you having to change your default browser or attaching to a specific process.

Cerracchio answered 9/10, 2016 at 11:10 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.