Webサイトプロジェクトのソリューションがあります。 3つのカスタムソリューション構成があります:Dev、Test、Prod。ただし、Webサイトプロジェクトには.csprojファイルがなく、Webサイトプロジェクトの構成を使用する方法はありません(または見つけられません)。 私はソリューションを構築するためのMSBuildを使用しています:Visual Studio Webサイトのソリューションコンフィグレーションを書き換えます
MSBuild.exe MySolution.sln /m /p:Platform=x86;TargetFrameworkVersion=v4.6.2;OutputPath=bin;Configuration=Dev /ToolsVersion:14.0
の.slnファイルは、Webサイトのプロジェクトのための私のDev構成に関するすべての情報を持っていないため、唯一のデバッグとリリース「セクション」があります。
は、Project("{E24C65DC-7377-472B-9ABA-BC803B73C61A}") = "Web", "Web\", "{1F81A0DB-6FF4-4F89-B988-6D327797C4FD}"
ProjectSection(WebsiteProperties) = preProject
TargetFrameworkMoniker = ".NETFramework,Version%3Dv4.6.2"
ProjectReferences = "{12A625AA-8B5A-4336-AA4A-3630AAB3A27D}|MyLib.dll;"
Debug.AspNetCompiler.VirtualPath = "/localhost_54141"
Debug.AspNetCompiler.PhysicalPath = "Web\"
Debug.AspNetCompiler.TargetPath = "PrecompiledWeb\localhost_54141\"
Debug.AspNetCompiler.Updateable = "true"
Debug.AspNetCompiler.ForceOverwrite = "true"
Debug.AspNetCompiler.FixedNames = "false"
Debug.AspNetCompiler.Debug = "True"
Release.AspNetCompiler.VirtualPath = "/localhost_54141"
Release.AspNetCompiler.PhysicalPath = "Web\"
Release.AspNetCompiler.TargetPath = "PrecompiledWeb\localhost_54141\"
Release.AspNetCompiler.Updateable = "true"
Release.AspNetCompiler.ForceOverwrite = "true"
Release.AspNetCompiler.FixedNames = "false"
Release.AspNetCompiler.Debug = "False"
VWDPort = "54141"
SlnRelativePath = "Web\"
StartServerOnDebug = "false"
EndProjectSection
エンドプロジェクト
ウェブサイトが構築されていません。
OK、ソリューションファイルを手動で編集し、Dev.XXXX、Test.XXXなどの関連設定を変更/追加することができます.Visual Studioでソリューションを開いて保存するまで、すべてうまくいきます。 Visual Studioはすべての変更を排出し、同じ問題が再び発生します。
回避策として、.slnファイルのコピーを作成し、元のソリューションと手動で同期させることができます。誰か良いアイデアはありますか?