Visual Studio automatically deleting file on start up - asp.net-mvc-3

Yesterday I edited the Global.asax.cs file of an MVC project in Visual Studio 2010 and this morning when I opened Visual Studio the file was gone. Visual Studio had deleted the file on disk including my local changes.
I restored the file from source control and restarted Visual Studio and it again deleted the file on start up. The file appears in Solution Explorer initially while VS is initialising, and after about 5 seconds it disappears... VS deletes it from the disk. Source control shows it as missing.
I can reproduce this again and again.
Things I've tried:
- Repairing VS.
- Disabling ReSharper.
- Restarting my machine.
- Fresh source control checkout.
- Opening a different MVC project to see if the same thing happens there. It doesn't.
Anyone have any further ideas? Much abliged.

Related

Visual Studio 2012 detect file changes stopped working

My Visual Studio stopped recognizing external file changes.
I checked the respective options being enabled ('Environment/Documents/Detect when file is changed outside the environment' and 'Environment/Documents/Auto-load changes, if saved).
I restarted Visual Studio as well as my machine.
I tested other software that recognized changes, such as Notepad++, which works just fine.
I tested different Visual Studio projects to check if it has something to do with the project being screwed up somehow - same effect in all projects I tested.
What's going on here?
(There are some SO questions that appear to be related judging by the headline: VS2012 not detecting external changes, Visual Studio 2012 stopped applying changes to solution and Visual Studio 2012 not detecting file change, but all are about different issues.).
Happened to me as well this morning. Exiting VS and relaunching/opening the project seems to have it working again. Super strange!

Project Not Loading in Visual Studio 2010

I recently installed the Windows Phone 7 SDK that came bundled with Visual Studio 2010 Express for Windows Phone. I downloaded a sample app and tried to open the solution file. When I checked the solution view window, the app project was not loaded. Every time I tried to reload the project, it flash as available for a moment and then go back to being unavailable. I tried all the usual tricks like removing source control from the .csproj and deleting the .user and .suo files. Any ideas?
Ok I figured it out. When I open the solution file, it opens in Visual Studio 2010 Shell. What I needed to do was to go to Visual Studio 2010 for Windows Phone, open existing project, and then browse to the solution file and open it. Sorry for the confusion everyone!

Visual Studio 2010 package did not load correctly for uninstalled extesions

During visual studio startup I get lots of annoying dialogs about extensions package loading errors.
All the extensions that fail to load are those I uninstalled.
I checked all the places mentioned in this article (Bootstrapping of VS packages and VSIX extensions in VS2010) and none of the extensions I get error for is there.
Is there somewhere else I can check?
I would "just" like to see where visual studio finds these references and kindly delete them all :)
I found this folder in the windows registry:
HKEY_USERS\S-1-5-21-3990449039-760197492-1239349315-1121\Software\Microsoft\VisualStudio\10.0_Config\Packages
It contains all the reference to extensions visual studio tries to load (mostly pointing to HKEY_USERS\S-1-5-21-3990449039-760197492-1239349315-1121\Software\Microsoft\VisualStudio\10.0_Config\InstalledProducts subfolders).
I just renamed the folder of the extensions I did remove and I do not see load errors anymore.
I'm sure this could cause some side effects so is anyone aware of a better way to avoid visual studio trying to load uninstalled extensions?
This is the correct answer:
Close Visual Studio.
Backup, and then delete Visual Studio's AppData folder. For example:
Visual Studio 2010:
%AppData%\..\Local\Microsoft\VisualStudio\10.0
Visual Studio 2012:
%AppData%\..\Local\Microsoft\VisualStudio\11.0
Visual Studio 2013:
%AppData%\..\Local\Microsoft\VisualStudio\12.0
Restart Visual Studio and enjoy.
I had a problem like this after upgrading SmartBear AQTime where I removed IDE integration (which doesn't work well anyway, may as well run standalone). VS2010 complained no startup about packages which didn't load correctly.
I actually deleted the contents of
AppData\Local\Microsoft\VisualStudio\10.0\Extensions
and this fixed things entirely.
I encount this problem after removing devexpress from my computer,and I cleaned the registries yesterday,then I delete the devenv.CTM file in
%AppData%..\Local\Microsoft\VisualStudio\10.0\1033 file and restart my VS, it works!

Visual Studio 2010 crashes when solution is opened

We are using a third-party component that crashes Visual Studio 2010 when it is viewed on a designer. This in itself was not a deal breaker, as we wrote the layout code by hand.
However, last time the designer of this component was viewed by accident and Visual Studio crashed, the [Design] file was saved as open, and now whenever VS is launched and the project opened, the designer is opened by default and then Visual Studio crashes.
I have deleted all *.suo and *.user files, but somehow Visual Studio still remembers which files were open last, making it impossible to open the solution.
Comment out the code in the designer file, open the solution, the uncomment it.
First, make a backup of the file (if you don't already have one in source control), in case the designer regenerates it.

VS Studio Crashes hard with "encountered a user-defined breakpoint" error on any config file

I have a odd problem here I can't figure out.
alt text http://billrob.com/images/studioerror.jpg
This happens each time I open the web.config file in my project. Studio crashes immediately after clicking close. Clicking debug just opens and empty Studio with the debugger attached to nothing.
I even resorted to open studio 2008 naked, without and project or solution, and then manually browsed to the web.config. It still crashes.
Other info:
All *.config files with crash as soon as the file opens.
This occurs in both VS 2005 and 2008.
Any file named .config, whether a .cs file renamed, or an empty text file called bob.config.
Any help would be greatly appreciated.
Try looking at your packages installed for Visual Studio. They are registered in the registry under:
Visual Studio 2008
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\9.0Exp\Packages
Visual Studio 2005
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\8.0Exp
If you have a lot, I say kill them all. And then reinstall your specific addons (such as CodeSmith or VisualSVN).
For reference, this is my fresh new install of Visual Studio 2008 SP1 on Windows 7 RTM. Only 1 plugin, and it's for SQL Server's SSIS:
registery http://eduncan911.com/blog/thumbnail/billrob-stackoverflow.png

Resources