Copying visual studio projects between solutions - visual-studio

Whats the easiest way to copy a visual studio project between distinct solutions? can i just copy the folder containing the project data in windows explorer?

Yes, you can copy the project folder and just add it to the new solution. Also note, that you can have a single project in multiple solutions, if for instance you have a solution for each project and a global solutions for all the projects you have.

Related

Refactor Solution Folder to New Solution

I've got a a fairly large project with many code files in Visual Studio 2015.
This folder contains lots of structures and classes that have no ties to the solution they're in, but need to be moved to an external solution to resolve a circular dependency issue.
Is there any way to automatically refactor a solution folder in VS to a new project? Resharper/other?
I found that while resharper is enabled, you can right click on a solution folder and select "Move" to automatically refactor a solution folder and it's contents..

How to link existing project files in TFS to a new solution in Visual Studio 2013?

I have a solution under which there are 15 projects. This solution is on TFS. I want to create another solution in the same directory in TFS, however I want to use only 12 out of the 15 projects. Which means I don't want to duplicate the projects, but just selectively link a few of them to this second solution.
What I tried was to create a new solution on my local machine and add those projects from my checked out version and just move the .sln file over to TFS. But this didn't work when building on the server, for obvious reasons.
You will have better luck of you make the solution in the same folder as the other solution in your workspace.
Then add the projects and get it to build locally. You should then be able to add the solution to source inplace and build from it.

how to share a folder between two projects in Visual studio 2010

If I have a project called 'testing' in project A.
How can I share that folder 'testing' for project B in visual studio 2010?
The reason I would like to achieve about this is because when I change something in the folder testing of project A, I dont want to change the same things in project B.
Thanks in advance.
Maybe too late for the person who asked the question, but this is for people with similar problems. You can share folder contents with an extention 'Project Linker':
This builds upon the concept of linked files where you refer to the same file from two projects. This extention handles the management of that for an entire project. If you add a file to the project, it will be added too to the other project as a linked file. Same for deletes...
Attention: you need to have both projects in the same solution for this to work of coarse...
Extention VS2015
I used it in VS2010 and it's also availible for later versions.
You can't share folders in Visual Studio - they are logical constructs that are part of a solution or project.
The closest you can get is to add folders to the projects you need to share on and add all the files that you want to share as links. You will still need to manually synchronize all adds/deletes of files, but updates will come across all projects.
To make things easier, you may want to write a Visual Studio macro that synchronizes these folders for you (you can bind these to keyboard shortcuts and/or menu items).
If you put your solution (*.sln) files in the same directory they can share files in sub directories.

Solution folder in Visual Studio 2010 does not build

I have one solution with five projects and one solution folder. All project has a reference to project inside solution folder. When I clean solution and build, projects in solution folder does not build. I need to build project in solution folder before I build the solution.
How can I fix this problem?
It sounds like a project is dependent on another project in your solution (not uncommon).
You can change the order that your projects build in Visual Studio so that the dependency tree is satisfied when building a solution.
If you right click on the solution in the Solution Explorer and choose 'Project Dependencies...' you will be able to tell Visual Studio which order to build your projects.

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