0
我有一个网站项目解决方案。有三种自定义解决方案配置:Dev,Test,Prod。但是,网站项目没有.csproj文件,并且没有办法(或者我无法找到它)使用Web站点项目的配置。 我使用的MSBuild构建解决方案:针对网站的Visual Studio重写解决方案配置
MSBuild.exe MySolution.sln /m /p:Platform=x86;TargetFrameworkVersion=v4.6.2;OutputPath=bin;Configuration=Dev /ToolsVersion:14.0
由于.sln文件没有关于网站项目我的开发配置的任何信息,只有调试和发布“节”:
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
EndProject
并且网站没有被建立。
OK,我可以手动编辑解决方案文件和变更/添加Dev.XXXX,Test.XXX等相关设置,一切运作良好,直到你在Visual Studio开放的解决方案,并将其保存。 Visual Studio将完成所有更改并再次面临同样的问题。
作为一种变通方法,我可以创建.sln文件的副本,并手动将其与原来的解决方案同步。有人有更好的主意吗?