我想使用Visual Web Developer Express 2010发布一个网站,通过以下设置预编译到远程服务器上:
- 只部署运行此应用程序所需的文件
- 在发布之前预编译此应用程序
- 允许网站可更新
- 不会部署任何数据库
- 将站点部署为文件层次结构,而不是.zip包
我的第一次构建/部署似乎进行得很顺利,但在第二次编译后,我收到以下错误信息:
Transformed web.config using C:\path_to_site\Web.Debug.config into obj\Debug\TransformWebConfig\transformed\web.config.
Copying all files to temporary location below for package/publish:
obj\Debug\AspnetCompileMerge\Source.
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.5\Web\Transform\Microsoft.Web.Publishing.AspNetCompileMerge.targets(132,5): Error : Can't find the valid AspnetMergePath
这里是 Microsoft.Web.Publishing.AspNetConfigurationMerge.targets 文件内容的子集:
<Target
Name="GetAspNetMergePath"
DependsOnTargets="$(GetAspNetMergePathDependsOn)"
Condition ="'$(GetAspNetMergePath)' != 'false'">
<PropertyGroup>
<AspnetMergeName>aspnet_merge.exe</AspnetMergeName>
<AspnetMergePath Condition="Exists('$(TargetFrameworkSDKToolsDirectory)$(AspnetMergeName)')">$(TargetFrameworkSDKToolsDirectory)</AspnetMergePath>
</PropertyGroup>
<Error Condition="'$(AspnetMergePath)' == '' Or !Exists($(AspnetMergePath))"
Text="Can't find the valid AspnetMergePath" />
</Target>
编辑:更改发布设置以在发布之前删除所有现有文件并不能解决问题。我目前认为这个问题是本地的。
我的web.config中似乎没有AspMergePath标签。我不知道是否应该手动添加标签。但是,路径“obj {publish setting} \ AspnetCompileMerge \ Source”确实存在于我的项目中。
如果有必要的话,我的项目名称是“TestProject.NET”。
感谢您的反馈。