How do I restore a property sheet to its default value? - visual-studio

Let's say I carry out the following steps immediately after first installing and opening Microsoft Visual Studio 2010:
File -> New -> Project -> Win32 Console App -> Finish.
Go to the Property Manager pane -> Expand Debug | Win32 -> Right click Microsoft.Cpp.Win32.user -> Select Properties.
Wildly change settings in a clueless manner, and generally act like a fool.
Click Apply, save the project, and close Visual Studio.
How do I restore the Microsoft.Cpp.Win32.user property sheet to its default, "factory" settings?

I'm not sure if this is the official way, but it does work...
The default property sheets are stored in the following directory:
%USERPROFILE%\AppData\Local\Microsoft\MSBuild\v4.0
And if you delete them, they will be automatically recreated by Visual Studio using the default settings next time that it is launched.
So you can simply delete Microsoft.Cpp.Win32.user.props from that directory and restart VS.
Putting it all together, from the command line, simply issue the following command:
del %USERPROFILE%\AppData\Local\Microsoft\MSBuild\v4.0\Microsoft.Cpp.Win32.user.props

Related

How to open project properties in VS 2017?

I am trying to open Project Properties window in VS 2017 in order to add header files in a way described in this topic However it turned out to be very frustrating as when I reproduce steps described in the documentation (Project -> [project name] Properties), I end up with a different window, missing some content that is crucial in my case (Common Properties -> C/C++).
What I expect:
What I get:
How do I open the window that contains Common Properties?
Turns out that window can only be opened in C/C++ project, not in C#

how to see the location of a file in visual studio solution explorer

I can look for file with ctrl + , and get what i want
I can also right click the file tab and show the file in windows explorer
but the action above wont tell me where it is in the tree.
How can i see where the file lies inside the tree view in solution explorer?
You need Sync with Active Document.
In Visual Studio 2015, check
If you are using older version of VS and don't have that button, you need to check Tools -> Options -> Project and Solution -> Track Active Item in Solution Explorer.

Visual Studio 2010 - How to enable prompt to delete file from disk when removed from project?

In Visual Studio 2005, when you remove a file from a C++ project (by right-clicking in the Solution Explorer and selecting "Remove"), it asks you whether you just want to delete the reference, or also delete the file itself from disk.
In Visual Studio 2010, this prompt seems to have disappeared (or I have accidentally turned it off). This means that every time I delete a file in the Solution Explorer, I have to immediately hunt it down and delete it with Windows Explorer (otherwise I'll forget and it will stay around forever). How do I get the prompt back?
I found some documentation (http://msdn.microsoft.com/en-us/library/0ebzhwsk%28v=vs.100%29.aspx) explaining the difference between "Remove" and "Delete", and that "Delete" doesn't exist for C++ projects (but no reason is given). Maybe it's really just not possible? If so, what an annoying regression.
You get the remove or delete file dialog only if the selected file is stored in the project folder. If the file is stored outside of the project folder the file reference is removed without dialog.
This behaviour is still the same for e.g. VS2013. I created a user voice request to change this behaviour here. IMHO your file hierarchy should not make any difference.
You can vote for the change here:
http://visualstudio.uservoice.com/forums/121579-visual-studio/suggestions/9146353-remove-delete-dialog-should-show-up-when-deleting
Assuming one is using Sourcegear Vault as the source control system, you can enable the prompt by going to Tools -> Options -> Source Control -> Integration Options -> and check on "Show warning before deleting items from source control"

How do I suspend ReSharper 5.0 AND get back the default key settings in Visual Studio 2010?

I have a project with many projects that performs miserably with ReSharper enabled, even on a pretty decent machine (8GB RAM, hybrid solid state hard drive, Core 2 Duo processor).
I was able to find out how to suspend ReSharper, but none of the default key bindings for Visual Studio (e.g. Ctrl-[comma] to navigate to type) seem to be working when I turn ReSharper off.
How do I get back the default key bindings when I disable ReSharper (and get the ReSharper bindings back when I enable ReSharper)?
Prior to resetting the keybindings in VS, export a backup copy of your current ReSharper settings:
Tools -> Options -> Environment -> Import and Export Settings -> rename file to ReSharper.vssettings -> click OK
Then repeat the previous steps but rename it back to CurrentSettings.vssettings.
Next reset the VS keybindings by:
Tools -> Options -> Environment -> Keyboard -> click the Reset button.
That should restore the settings back to the original VS default keyboard bindings and remove all of ReSharper's. (Note this also will remove any custom keybindings that you might have defined unrelated to ReSharper.)
As stated in Warren's answer you could use two VS settings files one of ReSharper and one for (non-ReSharper) default VS and import and load the one as needed.
This could be automated by creating some VS macros:
Public Sub ExportVsSettings()
DTE.ExecuteCommand("Tools.ImportandExportSettings", "-export:c:\MyVSSettings\CurrentSettings.vssettings")
End Sub
Public Sub ImportDefaultVsSettings()
DTE.ExecuteCommand("Tools.ImportandExportSettings", "-import:c:\MyVSSettings\Default.vssettings")
End Sub
Public Sub ImportResharperVsSettings()
DTE.ExecuteCommand("Tools.ImportandExportSettings", "-import:c:\MyVSSettings\ReSharper.vssettings")
End Sub
You can then assign keyboard shortcuts to these macros for ease of use.
Tools menu -> Import and Export Settings... contains the functions you need. You can create separate settings files (.vssettings) for parts of your VS configuration, and then restore them later.
If you want to quickly switch between configurations, ensure that Visual Studio is not running, then go to the user's documents directory, then into the corresponding Visual Studio version directory, then into the Settings directory underneath that. The CurrentSettings.vssettings file is what is loaded by Visual Studio. Substitute that file with another .vssettings file containing the settings you want, and you're good to go.
These .vssettings files are regular XML files, so you could devise a clever little program to rewrite the portions of the files you want to change.

Resetting a Visual Studio C++ project's settings

I changed some parameters in a Visual Studio C++ project, and now I don't remember how to "go back". Is it possible to reset the build settings?
I don't mean the IDE settings (menu Tools -> Import and Export Settings).
Am I the only person that can read?!
The only way I know how to reset a "Parameter in a Project's Settings",,,
Is to open the Project file(csproj, vcxproj) with a text editor, and remove the block defining that parameter.
If you wanted to reset the Allow Isolation value, you would delete this text.
<AllowIsolation>true</AllowIsolation>
When project files are loaded by visual Studio, values which are not explicitly defined in the file, are assumed to be using the default. This will only work if the property has a default value(can't change some).
NOTE: This is NOT the same as Deleting the value from the Project Properties Dialog in VS. That method writes a blank value to your project file.
The command "devenv /resetsettings" will restore Visual Studio back to its original factory state.
You can find list of devenv switches here.
You may be able to get the previous/saved version of your Visual Studio project (*.vcproj) from your software version control system.
As many wrote here before, there is a need to reset your visual studio to default settings. Just follow this: https://msdn.microsoft.com/en-us/library/ms247075(v=vs.90).aspx
Here is the awful method I used in Visual Studio 2022.
In "Property" pages, expand the individual configuration you want.
Click "All Options" and find the bold options you had changed.
To restore the defaults, click the options and select "<inherit from parent or project defaults>".
Click "Apply", then it will recover its original value.
Otherwise, you can compare the *.vcxproj with the project templates.

Resources