Visual studio web project debug resets chrome settings every run - visual-studio

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.

Related

Visual Studio Breakpoints are causing chrome dev tools to step through each source file

Title may not be 100% accurate, I am unsure how to concisely word the issue.
I am working on a Web API and need to step through some service level methods.
If I place a breakpoint and run the application, chrome seems to constantly refresh while the "paused in debugger" is showing, even if my breakpoints are not hit yet.
In the source tab in dev tools, it looks like it is stepping through each source file one by one.
If I remove the breakpoint, the page loads instantly without issue.
Unsure if this is relevant, but I am working in an older part of our application that uses Knockout for the frontend, however, the breakpoint is in the backend.
Visual Studio 2022
Chrome

Is there a way in Firefox Developer Edition to always start with DevTools open?

I use Firefox Developer Edition for all my development. But I would like DevTools to always be open when I start Firefox. Is there any way to do that? I know I can just hit F12 but it would be a nice feature.
I probably should have clarified a bit more...
What I was really trying to do was to get Visual Studio 2022 to automatically open Firefox DevEd with the DevTools open when I began debugging my VS project.
By default, VS will automatically open your chosen browser when debugging. However the Debug profile does not include a way to send the "-devtools" option to Firefox. (Or if it does, I couldn't find it.)
So I unchecked the "Launch Browser" setting in the Debug profile...
...and added "-devtools" to the Target item in the Firefox Properties panel.
So now when I debug my project, I just Run it then manually open Firefox. And it still supports Hot Reload if you have that enabled. This works pretty well but it would still be nice if you could send options/flags to your chosen browser. But this will work for now!

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..

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