Where does Visual Studio store file properties? - visual-studio-2010

In Visual Studio there are some file properties such as Build Action, Custom Tool, and whether the file is Content etc. Where are these properties stored? For instance, if I modify the build action for a file, how does Visual Studio remember the new value?

In the .CSPROJ file, wich is stored as xml since Visual Studio 2005 I think. You can Right Click on a project, do "Unload", and then right click again and do "Edit xxx.csproj" and you will see the text directly. If you update it, you can again right click and do a "Reload".

You'll want to take a look at the solution (.sln) and project (.csproj) files.
This msdn project properties link might also help.

Related

Cannot unload project in Visual Studio 2013

I have a solution with a project file that I need to modify as text (i.e. the XML). This is done by right clicking on the project and selecting Unload Project, then right clicking on it again and selecting Edit Project.csproj. However, this does not work on all projects. Sometimes I get the message
The operation could not be completed
I want to know why this message sometimes appears (i.e. what is it about my project / solution configuration that could bring this about) and whether there is another way to edit the .csproj within Visual Studio (if I try and close the solution then open the .csproj file Visual Studio just opens the solution again).

Visual Studio 2010 Toolbox Is Empty

My toolbox is empty.
Obviously, I'm not the first. I read this question and this other question, but that didn't help.
I click here...
I get this window...
With instructions that say: "...Drag an item onto this text, to add it to the toolbox..."
Sounds good; from where do I get such items to drag?
The toolbox is empty because there is no project loaded.
The toolbox is populated with tools/controls according to the type of the current project. The controls are different for MFC than they are for ASP.NET, for example. If you haven't loaded any project, Visual Studio can't populate the toolbox.
Either open an existing project, or go to File -> New Project to create a new one.
Have you tried right-clicking on it and selecting the "Reset Toolbox" option? You can also try to manually add specific tools to it by using the "Choose Items..." option.
A common suggest is also to go into the Visual Studio 2010 Directory and delete all of the .tbd files within the following directory (Related) :
C:\Documents and Settings\Local Settings\Application Data\Microsoft\VisualStudio\10.0"
Although if neither of these options work, you will really want to consider possibly reinstalling / repairing Visual Studio.
Is your project running? I noticed that my toolbox is empty when I am debugging the project. Try stopping debugging.

How to reload a property sheet in Visual Studio 2010

Is there a way to reload a property sheet that was edited outside of Visual Studio? Visual Studio doesn't detected automatically that the file was modified (like it does with project files). The only way I've found so far is to close and reopen the whole solution (but that's no good way).
Only a partial solution perhaps for your (and my) needs, but I've found it helpful to touch the .sln file. This causes Visual Studio to wig out and ask if you want to reload all the projects. Select "Yes" and then you'll notice the properties have refreshed. I make sure that my scripts which update property files also touch any related solution file(s).
Also see Is there any way to get Visual Studio to reload all projects when the .proj files have changed?

visual studio cant see new project from existing code

I cant see this command in file menu. File->New->Project from existing files ...
there isnt it.
how can i customise visual studio to see it ?
thanks for help
I presume you have Visual Studio 2010 professionnal and above...
I see two options to bring back that menu!
Reset your settings
Customize the File menu to add up the missing command (See To add a command to a menu or oolbar.
To make a project from existing source files: if you do not have a project for them yet you need to first make a new project. This will automatically make a ProjectName.CS file; you can simply delete this file in the Solution Explorer. Then right-click on the project folder, and choose "Add...." -> "Existing item", and choose the file or files you already have.
To add an existing project to your solution, right click on the solution in the solution explorer, select Add -> Existing Project....
If this isn't what you are asking, please clarify your question. What exactly are you trying to do?

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