c# - Can I change all solution's projects output paths simultaneously in VS12/10? -
i have solution on 61 projects.
there 3 target platforms: 'debug', 'release', 'release tablet'
there 2 solution platforms: 'x86' , 'any cpu'
i want projects build in 2 folders:
d:\samplepath\debug\ 'debug' configuration on platform 'x86' , 'any cpu'
d:\samplepath\release\ 'release' , 'release tablet' configurations on platforms
is there simple way manage of these paths rather setting them 1 one (it's 61x3x2 = 366 paths set !sic!)? in advance
try (i run code in linqpad, can create console app if like):
const string xmlns = "http://schemas.microsoft.com/developer/msbuild/2003"; void main() { var dir = @"c:\proj\catalyst\source"; var xmlns = "http://schemas.microsoft.com/developer/msbuild/2003"; foreach( var configfile in directory.enumeratefiles(dir,"*.csproj",searchoption.alldirectories)) { var doc = xdocument.load(configfile); var paths = doc.descendants(xname.get("outputpath",xmlns)); foreach(var path in paths) { path.value = "\"$(solutiondir)$(configurationname)\$(platformname)\""; } doc.save(configfile); } }
this make output directory relative solution file (though can replace $(solutiondir) absolute path if like.)
Comments
Post a Comment