Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VISUAL STUDIO 2010: How to output all projects under a solution to the same directory

I have inherited a C# application, it is made up of 4 solution files each with 92 projects under each solution file.

I am looking for an easy way to change all the Build Output Path's of each project to a common directory when I manually build the solutions.

If someone knows of either a macro that will iterate through each project and change the path, or if there is a way to create a global environment variable which will override all the projects' variables, or any other way, I will really appreciate the help.

Please note that I am NOT using a build server, and that I would like to accomplish this for when I do a manual build on the solution in visual studio.

Many thanks in advance.

like image 950
Ryk Avatar asked Jan 15 '12 08:01

Ryk


People also ask

Can a Visual Studio solution contain multiple projects?

Visual Studio extension that allows adding multiple existing projects into the solution. Optionally creates the solution folder structure reflecting to the physical hierarchy on disk. See the change log for changes and road map.

Should you place solution and project in the same directory?

Creating a Solution NET will create a new solution with the same name as the project, placing the solution files in the same directory as the project. Although this works fine for small projects, it isn't well suited to more complex applications.

How do I change the output path in Visual Studio?

Right-click on the project node in Solution Explorer and select Properties. Expand the Build section, and select the Output subsection. Find the Base output path for C#, and type in the path to generate output to (absolute or relative to the root project directory), or choose Browse to browse to that folder instead.

How do you unload a solution in Visual Studio?

NET projects, first unload the project (right-click the project node in Solution Explorer and select Unload Project). Then, right-click on the project and choose Edit <projectname>. You don't have to use solutions or projects in Visual Studio to edit, build, and debug code.


1 Answers

  1. Install a decent text editor, if you do not already have one. Something like Notepad++. The editor will need to be able to open multiple files at once.

  2. Go to the parent solution directory in My Computer.

  3. Enter "*.csproj" (or "*.vbproj") in the search bar to be able to open all project files in sub-directories at one time.

    enter image description here

  4. Open your text editor, like Notepad++

  5. Drag all project files into the editor to open them

  6. Look for the <OutputPath>...</OutputPath> line and perform a find and replace in all open documents, replacing the path(s) that are there with the path you want.

    enter image description here

like image 145
quentin-starin Avatar answered Oct 14 '22 01:10

quentin-starin