csprojファイルのデバッグ構成とリリース構成の両方のプロパティ値をプログラムで変更したい。そのために4つの辞書を定義する必要がありますか?
例:DebugおよびRelease構成の "WarningLevel"プロパティ( "x86"と"AnyCPU"の値は同じままです)をWarningLevel=4に変更するとします。
var globalPropertiesReleaseX86 = new Dictionary<string, string> { { "Configuration", "Release" }, { "Platform", "x86" } };
var globalPropertiesDebugX86 = new Dictionary<string, string> { { "Configuration", "Debug" }, { "Platform", "x86" } };
var globalPropertiesReleaseAnyCPU = new Dictionary<string, string> { { "Configuration", "Debug" }, { "Platform", "x86" } };
var globalPropertiesDebugAnyCpu = new Dictionary<string, string> { { "Configuration", "Debug" }, { "Platform", "x86" } };
Project projectReleaseX86 = new ProjectCollection(globalPropertiesReleaseX86).LoadProject(filePath);
projectReleaseX86.SetProperty("WarningLevel", "4");
...and so on????
より良いアプローチがあると確信しています。任意の提案をいただければ幸いです。
前もって感謝します...