How to set the reference path for the solution in Visual Studio?
c#, visual-studio, visual-studio-2010
Solution
I found a blog post explaining how to do this.
Open the Package Manager Console (e.g. View | Other Windows | Package Manager Console) and use a script such as the following for relative paths:
$path = [System.IO.Path]; foreach ($proj in get-project -all) {$proj.Properties.Item("ReferencePath").Value="$($path::GetDirectoryName($proj.filename))\..\libs"}
or this for a single fixed project reference for all projects:
foreach ($proj in get-project -all) {$proj.Properties.Item("ReferencePath").Value="C:\lib"}
Problem
I have a C# solution contains many projects. Each project references some dlls in a specified folder. According to MSDN we could add the reference path for a project in project -> Properties -> Reference Paths. It will generate a .csproj.user file under the project folder with the content below: ``` <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <PropertyGroup> <ReferencePath>C:\References\bin\</ReferencePath> </PropertyGroup> </Project> ``` But this only works for one project alone. Is there a simple way to apply the same setting to all of the projects in the solution?