Visual Studio Debugging with Silverlight 4 and Firefox - visual-studio-2010

When trying to debug a Silverlight 4 application in Visual Studio 2010 with Firefox as my browser, I am unable to hit any breakpoints. I get the message "breakpoint will not currently be hit".

Here is the solution that worked for me when debugging was not working in Firefox:
Type "about:config" into the address bar of Firefox
Find the property named "dom.ipc.plugins.enabled"
Change the value from true to false by double clicking
Restart all Firefox browsers
Go back to Visual Studio and start debugging!
Hope this saves someone else some time!

Firefox hosts silverlight (and other plugins) in a sandboxed process called plugin-helper.exe.
Manually attach your debugger to the correct instance of this (it'll have "Silverlight" in the process type field), and you get your debugging back, and you get to keep your plugin sandboxing too.
EDIT:
Looks like someone else sick of doing this by hand and wrote an VS2010 addon to automatically attach to plugin-helper.exe.

Related

Visual studio web project debug resets chrome settings every run

I have problem with debugging my web application from Visual Studio 2017.
I have selected Chrome as default web browser, even checked path to chrome.exe file and seems to be OK.
The problem is, that every time, when I'm starting debugging, it opens new instance of Chrome window, which seems to be completely clean. If I set some setting (for example, deselect "auto translate websites", at next debug session it is selected again.
Another thing is, that chrome session is loading without any plugins, and if I install a plugin during one session, it's not appearing at second one.
Anyone has solution for this problem?
From your VS2017, go to Tools, Options, Debugging, General.
Make sure that option for -Enable JavaScript debugging for ASP.NET (Chrome and IE)- is NOT checked.

How can I debug Silverlight 5 applications in Visual Studio 2012 after installing Internet Explorer 10?

I can no longer debug my Silverlight application in Visual Studio after updating to Internet Explorer 10. I made no other changes to my system and it was working fine with Internet Explorer 9 just before the update to IE10. When I hit F5 in Visual Studio, IE10 is fired up and the Silverlight application runs in the browser, but breakpoints are not hit in Silverlight code. If I hit shift+F5 (stop debugging), the browser remains open (this used to shut it down). Alternatively, if I close the browser while debugging, it doesn't stop debugging in Visual Studio (which it always did before). I'm running Win7 64.
This problem has also been reproduced in Visual Studio 2010 and Silverlight 4.
I had the same problem with Visual Studio 2012 and Silverlight 5. The symptoms that I was getting included the following.
Multiple browser instances would be opened when I started the application in debug mode within Visual Studio.
I sometimes got an error in the browser saying that the application could not be loaded.
Visual Studio would automatically detach from the browser and drop out of debug mode.
Turning off the Silverlight debugger (see the Web tab in the properties dialog for the web project) seemed to result in less of the other problems. This did however mean that I could not debug Silverlight code.
To resolve these issues, I right clicked on an aspx file in the solution explorer and selected 'Browse With...' to open the following dialog.
Note that there are two entries for 'Internet Explorer'.
I removed both (I set Firefox as the default temporarily to do so), cancelled out of the dialog and then reopened it. At this point, a new entry for 'Internet Explorer' had been added back in automatically. I made this the default and then had no further issues.
I had the same with VS2012..
Looks like Visual studio got confused which IE to use - somehow in system I hade two instances of IE as target browser (In VS2012 window called "Browse With..")
I removed all IE's from VS targets and restarted VS. Then only one instance of IE appeared after and debugger attaches normally.
I had a similar problem after opening a Silverlight-based application in two instances of IE10 at the same time. I could not debug. After which, I had switched between Chrome and IE10 in order to try and solve the problem. I could debug in Chrome but not IE10. But Chrome was cumbersome to run for debugging purposes.
Ultimately, I had to remove all the temporary files associated with VS builds in a three places:
C:\Users\brchase\AppData\Local
C:\Windows\Microsoft.NET\Framework\v4.0.30319
C:\Windows\Microsoft.NET\Framework64\v4.0.30319
As well, I had to do a complete clean on the project and shut down IISExpress.
Also, I did a Tools /Delete Browsing History in IE10.
The above worked and I could debug again in IE10 -- even with multiple instances running.
Using Winserver 2008R2, VS2012 or VS2010. Latest version of FireFox does not hit SilverLight breakpoints. Tim Heurs solution at http://timheuer.com/blog/archive/2010/08/16/enable-silverlight-debugging-in-firefox-visual-studio.aspx does not apply as the required line is not in the FireFox config. My fix was to go back to IE9 (My IE10 was broken so I can't say for sure IE10 doesn't work)
Tried all of these suggestions.
Finally had to remove and re-install VS 2012 (which isn't straight forward anymore because after Oct 2013 some of the certificates had expired). Yay Microsoft!
So after re-installing I still had to go into the "Browse To" and switch it from IE to another choice then back to IE and it magically works now..
I think it was because Internet Explorer updated itself and left VS confused..

Why does Visual Web Developer 2008/2010 no longer debug silverlight apps in Firefox?

Suddenly today Visual Web Developer does not allow me to debug Silverlight applications.
This happens in 2008 and 2010 versions.
It gives no error message, just ignores all break points.
It can still debug ASP.NET applications.
Is anyone else experiencing this?
Added:
Interesting: debugging works in Internet Explorer but not in Firefox. Also on a new installation on a second computer it debugs in both IE and FF. Just noticed that that FF browser is still version 3.6.3.
I cleared everything in Firefox (3.6.4) but it still doesn't debug in that browser (on two computers):
alt text http://www.deviantsart.com/upload/l46lcc.png
While uninstalling the Silverlight plugin I saw this:
alt text http://www.deviantsart.com/upload/1i7j8ao.png
Check this link:
http://forums.silverlight.net/forums/t/188434.aspx
The solution seems to be:
Regarding the debugging: I think it
would be possible to write a VS plugin
or similar to attach to the
plugin-container.exe process
automatically, however there's a
simpler solution. You can disable the
new isolation feature in Firefox:
Type "about:config" into FF's address
bar Accept the warning (if applicable)
Search for the entry
"dom.ipc.plugins.enabled.npctrl.dll"
Change its value from "true" to
"false" (double-click) Restart the
browser
Mine seems to work fine in both VS2008 and 2010...

Visual Studio Stop Debugging on IE Close - WebSite?

Would like to know if there is a setting anywhere which causes debugging to automatically stop when IE closes, and also if there is a way for this to work the other way around and IE to close if debugging stops.
I know that this works when the project type I'm working on is a 'Web Application', I'd like to know if the same functionality exists when working on a 'Web Site'
Thanks all.
This should be the default behavior of visual studio. i.e. , if you create a default asp.net website, and F5, then after you quit IE, VS automaticallly stops debugging. it doesn't work for aother browsers since these browsers don't have corresponding interface with VS.

Visual Studio detaches from application as soon as debugging starts

I have a web application that I've always been able to run in Visual Studio and it debugs just fine (breakpoints work, I can pause execution, etc). Recently, the behavior changed suddenly, and a few things happen:
I start debugging, it lauches IE and loads the application, but after a few seconds (sometimes the page hasn't even displayed yet), Visual Studio acts as if debugging has stopped - I'm able to edit code in VS again, and the "Play" button on the toolbar is enabled. The application continues to run in the IE window just spawned, but I'm not attached to it
During this few seconds that VS is "debugging", because it detaches, my breakpoints show as hollow - as if I'm set to "Release" mode and they won't be hit. In fact, I have a breakpoint set in Page_Load, and it skips right by. I've checked, and I'm set to debug mode, though the compile mode dropdown is missing from my toolbar (I checked in the build properties to ensure I was in debug mode).
Can anybody shed some light here?
It turns out that this was actually a result of an upgrade to Windows Vista. VS wasn't being "Run as an Administrator", which caused it to lack the rights to attach to other processes for debugging. As a result, debugging would stop right after it started. Changing the VS shortcut to run as an administrator resolved this problem.
I've experienced samely looking behavior. The cause was in existence of several <system.web> sections (which is allowed by web.config schema). Visual Studio debugger (versions 2008 and 2010 were tested) looks in the first encountered section only. So if your <compilation debug="true"> tag is not in the first one, it thinks that there are no compilation.debug setting present and genrally tryes to add <compilation debug="true"> to the first <system.web>. In some cases VS2008 just silently procceds in this case. For example look here: https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=510354#details"
Have you installed anything else on the server / workstation recently?
We have a third party app that doesn't allow us to debug, w3wp.exe crashes immediately upon an attempt to debug.
I ran into something similar when I had placed some code in a constructor that was crashing. Exact same issues where the Debug would disconnect just after the application started up.
The short if it, check that you haven't configured a class constructor to run during web startup that is crashing...
Quick windows 7 update: I had to add "localhost" to my list of trusted sites to correct this issue...go figure.
Just a workaround for those (like me) for whom the above solutions do not work: After starting the app you wish to debug, go to Debug -> Attach to Process, and attach it to the process you want to debug. Works on my machine.
In my case, I faced this issue with Visual Studio 2019 and 2022 as well.
I tried upgrading/downgrading Visual Studio versions but nothing helped.
On debugging, I finally found the root cause and sharing it here to help others facing the same problem.
I was using Brave browser with Visual Studio and whenever I uploaded a file in my application, the Visual Studio debugging stopped automatically. The root cause of this issue is the feature in Visual Studio to stop debugging on closing the browser. With Brave browser Visual Studio feels like we have closed the browser on uploading the file. So to fix this issue I have turned of this setting as given here.
You can find this setting here
Tools > Options > Projects and Solutions > Web Projects > Stop debugger when browser window is closed, close browser when debugging stops
Just turn it off and everything should work fine.

Resources