If you do not want to edit project files, there is another solution.
Each * .csproj file contains the following: <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> .
On my computer and .Net 4.0, this file is located in "C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.CSharp.targets"
Add PropertyGroup inside Project :
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> ... <PropertyGroup> <DestServer>\myserver\final-dest</DestServer> </PropertyGroup> ... ... </Project>
All your assemblies will now (either from MSBuild and Visual Studio) use this property, so you do not need to modify .csproj or pass arguments from the command line
Update
It was a quick and dirty way, since it would cover all the projects created on this PC. Only do this if there are many projects, and you do not have the right to change them.
Usually you just add a new PropertyGroup inside the same project.
If there are many projects where you need this variable, you can create and import your extension targets below the default targets:
App1.csproj
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> ... <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> <Import Project="..\myCustom.targets" /> ... </Project>
and
myCustom.targets
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <PropertyGroup> <DestServer>\myserver\final-dest</DestServer> </PropertyGroup> </Project>
source share