【发布时间】:2014-10-11 16:57:40
【问题描述】:
我在 TFS2013 使用 Team Build 时遇到问题,该团队构建先构建然后发布网站。
当我使用 VS2013 和(右键单击)发布网站从我的开发机器上发布网站时,一切正常
网站项目的选项。我在 TFS2013 构建服务器上收到以下错误:
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\Web\Transform\Microsoft.Web.Publishing.AspNetCompileMerge.targets(421,5):错误:
**Can't find the valid AspnetCompilerPath** [C:\Builds\3\Web\Development to WebDev\Sources\Web\Website\Development\ASP.NET\App\website.publishproj]
Done Building Project "C:\Builds\3\Web\Development to WebDev\Sources\Web\Website\Development\ASP.NET\App\website.publishproj" (default targets) -- FAILED.
**
我在 Team Build 设置中使用以下 MSBuild 参数。
/p:DeployOnBuild=true;VisualStudioVersion=12.0;DeployTarget=WebFileSystemPublish;PublishProfile=Development
开发 Web 转换在构建服务器上正常工作,以响应“PublishProfile=Development”参数。这 Web.Config 文件为我们的开发环境正确转换。 如 MSBuild 参数中所述,我使用 FileSystem 发布选项并希望保持这种状态。
我已经修改了构建服务器 'C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\Web\Transform\Microsoft.Web.Publishing.AspNetCompileMerge.targets' 在 Target 'ConfigureForAspNetPreCompileMerge' 中记录一些属性,如下所示:
<Message Text="[TargetFrameworkVersion]: $(TargetFrameworkVersion)" />
<Message Text="[AspnetCompilerPath]: $(AspnetCompilerPath)" />
<Message Text="[Framework40Dir]: $(Framework40Dir)" />
<Message Text="[MSBuildToolsRoot]: $(MSBuildToolsRoot)" />
<Message Text="[MSBuildRuntimeVersion]: $(MSBuildRuntimeVersion)" />
它将以下信息记录到 Team Build 的 website.log 文件中: ConfigureForAspNetPreCompileMerge:
[目标框架版本]:v4.0 [AspnetCompilerPath]: [Framework40Dir]:C:\Program Files (x86)\MSBuild\v4.0.30319 [MSBuildToolsRoot]:C:\Program 文件 (x86)\MSBuild\ [MSBuildRuntimeVersion]:4.0.30319
[Framework40Dir] 不同于我的本地机器在同一个 MSBuild 目标上记录相同的数据:
12> 任务参数:Text=[TargetFrameworkVersion]: v4.0 12>
[TargetFrameworkVersion]:v4.0 12> 任务 参数:Text=[AspnetCompilerPath]:12> [AspnetCompilerPath]: 12> 任务参数:Text=[Framework40Dir]: C:\Windows\Microsoft.NET\Framework\v4.0.30319 12> [Framework40Dir]: C:\Windows\Microsoft.NET\Framework\v4.0.30319 12> 任务 参数:Text=[MSBuildToolsRoot]:C:\Program Files (x86)\MSBuild\ 12> [MSBuildToolsRoot]: C:\Program Files (x86)\MSBuild\ 12> 任务 参数:文本=[MSBuildFrameworkToolsRoot]: C:\Windows\Microsoft.NET\Framework\ 12>
[MSBuildFrameworkToolsRoot]:C:\Windows\Microsoft.NET\Framework\ 12>
任务参数:Text=[MSBuildRuntimeVersion]:4.0.30319 12>
[MSBuildRuntimeVersion]:4.0.30319
[Framework40Dir] 的 TeamBuild 值为:'C:\Program Files (x86)\MSBuild\v4.0.30319' vs 我的本地 DEV 机器:C:\Windows\Microsoft.NET\Framework\v4.0.30319
这似乎很不寻常。
我还更改了 TeamBuild 文件:'C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\Web\Transform\Microsoft.Web.Publishing.AspNetCompileMerge.targets' 手动将 Framework40Dir 的属性设置为 'C:\Windows\Microsoft.NET\Framework\v4.0.30319' 但这似乎会挂起整个 TeamBuild 进程,直到它到达那个点并永远运行 Team Build,直到我手动停止它。
这与这里的解决方案相同:TFS Build Server cannot get publish profile to work: "Can't find the valid AspnetCompilerPath" 但这对我不起作用。该问题与我的问题相同。
构建服务器是最新的 TFS2013.3。我没有在该机器上安装 Visual Studio 2013,我非常喜欢 不要那样做。我已经读到 TFS Team Builds 不需要 VS。
非常感谢您对这个问题的帮助.....谢谢。
【问题讨论】:
标签: tfs msbuild web-site-project publish-profiles