Visual Studio 2012-Update 2 Won't Load Solution if SUO File is Present - visual-studio-2012

I develop in VS 2012/.NET on several computers (all running Windows 8 Pro x64). Although VS is installed on all computers I keep the project folder on an external USB3 drive. Every once in a while I would find the project files had been corrupted on the USB drive (e.g. cross-linked). Fortunately I keep frequent backups but clearly this situation is intolerable, so I set out trying to find what the issue(s) might be.
I still don't have a clear answer but one piece of strange behavior is this: if I open the .SLN file for my project in VS 2012 when an .SUO file is NOT present it loads fine, builds are OK, etc. HOWEVER, if I then save the project, exit VS (so an SUO file is created) and then attempt to REOPEN the solution VS hangs at (....loading). I get the usual "Visual Studio is busy....." messages and there is no point in waiting, the solution just never loads. I have to kill VS in TM. I've tested this repeatedly, and I've even done it from the local hard disk (as opposed to the USB drive) to see if USB was the problem. It isn't. Remember, this is all on the same computer (so as to remove "moving" as the cause of the issue). The only way I can work with the project is to delete the SUO file before trying to open it.
I would assume, if this was a VS bug, it would be pretty much all over the web and my searches would have turned up something. So I'm asking if anyone has any idea what the problem might be or if there are links that might help me figure things out.
Thanks in advance.

Related

Visual Studio 2017 crashes after 10-20 minutes

For over a month now I've been experiencing problems with VS2017 on my home PC. I even tried submitting the feedback to Microsoft. There's more info about the problems I'm experiencing there.
The problem:
The gist of it is that VS is eating RAM like crazy. As soon as I start opening files, adding new files, using IntelliSense, building or (especially) debugging, the RAM usage skyrockets.
After that it's only a matter of time before the VS crashes and restarts without any error message. Though there are numerous error messages throughout these breif ~20min I have with each session.
Additional details I observed:
Doesn't happen with Python projects, as these don't have to be built constantly. It might be eventually happening if you debug a lot, but I didn't have the chance to check that because most of my Python coding is debugged on an external device
Size of the loaded solution doesn't matter;
UWP and WPF seem to crash the most. Console Projects take longer to crash.
Also affects .NET Core;
It doesn't matter which version of .NET Framework I use;
VS2015 worked perfectly, but I don't have it anymore after the format
What I already tried:
I reinstalled VS;
I refreshed Windows;
I reinstalled Windows;
I checked my drives and RAM for issues - none found;
I switched from Community to Enterprise;
I tried disabling extensions;
I applied some shady hotfix I found somewhere;
Finally, I installed Rider which seems to be the best solution as of now. It still lacks many important features, though.
Is there anything else I can do/try/check? Did anyone experience (and fix) a similar issue?
Cheers!
You get a System.OutOfMemoryException, this means your Visual Studio runs out of free virtual address space (4GB on 64 Bit Windows for the 32Bit Visual Studio because Visual Studio is configured to be large address aware and MS refuses to release VS as 64Bit program which would fix this issue).
To analyze the memory usage, you need to run WPRUI.exe (part of Windows Performance Toolkit (which gets installed by VS2017) for some scenarios, if not, install it on your own), select Reference Set (Note: expand the Resource Analysis entry first to see all options).
and click on Start. Capture the memory usage grow for some 100s of MB and click on Save.
Open the generated ETL with the analyzer (WPA.exe) and analyze what the process devenv.exe is doing.
Also zip the ETL + NGENPDB folder (important) as zip and attach it to your bug report so that Microsoft can analyze it.

Conversion to x64 platform in visual studio failing

So I built a huge website for my company using the AnyCpu option. I didn't think it would matter - I have a 64bit machine with x64 windows, it's getting deployed to a x64 server, and there's no attached dll's, so it should just all be in 64, right?
Well, in the process of trying to implement some security, the company's support told us the application MUST be strictly x64. I figured it was, but to humor them, I went into the configuration manager, and changed all the target cpu, platform etc settings to x64.
Unfortunately now, it breaks when I hit f5 to run it. I've run into this before, I think, and I vaguely remember needing to delete some temp internet files somewhere, but I tried closing VS, deleting the bin folder, deleting the root folder from /framework/tempASPfiles... but I still get the BadImageFormatException - "an attempt was made to load the program with an incorrect format."
What's the best and fastest way to convert an app to x64? and am I right in thinking I need to delete some files somewhere?

Visual Studio incredibly slow when renaming files

I have a medium-sized solution with 99 projects that has recently started behaving weirdly:
1) If I try to rename a file through the solution explorer, VS will seemingly hang, but after a long time (10+ minutes) it will complete the rename operation.
2) I also noticed today that switching to between Debug and Release mode seems to freeze VS as well. So far I haven't let it run long enough to see if that actually completes.
I've tried both Visual Studio 2012 and 2013, and both exhibit the same problem, so that seems to indicate the problem might not be with Visual Studio. I've tried to check in the event log if there's anything there, but nothing jumped out on me. I've also rebooted and run checkdisk, but it didn't find anything wrong.
Running Windows 7 Professional on a fairly high-specced laptop with 8GB RAM and a new SSD
Update: apparently if I have renamed a file once, I can keep renaming it (and other files in the solution) immediately. When I restart VS, it's slow again.
Update2: I left the computer running overnight to try to switch from Debug to Release, and it managed to do so in the 14ish hours between me leaving work and getting back here.
Visual Studio can be extremely slow in renaming files if you are using TFS with a "local" workspace as oppose to a "server" workspace, and the total number of files including different versions in the TFS repository exceeds 10,000 items.
Contrary to Microsoft's recommendation, I suggest using a server workspace instead of a local one for much better performance. There are also some other downsides to local workspaces and the only upside is being able to work while your TFS repository is down. That's not much of an upside considering if you can't connect to TFS, you probably can't connect to your LAN and there's darn little work you can do anyway in that situation.
To change to a server workspace for TFS in Visual Studio 2015,
In VS click on File --> Source Control --> Advanced --> Workspaces
In the dialog that opens, select your workspace and click Edit...
Click Advanced... (it does not matter which mapping is selected).
Under Location, select Server and then press OK.
Switching over to server may take ten minutes or more depending on the size of your repository.
Once this is done, renaming files should be nearly instantaneous.
When testing I'd made an attempt at setting up one of the projects to build on a different server, both in Debug and Release mode. I though I'd cleaned up both, but apparently I'd only done so under the Debug configuration.
Apparently meanwhile that server has decided it hates my machine, which makes my machine freeze while waiting for it.
Closing Visual Studio and manually editing the .csproj file solved the problem.
Unfortunately 99 projects is not a medium sized solution for Visual Studio but instead a very large solution. Visual Studio simply doesn't scale well to solutions of this size and you're seeing the effects of that here.
The only way to make this better is to factor out your solution into several smaller solutions.
Building on #Daniel Barbalace's answer, my issue indeed had to do with TFS, but I could not switch to server workspaces. What I ended up doing was removing the mappings to any branches or projects that I am not working on at the moment. There is no magic number but once I seemed to get under 50,000 files (globally for the TFS folder) renaming suddenly went down from 2+ minutes to 3-5 seconds.
In my case "git" cause that,i have a bunch of html files in my commics project,so,when i removed .git folder i have again fast renaming files.
I had the same issue. Renaming one file would take a decade. I found a solution however. When I first check out for edit, renaming becomes very fast again.

Why won't my VS2012 recognize modified files on disk and reload?

I've been away from Windows and Visual Studio for a few years. Now I have VS2012, and I notice that it fails to recognize that a file has changed on disk (i.e. by a different editor). In fact, even if I hit the refresh button on the Solution Explorer window, it still doesn't reload the file. I can close the window and reopen it -- still no luck. I thought "gosh, I hope I don't have to close and reopen the solution each time!", but it turns out even THAT doesn't do the trick.
Its as if VS is caching old copies of files and cannot imagine that someone might use something other than VS to modify them.
These are just local files, no network issues involved. I must be missing an understanding of some major new "feature", yes?
--- Edit: -----
Ok, here's some progress. I've been using the VsVim extension to have a vim-compatible keymap. On a hunch, I disabled it, restarted VS, and found the problem solved. Then, I re-enabled it, and the problem is still solved. So the mystery remains, but not the problem.
I don't have VS2012 (I went up to 2005), but from what I remember, this is configurable from the IDE. In VS2005 go to the menu, choose Tools, then Options, then Documents, then you'll see the options to detect when files are changed externally, and to auto-load files changed externally. I think in VS2012 it'll be similar.

Visual Studio 2012 Web Publish keeps overwriting existing files with same version

Just installed VS2012 and run across a strange behavior by the one click publish feature.
I'm publishing via FTP and everything works fine except it seems that VS insists on overwriting some files over and over even though nothing's changed.
In VS2010 clicking the "publish" button over and over just runs through the steps and finishes in a few seconds, in VS2012 it takes about two minutes as it keeps copying a 5mb dll and some other stuff too.
P.S the "delete all existing files prior to publish" is off
It's an absolute pain. I've resorted to keeping the solution open in VS2010 alongside the VS2012 and using VS2010 to publish, it's annoying, but it's faster...
Unfortunately there's no option for only changed files in VS 2012. Not sure why they took it out, other than maybe too many people complained that VS wasn't synching properly when their FTP servers were the problem. FTP servers are notorious for not giving back correct file info.
This is real too slow on large amount of files.
My best experience is to remove unused folders not containing assemblies (scripts, css, etc...) this way <ExcludeFoldersFromDeployment>Content;Scripts;Views</ExcludeFoldersFromDeployment>
.
Publish these files straight when you change them . Otherwise publish assemblies from profile .
https://msdn.microsoft.com/en-us/library/ee942158.aspx#can_i_exclude_specific_files_or_folders_from_deployment

Resources