26

I am using VS2010, and Silverlight 4. When I run my code the debugging does not work (I get the above error on my breakpoints.

When I clean my solution a warning comes up saying that the system cannot find the file specified (a project dll). It is looking in the right path (..\debug), but there is no dll present.

I started a new Silverlight 4 project, and get the same error.

Sometime's the debugging does work (I am not sure if/what anything changed, but on one occasion I was surprised that my breakpoints worked. After changing one thing the breakpoints stopped working)

John Saunders
  • 160,644
  • 26
  • 247
  • 397
Grayson Mitchell
  • 1,187
  • 4
  • 22
  • 43

17 Answers17

51

For me I had to go in the properties of the Web project » Web tab » Check 'Silverlight' in the Debugger section at the bottom. enter image description here

Vimes
  • 10,577
  • 17
  • 66
  • 86
Marc Roussel
  • 511
  • 4
  • 2
27

Make sure you are using Internet Explorer to debug your Silverlight app. Make sure you are using Internet Explorer as your default browser. If you are not debuggin in IE, the IDE will not recognise breakpoints.

Donal
  • 286
  • 2
  • 2
  • yea, I was using chrome (I think it has worked 'occasionally in chrome). Have not had an issue with Firefox before, will test out firefox later and post the results. When I clean the solution, I still get the warnings about the dll's, but the breakpoint do work. – Grayson Mitchell Apr 25 '10 at 22:22
  • 2
    I'm still getting this problem after a clean, rebuild and running in IE. – RandomEngy May 19 '10 at 19:52
  • Tried every solution here. Nothing works. And, I cannot attach to process because there is a bug somewhere in the startup of the SL project which causes it to crash within seconds. ie. no process to attach to. – maplemale Jun 04 '14 at 15:38
6

For Silverlight applications enabling hit of breakpoint:

  1. In the Solution explorer right click on the Web Side of the project and select properties.
  2. Navigate to Web Tab, in the property window that opened.
  3. Scroll down and check the Silverlight option in Debugger section.
Neelesh
  • 116
  • 2
  • 8
5

Clean both the regular project and Web project separately. Build the web project. Update the web reference. Build the regular project.

Kenneth W
  • 51
  • 1
  • 1
  • I had everything setup properly already and was using IE to debug. For whatever reason it had quit working and breakpoints weren't being hit. I cleaned the solution and this did the trick! Thanks – Wil P Jun 19 '12 at 12:46
  • I didn't have to follow exactly this process, but cleaning and rebuilding the solution fixed it (magically). – Kate Mar 27 '14 at 10:10
3

What solved it for me was turning off the read-only flag on the xap file. I think it was set by Team Foundation Server.

MCF
  • 31
  • 1
3

Click on "Attach to Process" option from "Debug" menu. Click the "Select" button. Then select "Debug these code types" option and select "Silverlight" checkbox and Click OK.

SVP
  • 43
  • 1
  • 4
1

I have one more solution to this problem, which solved it in my case.

When you are attaching debugger to 'iexplorer' process click on the "Select" button, near "Attatch To" option and then select "Silverlight" code type. If box with communicate such as "Install Silverlight Runtime" appears then, well, that's the point :)

1

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?

Solution

If you are facing the same issue in Internet Explorer and my friend @debug_mode is still searching the way to debug it Winking smile, 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. Image
  • 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
1

You can enable firefox debugging by disabling isolation feature in few simple steps. I have written a post about it on here - Enable Visual Studio Debugging in Firefox.

mchoudhary
  • 11
  • 1
0

Yet another solution as nothing here worked for me. Try deleting the xap file (default location is the Client\myproject.xap in the web project) and let it re-generate. If it doesn't regenerate when you build, there is a problem with how your SL application is referenced in the web project and the solution here should fix it:

.Xap file is not generated in Sivlerlight Web Application

Community
  • 1
  • 1
maplemale
  • 2,006
  • 21
  • 35
0

It sounds like you are either loading the release version of your code or an old version of your code.

If you do a clean and then build does the problem "go away" - at least for a while.

Make sure that when you finish running your application you close the web browser. You might even have to stop the web server that Visual Studio starts for you.

ChrisF
  • 134,786
  • 31
  • 255
  • 325
0

In my case, I knew the uploaded files were uploaded and so I didn't re-upload them. However that is what fixed it.

Clean -> Rebuild -> Upload

Tom Hanson
  • 873
  • 10
  • 39
0

I had the same issue. Here's how I eventually got it working:

  • you need a web project to host the silverlight control. just letting it create a test file doesn't seem to work (i.e. you need http://localhost... instead of file://...)
  • when attaching to IE, don't just pick the iexplore.exe that has the title of your application, pick one that has "Silverlight, x86" in the "Type" column.
Mark Heath
  • 48,273
  • 29
  • 137
  • 194
0

What solved it for me was turning off caching in ie:

Settings - Internet Options - General - 
    The Settings-button under 'Browsing history' - 
    checkmark in 'Everytime I visit the webpage'
Njal
  • 557
  • 5
  • 9
0

In the hope this can help someone. I have Resharper installed and it seems like the Resharper Build has trouble correctly building Silverlight Applications. Once I turned it off, the error went away.

Frank.Germain
  • 628
  • 6
  • 11
0

Yeah as others have said, you need to use Internet explorer to be able to debug Silverlight applications. Stupid or What! If you use Chrome or Firefox for regular browsing, you can get an extension for Visual Studio 2010 using nuget. I wrote a short blog about it here

John Mc
  • 2,862
  • 1
  • 22
  • 37
-1

For me, what worked was unmark the 'Optimize code' option inside the silverlight project properties page. Using Visual Studio 2015.

  • This looks more like it should be a comment. To be an answer, it should explain *how* and *why* this addresses the symptoms seen. – Toby Speight Nov 14 '19 at 15:12
  • 1
    sorry, my bad. but after spend some hours in the same problem, uncheck this solved for me. – Marnei Santos Nov 14 '19 at 17:44
  • 1
    @TobySpeight This *is* an answer though. It does not need to explain how and why in order to be an answer: It needs to these in order to be a **good** answer. – Blue Nov 15 '19 at 00:29
  • [Looks like an answer](https://meta.stackoverflow.com/questions/265552/when-to-flag-an-answer-as-not-an-answer) – robsiemb Nov 15 '19 at 00:34