GUI to include a .prop file in a VS 2010 project? - visual-studio

Visual Studio 2010 has no longer uses .vsprops files and instead uses .props files.
To include a .vsprops file in a Visual Studio 2008 project, one could right-click the project icon in the Solution Explorer panel, choose Properties, go to the Configuration Properties | General section, and modify the Inherited Project Property Sheets property to contain a list of .vsprops paths. One could also modify the Visual Studio 2008 project file directly.
Is there a way in the Visual Studio 2010 GUI to include .props files in a project? The Inherited Project Property Sheets property seems to have been removed. If manual editing of the project file is the only way to include .props files, where can one find documentation on doing it?
I'm not talking about adding a .props file to the list of files in the project, I mean how do I tell the project to use a .props file.

That hasn't changed. Use View > Other Windows > Property Manager. Navigate the tree view there and open the configuration you want to change. Right-click > Add New.
If you don't see this menu option then you can repair the menu with Tools > Customize, Commands tab. Select
"View" and click Add Command. Select "View" in the left listbox, "Property Manager" in the right one. That adds the command back to your View menu.
It is odd that it is missing of course, could have happened when you installed VS2010 and it imported your VS2008 settings. This feature is not flawless, judging from other programmers' questions about it, beware that you might be missing out on other menu items. If you haven't customized anything extensively then Tools > Import and Export Settings, Reset might be a good idea.

You can go to View -> Other Windows -> Property Manager to open up the list of property sheets and so on. This works in both VS 2008 & 2010.

Once you find the Property Manager you will see a list of your projects. right click on the project that you want to add a .props file for and choose "Add Existing Property Sheet". You can also choose to add a new property sheet. I have my property sheet in the same folder as my solution file so that all my projects can use the same property sheet.

These posts didn't quite answer my need to choose the right Boost downloaded binaries library folder. boost_1_61_0_b1 lib32-msvc-14.0 or lib64-msvc-14.0
For some suggestions for this application see
http://boost.2283326.n4.nabble.com/How-to-write-one-property-page-props-to-select-the-right-x86-or-x64-Boost-libraries-folder-automatico-td4686269.html#a4686272

Related

"Unused" folder with Visual Studio Express?

Is there a way to have a folder for unused stuff with Visual Studio Express?
This folder will be listed, but ignored by builder and other IDE components.
The IDE ignores any file not part of a project in the solution. You can add the folder under the project if you want. Just make sure anything that is in it, don't select "Include in Project" in the context menu (or select "Exclude from Project" as necessary).
For the IDE to ignore files by default, you will have to copy/paste them into the folder manually. If you use the "Add" context menu, it automatically includes it into the project.
In order to see all files/folders regardless whether they are in the project or not, select "Show All Files" in the Solution Explorer. (In fact, I would suggest this is the default via Tools > Options > Projects and Solutions > VC++ Project Settings > Solution Explorer Mode > Show All Files.)

Creating an installer for Visual Studio 2010 solutions (one or more projects)

I ran into some troubles when creating an installer for my Visual Studio 2010 solution (which has multiple projects) so I thought I'd make a quick guide to how I got it working...
Here is how I did it:
Create a new Visual Studio Installer project which is located under
Installed Templates/Other Project Types/Setup and Deployment/Visual Studio Installer.
Make sure you add it to you current solution, you can do this by right clicking on the solution name in the solution explorer and clicking Add>New Project
From there select Setup Wizard, give it a name and click OK
A wizard will open, click Next
then select Create a setup for a Windows application
then click Next again. Select all of the groups you want to include, namely: Content Files, Source Files, Primary Output
Then click Finish
In the solution explorer you will see a bunch of buttons find the one that's tool tip says File System Editor and click it. You will see three folders in the file system editor, the only one we really care about is the Application Folder. That folder is where your projects build output should be.
To add files to it if they are not already there right click > Add > File...
Note: You cannot add entire folders (which sucks) and the folder structure in the Application Folder should be identical to that in your projects build.
You should create each folder and then add the files to it.
If you have multiple projects you should set the build directory to the same folder under the release build settings. To do this, open your solution, and for each project, right click/Properties go to the Compile tab, set it's configuration to Releaseand its Build output path to some folder (same for each project) (If you have an XNA project make sure its Content Build/Configuration is also set to Release).
Now select Release from the drop down menu on the tool bar (it most likely says Debug now)
Right click on your solution on the solution explorer and click Build Solution
Now all of your solutions built files will appear in the folder you chose in the compile tab. All of these files are what needs to be added to the Setup Projects Application Folder (in the same structure)
Customise the installer: click on the project name in the solution explorer and look through it's properties, change what you want (i.e Author, Manufacturer, Title - these make a difference to the installers output directory and text)
Build the installer project (same way as mentioned above) and you are done.
Feel free to comment with questions

How do I open a project without a .sln file in Visual Studio?

I was writing this program all in Vim and now I'm thinking of moving to Visual Studio, but since I didn't start in Visual Studio in the first place, there is no .sln file to open from. How should I open such a project in Visual Studio?
If you have a web project (without a .sln), you must do:
Menu File → Open → Web Site...
And choose the folder where the project is.
If a *.csproj file exists, you can build a new solution by Visual Studio at first. Next, you can open this *.csproj file in Visual Studio.
An even simpler way in Visual Studio is to follow this:
Menu File → New → Project from existing code
Choose the source file location and a .csproj and .sln file is created.
The simplest way to do this (assuming this is not a web project, as indicated in another answer) would most likely be to:
Create a new project (of the desired type), which should also create the solution for it to live within.
In the solution explorer, right click and select "Add > Existing item..."
Insert all individual files that belong in this new project.
It's probably also worth noting that it's a good idea to double check the project setting, namespaces, etc. before you get too far with building up your project to avoid potential issues later.

Configuration With Same Name Already Exists

I have a solution with 10+ projects (VS2010 SP1). I have the following configurations defined in the solution:
Debug
Debug-QA
Release-UAT
Release-Production
This allows me to easily setup specific settings for each deployment scenario. However, for some reason I can't get things setup as I'd like. Please see this screenshot:
Notice the highlighted projects/configurations. I am unable to create a "Debug-QA" configuration for these projects (by selecting <New> in the cell for that particular project). When I try to add a new "Debug-QA" configuration to the DataUtility project, for instance, Visual Studio yells at me:
This configuration could not be created because a solution configuration of the same name already exists.
I know it does! I'm trying to add the configuration to the project! What am I missing here? I want all projects to have all 5 configuration. I have the same problem when trying to match up (create) platforms (for instance, adding an "Any CPU" platform to the DataUtility project).
Make sure you're using the drop down list from the grid (not the one at the top of the dialog), and do not check the "Create new solution configurations" checkbox when adding your new project configuration.
Here's a workaround if already checked the Create new solution configurations checkbox:
Open Explorer and navigate to the location of the solution for the project that is missing platforms.
Move the solution .sln file to a temorary location where Visual Studio won't locate it.
Open the .csproj file for the project that is missing platforms.
Click the Solutions Platform dropdown.
Click Configuration Manager...
In the table, Click the dropdown in the Platform column for the project and select , to add a new platform.
Click OK.
Repeat adding new platforms as needed.
Save the project.
Return the previously moved solution file back to where it was.
Reopen the combined project solution.
source: https://developercommunity.visualstudio.com/content/problem/972/adding-a-platform-when-one-with-the-same-name-alre.html
The above solution didn't quite work, but I did find a solution on a forum that worked. Described below is to set the builds to x64 for each project that was set to "Any CPU", but the steps would also work for x86.
Open the main solution. Unload each project with a conflict (not
remove).
Leave the solution open.
In Explorer, navigate to the
project folders and open the csproj file in Visual Studio.
In this
screwed up project, navigate to Build->Configuration Manager.
If
needed, "Add New" and set it to x64 and save.
Right-click the
project and set the build architecture to the new x64.
Save this,
but when you close the project in VS, do not save to the solution.
That's unnecessary.
Repeat for each project with a misaligned architecture.
Finally, in the original solution with all the offending projects,
reload each project.
Open the Build->Configuration Manager for the solution. Then, one by
one, reset "Any CPU" to the desired platform, in my case x64.
Save the changes for the solution and rebuild all. You should be OK,
now.

Visual Studio 2010 - .Sln file when clicking on .csproj

I can open my project by double clicking on the .csproj file. It opens fine and it doesn’t generate a .sln. If I copy the same project to a virtual machine and do the same it opens but creates a .sln file.
I really don’t need a solution I would prefer to only work on a single project.
Am I missing something here?
Visual Studio always creates a solution. If it cannot find one in the same folder as the .csproj file then it will create one itself, based on what it can reverse-engineer from the project file content.
The solution is hidden by default if the solution only contains one project. Fixing this is recommended: Tools + Options, Projects and Solutions, General, "Always show solution" checkbox.
There is always a solution, even if you don't see it. There's a setting that determines whether the solution is visible when there is only one project.

Resources