Visual studio 2012 crashes when I try to edit .hlsl or .fx files - visual-studio-2012

Visual studio 2012 crashes when I try to edit .hlsl or .fx files, even after I disabled all of my extensions. I also uninstalled Parallel NSight and NShader but the syntax highlighting still shows up for these file types (and seems to be the cause of the problem). Renaming my shader file to have a different extension doesn't cause any problems. Is there a way to manually remove custom syntax highlighting rules?
UPDATE:
Resetting the user data solved my problem.
devenv.exe /ResetUserData - Removes all user settings and makes you set them again. This will get you the initial prompt for settings again, clear your recent project history, etc.
How do I truly reset every setting in Visual Studio 2012?

Make sure you have all updates/service packs installed. I don't know if there were any VS 2012 service packs, I use VS 2008 SP1 which is last really stable version known to me.
Rename or move temporarily your Visual Studio 2012 folder which is located in "Documents". Visual Studio will create new one.
Open VS and see if it helped. If not - problem is elsewhere, so rename/move your Visual Studio 2012 folder back and go to step 3.
Backup your Visual Studio settings (Tools -> Import and export settings -> Export...) and then reset them to default (Tools -> Import and export settings -> Reset...).
Open VS and try again. If settings reset didn't helped - restore your settings from backup. If it helped - you can import settings by categories and see which one is messed up.
Reinstall Visual Studio, something must be messed up in Program Files.

Related

If I run Visual Studio by appending /safemode no addons are loaded, visual studio is quick. So how do I get myself back there without an OS Reinstall?

I have a quite a few addins installed on my Visual Studio 2012 and I am unhappy at the speed of the application now. I also have some other strange issues that I think are caused by 1 addin but I do not know which one.
I know Visual Studio has the add-in manager but that is not showing all addins that are loaded and running!
For example I have removed all check boxes but I am still getting addons loaded like Dev Express.
Is there any tools that let me see and remove addons - maybe a 3rd party tool someone has written?
If I run Visual Studio by appending /safemode no addons are loaded, visual studio is quick. So how do I get myself back there without an OS Reinstall?
How do I reset visual studio to the default state with no addons installed?
Or is there a known list of locations I can look at for installed addons?

Visual Studio 2012 crashes when trying to update, repair, deinstall

My copy of Visual Studio 2012 is instable. It starts up and I can load projects, compile and run them. But from time to time it crashes randomly. It now also crashes when I try to add a new windows form to a project. But the crashes are independent from the project loaded.
My first idea was to install all new updates but if I go to the updates & extensions section it opens the dialog box and crashes 1 second afterwards. I then thought I might deinstall it and reinstall VS 2012 or 2013. But I also cannot deinstall it. If I go to windows programs to deinstall it I can click on the change button, but after this the installation program crashes. I also tried to download the VS 2013 preview and install it but this also crashes before showing a dialog box of window.
So I don't know how to proceed. Does anybody else have similar problems?
Try running Visual Studio in Safemode (devenv /safemode) or run it with logging turned on (devenv /log) the logs will be written to a folder in your user profile. Also check the Eventlog to see whether there's a error report. There should be 2 events logged when Visual Studio crashes. One "Application Error" and one ".NET Runtime Error". The latter will provide information about the stack trace that causes the crash:
When you try to uninstall Visual Studio, first remove update 1, 2 or 3, then repair or remove the whole thing. If uninstall fails, i'm afraid you'll need repave the machine to get it back in a supportable state. When you uninstall an update, you always need to repair Visual Studio itself before re-applying the updates.
Try removing all addins (Resharper, NDepend, etc) and extensions (either from the Visual Studio Updates and Extensions window or by deleting them from the Visual Studio or User profile folder).
Try resetting settings and add-in settings (devenv /ResetSettings) and (devenv /ResetSkipPkgs), try rebuilding all templates (devenv /setup).
You can even attach one Visual Studio instance as a debugger for the other to see where the exception occurs. Sometimes it can give you valuable information, sometimes the crash just doesn't happen because the actual issue is timing related.
If all else fails, open a support call with Microsoft, file a bug on Connect or do a clean re-install of your system.
Judging from you Error message you're running the Visual Studio 2012 Web Developer Express edition, instead of devenv, try wdexpress from a normal (windows) commandline window.
Another common issue that can make Visual Studio very unstable, is a corruption of the Add-in cache. Clearing it will trigger Visual Studio to rebuild it for you.

How do I truly reset every setting in Visual Studio 2012?

I am trying to reset every single setting inside Visual Studio as I have completely lost all IntelliSense. I tried the Tools -> Import/Export settings -> Reset, but that is not clearing all the settings. I know it is not since the color theme was not reset, and I still do not have IntelliSense. Short of uninstalling and deleting every trace of the program including the registry, is there another way to reset every single setting to the factory default?
Visual Studio has multiple flags to reset various settings:
/ResetUserData - (AFAICT) Removes all user settings and makes you set them again. This will get you the initial prompt for settings again, clear your recent project history, etc.
/ResetSettings - Restores the IDE's default settings, optionally resets to the specified VSSettings file.
/ResetSkipPkgs - Clears all SkipLoading tags added to VSPackages.
/ResetAddin - Removes commands and command UI associated with the specified Add-in.
The last three show up when running devenv.exe /?. The first one seems to be undocumented/unsupported/the big hammer. From here:
Disclaimer: you will lose all your environment settings and customizations if you use this switch. It is for this reason that this switch is not officially supported and Microsoft does not advertise this switch to the public (you won't see this switch if you type devenv.exe /? in the command prompt). You should only use this switch as the last resort if you are experiencing an environment problem, and make sure you back up your environment settings by exporting them before using this switch.
How to hard reset Visual Studio instance
When developing extensions sometimes you just mess up, others someone else does. If you start getting errors loading even the most mundane extensions, these are the instructions to hard reset your instance.
Close Visual Studio (if you haven’t already).
Open the registry editor (regedit.exe)
Delete the HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\{version}
Delete the HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\{version}_Config
Delete the %LOCALAPPDATA%\Microsoft\VisualStudio\{version} directory.
Enjoy your brand new Visual Studio instance.
Use {version}=10.0 for Visual Studio 2010
Use {version}=11.0 for Visual Studio 2012
Use {version}=12.0 for Visual Studio 2013
If on the other side you want to reset the experimental hive you can do the same to with the ‘{version}Exp’ ones.
Happy coding!
Source: http://www.corvalius.com/site/hacks/how-to-hard-reset-visual-studio-instance/
Click on Tools menu > Import and Export Settings > Reset all settings > Next > "No, just reset settings, overwriting all current settings" > Next > Finish.
To reset your settings
On the Tools menu, click Import and Export Settings.
On the Welcome to the Import and Export Settings Wizard page, click Reset all settings and then click Next.
If you want to delete your current settings combination, choose No, just reset settings, overwriting all current settings, and then click Next. Select the programming language(s) you want to reset the setting for.
Click Finish.
The Reset Complete page alerts you to any problems encountered during the reset.
Executing the command: Devenv.exe /ResetSettings like :
C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE>devenv.exe /ResetSettings , resolved my issue :D
For more: https://msdn.microsoft.com/en-us/library/ms241273.aspx
Just repair Visual Studio itself from the control panel and that should do the trick!
1) Run Visual Studio Installer
2) Click More on your Installed version and select Repair
3) Restart
Worked on Visual Studio 2017 Community

Error opening SQL File from TFS 2012

When I try to view a .sql file from Source Control Explorer in Visual Studio 2012 (TFS 2012) I get the following error message:
TF10187: Could not open document
FilePath\FileName
User canceled out of save dialog
It's only happening for SQL files. The file does exist in the TFSTemp folder and I can double click and open it from there. What do I need to change to fix this error message?
Install SQL Server Data Tools - September 2013 update things will be fine. http://msdn.microsoft.com/en-us/jj650015
For us, this seems to be linked to a .NET Framework 4.6 upgrade and is not limited to SQL files. Users have issues opening files from Source Control Explorer and Solution Explorer.
Delete the contents from the following folders:
C:\Users\<>\AppData\Local\Microsoft\Team Foundation
C:\Users\<>\AppData\Local\Microsoft\VisualStudio
C:\Users\<>\AppData\Local\Microsoft\VSCommon
The first step fixed it in my case, but you can try this if it doesn't: Navigate to the Visual Studio IDE folder in command prompt or windows explorer and Run the following command "devenv /resetuserdata". Ie: C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE. To minimize the potential loss of the user’s personal environment, you should consider creating a backup using the Export Settings wizard, and the Import Settings wizard to restore the settings if and when needed.
Note: The side effects of running the /resetuserdata option is that any customizations will have to be reconfigured (ie: TFS server and proxy settings) as well as many, if not all, Visual Studio extensions have to be re-installed.
Source: http://blogs.msdn.com/b/willy-peter_schaub/archive/2010/09/15/if-you-have-problems-with-tfs-or-visual-studio-flush-the-user-cache-or-not.aspx
Looks like you need to uninstall Redgate and then re-install the data tools. This is probably because an add-in was trying to grab the .SQL files and do something with them that VS wasn't expecting.

Visual Studio 2012 doesn't convert vs2010 solution?

I opened my vs2010 solution with vs2012 but it didn't make any conversion as from 2008 to 2010 was happening. So my solution still remains the same as 10 label on it. when I make a new solution of course it has 11 label on it. I haven't got any problem running like that but I am curious. Is there any difference? if yes, how to convert into vs2012 solution?
I managed to 'convert' the solution file to change the line containing '# Visual Studio 2010' to '# Visual Studio 2012' in the .SLN file.
Manual editing of the solution file is not necessary, or recommended. Simply open the VS2010 solution in VS2012, left-click the solution (at the very top of the Solution Explorer), then use File | Save As to overwrite the original file. This will effectively convert the VS2010 solution file to a VS2012 solution file.
There are some exceptions, but mostly you'll be able to open the same project and solution files files in both VS2012 and VS2010 SP1.
VS2012 may convert projects when you first open them, but the changes are (except noted in the document linked) backward compatible with VS2010 (ie using conditionals where needed to only apply to either version when loaded) Most project types will be left entirely untouched though.
It is about Visual Studio 2012 Compatibility
If you created your assets in Visual Studio 2010 with Service Pack 1 (SP1), many of them will load and run in Visual Studio 2012 without any further action on your part.
Many assets will also open again in Visual Studio 2010 with SP1 without any issues, even after you open those assets in Visual Studio 2012
For C++ projects it makes a difference, as the 2012 compiler (VC11) will only be used on projects that are explicitly 2012, not on 2010 projects opened in VS 2012. Some C++11 improvements are available with the VC11 compiler but not with VC10 (see this SO Answer for a summary), including:
Range based for-loops
New standard library headers (atomic, mutex, thread,...)
Smaller standard library container sizes
(And more to follow when the Nov 2012 CTP is delivered to VS 2012)
In order to convert from VS 2010 project to VS2012 there is no need to manually edit the solution file or 'Save As' over the existing project. Instead:
If you decline the update when first prompted, you can update the project later by opening the Project menu and choosing Update VC++ projects... [at the top of the menu options]
From MSDN's "How to: Upgrade Visual C++ Projects to Visual Studio 2012"
(This page was linked from #Joachim's MSDN link, but I wanted to have the answer here on SO since a number of other answers suggested manual workarounds instead of this VS 2012 feature)
In my case, I had some Visual Source Safe stuff (my project was created with Visual Studio 2003/2005, yes, very old!)
Once I manually removed the VSS stuff, the conversion succeeded.
PS: I know it's about VS2010, but maybe this helps others.
You can convert a project from VS2010 to VS2012 by doing the following:
Add the 2010 project to your VS2012 solution by right-click on your solution in the Solution Explorer and Select Add --> Existing Project...
The project will appear in the solution and will have (Visual Studio 2010) appended to its name.
Right-click on the added project and select Properties.
In the Configuration Properties --> General pane, change the setting in Platform Toolset field to Visual Studio 2012 (v110)
Repeat for each configuration type, e.g. Release and Debug.
I came across this question while googling for a solution to a specific problem: MSBuild was failing to execute the Publish target against a VS2012 solution that had started life in VS2010 when called from the command line (specifically through TeamCity):
error MSB4019: The imported project "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\Windows Azure Tools\2.3\Microsoft.WindowsAzure.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.
MSBuild was looking for the Azure SDK 2.3 targets in the VS10 location (C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\Windows Azure Tools\2.3\Microsoft.WindowsAzure.targets). The cause is explained by Sayed Ibrahim Hashimi in a blog post and, as I understood it, boils down to some decisions they made while enabling cross-version compatibility for solution files. The solution was simple: add the VisualStudioVersion property to the MSBuild invocation, something like this:
msbuild.exe MyAwesomeWeb.sln /p:VisualStudioVersion=11.0
Practically speaking, this overrides the following in each csproj file:
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
Presumably you could get the same result by editing all of these by hand to replace 10.0 with 11.0 but that might break backwards-compatibility -- I haven't tried it. I also haven't tried an update to VS2013 to see if the problem persists.
So to wrap this up by answering the question: yes, there are some differences before you "convert" (using any of the methods offered by other answerers) and some differences remain afterwards.
This is slightly different, but along the same lines so in case it helps anyone:
I was loading a project where it looked like it was loading and then kept showing all projects as unavailable. No errors were on the migration report. I tried reloading the solution and projects many times, using various methods including suggestions here.
Finally I found a "Resolve Errors" option when right clicking on the solution in the Solution Explorer. VS went through a load process again and it worked; no problems.
I don't know what it did differently that time, but apparently it made a difference.
it's to simple just edit the .sol file
change the version to 11
like this
Microsoft Visual Studio Solution File, Format Version 12.00
Visual Studio 2012

Resources