Visual Studio 2008 project configuration changes by platform/configuration - visual-studio

I've got about two dozen projects here in one solution that need changes to the include paths. I can go through and change each one, but what's really annoying me right now is that it looks like I have to change each one four times (debug vs. release, win32 vs. x64). Is there an easier way to do this than changing the include paths about 96 times?
As it happens, there's nothing special about the x64 configuration in these projects. Would there be some way to copy the changes from the win32 configurations, preferably copying in multiple projects at once?

Open *.vcproj project files as text files in Visual Studio editor and execute "Find and replace in files" function. Visual Studio project is actually plain XML file.

Related

How to open two Solution in one Visual Studio IDE?

I am working on two different solutions, say, Solution1 and Solution2. As these two solutions are dependent upon each other, I have to open two separate Visual Studio while developing.
It is really difficult to switch between these Visual Studio. I can't merge these two solutions into one as Solution1 is being used by other projects and all are part of Source Control.
Just wondering, can I open both solutions in the same Visual Studio IDE? I searched a lot but no luck. Any suggestions on existing VS AddIn or how to develop it would also be helpful.
Visual Studio version - 2012 Ultimate
Source Control - TFS
Create a third Solution C than includes project from both A and B: you can keep C as a local file i.e. you don't check it in version control if this can disturb the team.
Else you can open two instances of Visual Studio and switch at need: VS is smart enough to sense file system changes, but you have to be careful in saving before switching.
Does it have to be within the same IDE instance?
You could right click the VS icon in the task bar, select "Visual Studio 20__", and you will have two seperate instances of VS. You can then open separate solutions in both, without merging the two under one solution.
This will eat up far more resources, however. The previous responses are preferable.
What you are asking is impossible and extremely dysfunctional.
The supported solution would be to add all of the projects from Solution B to Solution A. Then you can open a single solution with all of your work. If you want compartmentalisation within your solution you can use solution folders.
If you can you should have a separate solution for the core components and package them as a nuget package. Both of your other solutions can then take a dependency on that single shared package.
open the solution 1 and right click and add the second solution. When you close the VS next time it will told you once to save the sln file. Do it for saving the settings in sln file.
Now everytime you will open sln1 will show you both project. It will not affect if you only move first project to pen drive or move to another computer. In case of 2nd project missing it will told you that 2nd project not found no more worries.
In case of Source Control - TFS I can't confirm how it work but their is some sollution for github (Which maybe hint anything for TFS).
The same trick can be applied but you don't need to push modified sln so this will not break anyone else's settings. If TFS store the files and code on the file system that you currently working then you can applied same trick to do applied this trick to that TFS project which is stored in your file system.
1.open solution1 in visual studio 2012 .
2.Right click on solution1 ,add existing project option.
3.select the solution2 .
4.Now solution1 and solution2 file are same project.

Create a physical copy of a source file in Visual Studio

In Visual Studio, if I try to copy a file from one project to another (by using Copy and Paste or by dragging the file to the new project while holding the Ctrl key) it creates a reference to the source file in the original location. Is there a way to create a physical copy of the source file and place that in the target project source direction without having to resort to using Windows Explorer to copy the file manually?
It's not pretty, but when I want to do what you're suggesting, I double-click on the file in Visual Studio, which opens it. Then I do a File->Save As, choose the right directory and save it. All from within Visual Studio. This is usually followed by adding the new file to the other project.
Was just doing this and realized I should mention a side-effect. Depending on your source control (in my case, TFS 2010), doing this from within Visual Studio may modify the location of the file in the project. For me, this means making sure that neither the file nor its project have any pending changes, doing the save as, then doing an undo of the change this causes in TFS 2010 (project change, file add and delete).
From http://msdn.microsoft.com/en-us/library/0fb6xxhb.aspx:
If you are working with solution items, Visual C++ projects, or other similar projects, you are always working with links in Solution Explorer. If you are working with Visual Basic projects, Visual C# projects, and other projects, you might be working with links or files.
Essentially, the answer to my question is 'No'. In most cases, I must use Windows Explorer.

Visual Studio 2005 not rebuilding when library header files change?

My dev environment at work consists of a Visual Studio 2005 Solution with many sub-projects (by "project" I always mean VS project). Some of the projects build libraries which are used by other projects. By convention, a fair amount of test-related code ends up in header files which end up getting modified frequently. I've noticed that when I hit F7 to Build the solution, Visual Studio does not detect changes to header files that are in library projects. It will report that everything is up to date when it's not. To force it to rebuild the libary, I have to change (touch) one of the .c files in that particular project, or do Rebuild All which is quite slow.
Is there something I can change in the Solution or project settings to change this behavior so Build works as expected? I've actually gone so far as to hack together a script that "touches" one of the library .c files in a library when it detects an .h file has been updated, but there has got to be a VS solution to this.
Are the header files actually members of the library project - not just in an include file search path?

Is there a tool to automatically convert a make file to sln/vcproj?

Google reveals many tools for taking Visual Studio format sln/vcproj files, and producing a make file from them. But I can't find one that solves the opposite problem - I have a make file that references hundreds of .c and .h files and (for convenience, for debugging, for writing code in the VS IDE) would like to open it as a Visual Studio project.
Where can I find a tool to take an arbitrary make file as input, and produce Visual Studio project/solution files as output?
Makefile Project Wizard
You might be able to find a converter for a well-constrained set of makefiles, but a converter for any arbitrary makefile would be tricky. They are mini-programs, after all, that would have to be evaluated. And not all makefile concepts map directly to Visual Studio projects.
If you only have one project to worry about, I'd just manually put together a project in Visual Studio (tip: you can select more than one file in the "Add existing file..." dialog). If you do this regularly, perhaps look into a tool like Premake or CMake to help automate the generation of the projects (and if necessary, a new Makefile) for you.

Solution file vs. Project file in Visual Studio

Can someone briefly explain to me the difference between Visual Studio's solution file (.sln) and project file (.vcproj).
It seems to me opening either one open the correct solution/project in Visual Studio. Is one the super-set of the other?
Note: I am currently using Visual Studio 2008 working on a project that was brought forward from Visual Studio 2005 (I believe).
A solution is a set of projects. If you need more than one project in your software, then go with solutions. I.E.: A Class Library Project + A Web Application Project.
A project file typically corresponds to a single module: EXE or DLL or LIB. A solution manages a collection of project files.
A solution is a collection of projects. Visual Studio is made so that it cannot function without a solution, so if you open a bare project, it will generate the solution automatically (or try to find one).
One solution can contain zero or more projects. Everything is in projects, so a solution with zero projects doesn't contain anything at all besides the solution properties.
Visual studio keeps track of where the projects are used, so if you open a project file, it will open (IIRC) the last solution where it was used.
When you create a project from scratch, a solution is also created, but it's not shown until you add another project to it. It looks like you have only the project open, but it's actually a solution containing the project that is open.
Specifically project files are intended to contain the data required to build the files in the project into an exe or dll. This file is utilized by the local compilers or with systems such as Team Foundation system and server side build agents.
Solutions are a client (IDE) construct designed to manage collections of projects, which in effect is a collection of different build definitions and associated files.
Solution files are typically made up of multiple project files.

Resources