Visual studio 为什么VisualStudio没有';是否在解决方案文件中为不同于标准(发布/调试)的配置添加AspNetCompiler设置?

Visual studio 为什么VisualStudio没有';是否在解决方案文件中为不同于标准(发布/调试)的配置添加AspNetCompiler设置?,visual-studio,msbuild,build-automation,projects-and-solutions,aspnet-compiler,Visual Studio,Msbuild,Build Automation,Projects And Solutions,Aspnet Compiler,我的解决方案有3种构建配置:发布、调试和自定义。我也有网站(是的,不是WebApplication)项目类型。默认情况下,创建网站时,VisualStudio 2008会向解决方案文件中添加以下部分: Debug.AspNetCompiler.VirtualPath = "/MyWebSite" Debug.AspNetCompiler.PhysicalPath = "MyWebSite\" Debug.AspNetCompiler.TargetPath = "PrecompiledWeb\My

我的解决方案有3种构建配置:发布、调试和自定义。我也有网站(是的,不是WebApplication)项目类型。默认情况下,创建网站时,VisualStudio 2008会向解决方案文件中添加以下部分:

Debug.AspNetCompiler.VirtualPath = "/MyWebSite"
Debug.AspNetCompiler.PhysicalPath = "MyWebSite\"
Debug.AspNetCompiler.TargetPath = "PrecompiledWeb\MyWebSite\"
Debug.AspNetCompiler.Updateable = "false"
Debug.AspNetCompiler.ForceOverwrite = "true"
Debug.AspNetCompiler.FixedNames = "false"
Debug.AspNetCompiler.Debug = "True"
Release.AspNetCompiler.VirtualPath = "/MyWebSite"
Release.AspNetCompiler.PhysicalPath = "MyWebSite\"
Release.AspNetCompiler.TargetPath = "PrecompiledWeb\MyWebSite\"
Release.AspNetCompiler.Updateable = "false"
Release.AspNetCompiler.ForceOverwrite = "true"
Release.AspNetCompiler.FixedNames = "false"
Release.AspNetCompiler.Debug = "False"
SlnRelativePath = "\MyWebSite\"
MSBuild使用此配置预编译/发布网站。正如您所看到的,这里没有针对我的“自定义”构建配置的配置,只针对“发布”“调试”。所以,当我尝试使用MSBuild和“自定义”构建配置网站构建解决方案时,根本不需要编译

但是,当我在解决方案文件中手动添加以下行时,一切都按预期工作:

Custom.AspNetCompiler.VirtualPath = "/MyWebSite"
Custom.AspNetCompiler.PhysicalPath = "MyWebSIte\"
Custom.AspNetCompiler.TargetPath = "PrecompiledWeb\MyWebSite\"
Custom.AspNetCompiler.Updateable = "false"
Custom.AspNetCompiler.ForceOverwrite = "true"
Custom.AspNetCompiler.FixedNames = "false"
Custom.AspNetCompiler.Debug = "True"
我认为这是VisualStudio 2008中的一个bug(我在2010年检查过)。问题在于,当VisualStudio 2008修改解决方案文件时(例如,在添加新项目的情况下),手动添加的行将被删除。也许我应该向微软VS开发团队提交一个bug


如果其他人也有同样的问题,有什么建议如何解决?谢谢

能否通过configuration Manager对话框(在Build>configuration Manager菜单项下)将“自定义”配置添加到项目中?手动添加的部分可能不完整,或者,VisualStudio希望解决方案文件中的另一个部分也会被修改。

没有正式的方法来执行此操作。

我已经这样做了。仅手动添加了AspNetCompiler设置。