Visual Studio 2012 Slow To Close - visual-studio-2012

I am running VS 2012. Working on a project that is stored on a mapped network drive. Whenever I go to close the solution it takes several minutes (5-7) for Visual Studio to close. It does eventually close, but very painful waiting for it to finish.
Anyone have any suggestions on how to fix?

Try Process Monitor by SysInternals: http://technet.microsoft.com/en-us/sysinternals/bb896645
You can set the filters in such a way that only the Visual Studio 2012 executable is monitored and you will see each and any action towards files, network or registry. This might give you the idea about what's going on behind the scenes.

It's typical. Because Visual Studio have to copy your data from local disk to map network. Also it have to check security options. Execute your project on your local Disk.

Try this: Remove all the "UNUSED" MS Access or other data files in the App_Data folder - including any that are in sub folders. If you have old versions in App_Data or in any sub folders then Visual Studio will have to open all of them even if your website does not use them. In my case it took 2 - 3 minutes to open the website and even longer to close. I had 50 or so backups and test databases I kept in various folders just a archives. I just moved them to another folder in my website. Wow - Visual Studio now opens in a few seconds.

Related

restore my project in android studio from phone app

My notebook died and I lost all my data and my Android Studio projects. Only what I have left is apps in my phone. Is it somehow possible to restore it in Android Studio from my phone app? Thank you.
Option 1: somehow get the original files back. You could try to:
See if the drive still works by putting it into another system
Search for some kind of backup (backup utility/cloud storage/github)
Get some professional to rescue your data (if everything fails)
Option 2: decompiling
I just tried decompiling one of my apps here and it kind of worked. You may have to remember your project structure somehow, but in the end, I think it's doable for smaller app projects.
Disclaimer: never decompile other people's software without their permission.

Visual Studio regularly freezes running Microsoft.VisualStudio.Web.Host.exe

Background
I maintain several web sites that are Visual Studio "Web Site Projects".
Problem
I've found that with a couple of these projects, Visual Studio regularly freezes while I'm working on the code. This doesn't happen for some of the web site projects, and I haven't seen it happen on any Web Application projects.
Symptoms
Each time it freezes, it takes about half a minute before I can use it again.
During a freeze, Windows Task Manager reports that Microsoft.VisualStudio.Web.Host.exe is maxing out one of the CPU cores.
Steps to Reproduce
Open a .cs file under the App_Code directory.
Make a change to the file.
Save the file.
Navigate somewhere else (eg switch tab, close the file, open different program in Windows).
Navigate back to the file (eg switch tab to it, open it, or go back to Visual Studio).
Other actions that sometimes seem to trigger the problem:
"Go to definition"
Opening a file
Previewing a file
Closing a file
Using a refactoring
"Find usages"
What I've Tried
Both Visual Studio 2012 and Visual Studio 2015
Changing the website project's build action
Disabling "Build Web site as part of solution"
Deleting web references and the Bin folder seems to minimise the problem, but obviously this breaks the web site. Maybe web site projects experience this problem when they contain a lot of C# code other than code-behind files?
Similar problems
I found the following potentially-related problems using Google, but none of them seemed to contain a workaround or solution.
Microsoft.VisualStudio.Web.Host.exe Time Theft
Microsoft.VisualStudio.Web.Host.exe
Visual Studio 2012 freezes for approximately 30 seconds after every build
I noticed that the problem happened less often when I suspended ReSharper.
The problem still happened occasionally when editing classes under App_Code, but restarting Visual Studio worked around it.
I was facing a similar problem. A single Web application project with dozens of class libraries, migrated over from VS 2010 into VS 2013.
I was able to solve my problem by disabling the "Hosting Process" option:
To disable the hosting process
Open an executable project in Visual Studio. Projects that do not
produce executables (for example, class library or service projects)
do not have this option.
On the Project menu, click Properties.
Click the Debug tab.
Clear the Enable the Visual Studio hosting process check box.
Full details on MSDN: http://msdn.microsoft.com/en-us/library/ms185330.aspx
Another option for people experiencing this on old web applications that don't have the properties page in the accepted answer above.
Disable "Allow this precompiled site to be updatable".
Open Site/Solution
Right click and view Property Pages
Go to MSBuild Options
Uncheck "Allow this precompiled site to be updatable"
This worked for me.
This problem stopped happening when the Web Site project was converted into a Web Application project.
Not an easy solution, but it did stop the problem.
They symptoms in the question of this post sound exactly like the nightmares I just had today:
Other actions that sometimes seem to trigger the problem:
"Go to definition"
Opening a file
Previewing a file
Closing a file
Using a refactoring "Find usages"
Plus intellisense wasn't working (even with CTRL + J) and
'Peek definition' was hanging as well.
I had to keep task killing visual studio (both 2015 and 2017).
My fix was to go into the project that I was having problems with, open the 'Package Manager Console' and uninstall and re-install the 'DotNetCompilerPlatform'
uninstall-package Microsoft.CodeDom.Providers.DotNetCompilerPlatform
and then
install-package Microsoft.CodeDom.Providers.DotNetCompilerPlatform
So far every problem I was encountering has not resurfaced (but this was just today so still need to give it time).
UPDATE:
It started creeping back again. I noticed also that whomever had installed to the solution had only done it to two of the various projects. Uninstalling the compiler platform (which means using the compilers that came with Visual Studio) has made life sane again.

How to speed up TFS in Visual Studio 2012?

When I click on a folder in TFS inside Visual Studio, it literally takes 4-5 seconds for the IDE to respond. It used to be instantaneous. The hard drive at this time is going nuts.
I used procmon to see what is going on and it seems that every time I click on a folder (or expand it), devenv.exe process literally scan every file in my workspace.
It's a good thing I have an SSD - otherwise it would take more than 4 seconds.
Why does it scan all these files?
How do I stop it?
How do I restore the speediness?
If you have a particularly large workspace, you might try using a Server workspace instead of a Local workspace (you do this from the Workspaces... dialog in VS).

Pressing Ctrl + S automatically opens Output window

Whenever i press Ctrl+S from keyboard or whenever i click on any file in Solution Explorer it automatically opens output window only in Visual Studio 2012.
I tried
Tools > Options > Projects and Solutions > Show output window when build starts
I am using Visual Studio Professional 2012
But its just not working. Its irritates a lot. Please suggest how to get rid of it.
if someone is facing this issue in visual studio community 2015, in my case the issue was caused because of the use of Backup and sync utility from google, I have synced my source directory to my google drive to maintain the latest copy of source backed up.
The backup utility locks the file which you might be editing for syncing it to cloud storage. since the file is locked by another process, the visual studio cannot save the changes in the file.
The fix was to pause the syncing for the time you are doing frequent changes.
In your case, it might be some other process which might be locking the file.
If you're using an extension, one of them could be the reason.
I had the same problem while saving the CMakeLists.txt files. I checked one of the extension's setting, "CMake Tools", it has a "Cmake: Reveal Log" settings which causing this problem. I simply deactivated it
I suggest you to check extensions' settings or try to find on settings with searching "output", "focus" etc.

How can I open a Visual Studio Web Site in another PC without losing all my breakpoints?

At my office PC I am working on a web site using Visual Studio 2012. I created several breakpoints (using F9) in the code-behind of several pages.
I made a copy of the whole web site folder and then opened it again in another PC (using the same version of VS2012).
Now all my breakpoints are gone.
How can I open a Visual Studio Web Site in another PC without losing all my breakpoints?
Thanks in advance.
CD
The project's .suo file has the breakpoint information. Try copying the .suo and replacing the other pc's .suo file.
If you're unfamiliar with it, the project solution file (e.g. "MyProject.sln") has an associated file, the Solution User Options file (e.g. "MyProject.suo"), which stores various information, including breakpoints.

Resources