Visual Studio 2010 runs installer when I debug - debugging

I've been using a solution since VS2010 was released. My solution has a number of projects in it. Until a couple of weeks ago, all was fine. All of a sudden, whenever I click the button to start debugging my code, the Visual Studio 2010 installer starts.
It takes around 5 minutes for it to complete and then I am able to debug as normal. If I restart the debug session then I have to wait for the installer again.
I haven't tried cancelling the installer, but I just want to stop it altogether.
Has anyone experienced a similar issue? How can I solve this? Its doing my head in!! :S
Thanks
Neil

I would recommend reinstalling Visual Studio. If that doesn't help something else might be wrong with your system and you may end up to re-image it. Being able to re-image a development PC can be a life-saver at times.

When you say "Visual Studio 2010 installer" do you mean the installer for Visual Studio 2010 or an installer project inside your solution? If it's the latter then you may want to check that that project isn't specified as the startup project (right'click Solution -> Properties -> Common Properties -> Startup Project -> Choose "Single startup project" and specify the project you want the debugger to run when you press F5 or the debugger button. Hope that helps.

Related

Visual Studio JIT Debugger hangs

I've always used System.Diagnostics.Debugger.Launch() as a quick way to debug web services. I get a dialog asking me to choose a debugger, I pick "New instance of Visual Studio" and it fires up VS and lets me step through the code.
That has suddenly stopped working. Now I get the dialog, and choose Visual Studio, and the VS splash screen appears, and then it just hangs. The dialog window says "Not Responding" and I have to force it to close. Even then, a VS instance is left hanging around in Task Manager and I have to kill it manually.
I've tried repairing Visual Studio, and uninstalling and reinstalling Visual Studio, and nothing fixes it.
In desperation, I completely flattened my PC and reinstalled everything from scratch. It lasted about a day and then JIT debugging started hanging again. I was on Windows 10 and Visual Studio 17.4.1 before, and I'm on Windows 11 and Visual Studio 17.4.2 now.
To make sure that it's not a problem with some particular code, I created a one-line console app System.Diagnostics.Debugger.Launch(); and that crashes just the same.
Has anybody experienced anything similar, or have any idea what could be going wrong?
I don't know why that fails, but I suggest to attach to a running instance of Visual Studio instead. Start Visual Studio first, and then when the "launch debugger" window appears, select the running VS instance. Preferably, you should even open the correct solution/project first. If you attach to that instance, all your source code and the project structure is available for debugging.
Another alternative: Instead of using Debugger.Launch(), use a code snipped such as
while (!Debugger.IsAttached)
{
Thread.Sleep(100);
}
at the beginning of your program and attach the debugger from within Visual Studio (using the menu option Debug->Attach to process)
I had the same exact problem and after updated to VS version 17.4.4 the issue disappeared. All good now.

Visual Studio 2012 not debugging current solution

My Visual Studio 2012 Professional doesn't debug as it should.
It looks like VS is debugging old versions of my projects.
I tried debugging several projects but the same problem occurs with all of them, even when I start a new project (both console applications and windows forms applications).
It doesn't even hit the breakpoints I place right at the start of the program.
Things i've tried:
• cleaning and rebuilding my solution
• DEBUG -> options and settings -> Projects and Solutions -> Build and Run. Here I unchecked "Only build startup projects and dependencies on Run" and selected "Always build " from the "On Run, when projects are out of date" list
• deleting the .suo file (since the problem not project related I didn't expect it to be the solution but it was worth a shot).
As far as I know I didn't make any other changes to any property and I didn't perform any updates just before this issue started.
The following link descibes a similar issue but it doesn't contain a solution that works for me.
http://social.msdn.microsoft.com/Forums/vstudio/en-US/23e70e79-970d-423f-b434-12681b88ef2c/visual-studio-2012-debug-runs-old-code?forum=vsdebug
Superman also had a similar problem but again no suitable solution but in my case cleaning and rebuilding doesn't temporarily solve the problem.
Visual Studio 2012 Debugging Old Code
any ideas on how to solve this?
Have you tried a repair/reinstall of Visual Studio from the control panel ?
Also it could be related to a windows User profile issues. Assuming you are using Windows 7 you can try re-creating the profile using this post. http://www.techstaty.com/how-to-rebuild-a-windows-7-user-profile-the-correct-way/

Visual Studio 2010 breakpoints consistantly not being hit

I have an issue with Visual Studio 2010 and an ASP.NET 2.0 project.
I have searched StackOverflow for a possible solution to my problem, but even though there are alot of articles related to the Visual Studio debugger, none specifically solve my issue.
Every time I start debugging, Visual Studio tells me that "The breakpoint will currently not be hit. The source code is different from the original version.". In the past when I got this problem, I could solve it by doing a Clean Solution. Or if that didn't work, I could always restart Visual Studio or my machine and the problem would be gone. This, however, doesn't work anymore. The solution cleans and I can rebuild, but the debugger still complains about the source.
I found that if I delete the folder "root" in "C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files", the problem is temporarily gone but only the next time I start the debugger, and only for the breakpoints that are currently set in the project. All breakpoints I add when the debugger is running are also not being hit due to the source/original difference.
I don't know how to solve this issue permanently because I don't want to delete that folder every time I have to start a debug session.
I also have a few ASP.NET 4.0 projects that debug just fine.
I use Windows 7 Enterprise (x64).
If someone has a suggestion I would very much appreciate it :)
Try this
Right click solution.
Click "Property"
Go to: "Common Properties" -> "Project Dependency"
Select your "project" from drop down list
Check every item in list of "Depends on"
Click "OK"
Now Open "Task Manager"
And kill all worker process i.e. "w3wp" in case of iis7
Or Kill all "WebDev.WebServer40.exe" process
Now run your application.

Visual Studio 2010 hangs on attach to process / debugging

Whenever I try to debug a Visual Studio 2010 web project, VS hangs, and ultimately crashes. This happens if I try to start the project using F5, or through Attach to Process, before the process list even appears.
Hitting F5 in, for example, a Windows Form project works fine, but attach to process fails here too.
Any ideas on what can be causing this? Obviously attaching to the devenv.exe process won't work as I can't get the Attach to Process dialog to appear...
Oh, running W7 (x64), VS2010 SP1 (had same problems without SP1)
In Solution Explorer there is a Show All Files icon (highlighted in the photo below):
Make sure it's turned off,
When It's turned on, Visual Studio tries to index all the files in the solution and if you have a giant Solution it could take forever!
I hope this has helped someone :)
Have you recently installed Mono and/or Mono Tools for VS2010?
I found that to be the problem it my case. Not sure why, but it somehow got in the way.
Matthew
In my case hangs when executable type was not correctly set, ex. Managed v4.0 and trying to attach to Native.

Visual Studio has stopped working - on Win 7

I have Win 7 Enterprise. If i open any .cs file on VS 2008/2010 it gives a message " Visual Studio has stopped working" on a dialog box. There are two buttons "Debug" and "close program". Debug button starts devenv in debug mode with assembly code as i do not have the pdb file for the same.
There is another machine with same configuration where the VS 2008/2010 Ultimate works fine. Even reinstalling Win 7 did not solve the problem. Any idea why it is happening?
Try with some standard VS troubleshooting steps:
Clean the solution
Delete / rename all files in your solution created by VS, i.e. all .ncb, .suo, .user files
Launch Visual Studio with all add-ins disabled: devenv.exe /SafeMode
Reset All Settings: Tools -> Import / Export Settings -> Reset All Settings
Delete HKCU:\Software\Micosoft\VisualStudio\9.0 and then restart Visual Studio
Repair the Visual Studio installation through Add/Remove Programs
Recently I had the same problem, there is not much help on the Internet. So I thought this could be an easy fix. I re-install Visual Studio Several times but no luck. Finally, I uninstall .NET Framework along with Visual Studio, re-boot and re-install.
It worked fine !!
I thought it might help someone.
VS 2012 Stopped Working
I couldn't open a project or create a new one without it crashing
I was getting this error...
System.ComponentModel.Composition.ImportCardinalityMismatchException was unhandled
Message=No exports were found that match the constraint:
ContractName Microsoft.VisualStudio.Language.Intellisense.IGlyphService
RequiredTypeIdentity Microsoft.VisualStudio.Language.Intellisense.IGlyphService
InnerException:
However, as mentioned above this worked for me:
Launch Visual Studio with all add-ins disabled:
devenv.exe /SafeMode
Reset All Settings: Tools -> Import / Export Settings -> Reset All Settings
Hey i had the same problem some time back but was solved when i installed this patch fix.
Check it out here -
http://connect.microsoft.com/VisualStudio/Downloads/DownloadDetails.aspx?DownloadID=26662.
For me ... one of extension I installed earlier is the culprit. That extension is some sort of code reflector. That tool manage to slow down my debugging when i step forward. And make visual studio 2012 constantly crashing. So my advice is be careful what tools and extensions you install... especially those that are not created by Microsoft themselves.
In my case the crash was caused by the parallel project builds. After went to Options -> Projects and Solutions -> Build and Run and set maximum number of parallel project builds to 1, the crash was gone.
There could be multiple issues even in the code if the call to an async method an awaiter is missing.
If everything seems to correct from code-wise then clean the solution and delete all the obj and bin fill from all project. Start building the solution again.
This worked multiple times in my scenario.

Resources