【发布时间】:2011-09-17 10:40:39
【问题描述】:
我正在使用 TFS 构建一个包含 ASP.NET MVC 3 Web 角色的 Azure 项目。
目前我的构建失败并出现以下错误:-
C:\程序文件 (x86)\MSBuild\Microsoft\Cloud 服务\1.0\Visual Studio 10.0\Microsoft.CloudService.targets (202):找不到一部分 路径...
后跟“{AzureProject}\roles\{WebRole}\x64\”下名为“WaIISHost.exe.config”的文件的路径。
我检查了构建服务器,确实这个文件不存在。事实上,整个“{webRole}\x64\”目录似乎并没有被创建。当我在自己的机器上构建时,也不会创建该目录。我使用向导创建了一个全新的 Azure 项目(向导还创建了一个 MVC 2 Web 角色),并且也没有为此创建目录。
Microsoft.CloudService.targets 中的第 202 行似乎正在调用 CSPack 实用程序 - 它可能正在尝试打包 WebRole 以进行部署。它需要 "...\x64" 目录中的文件,但没有找到它们 - 因此构建失败。
尽管“丢失”文件,我可以从我自己的机器上构建和发布。我只在构建服务器上收到错误。
知道为什么“...\x64”目录 不是为我的网络角色创建的?
是否可以指示 CSPack 不查找这些文件?
什么依赖于 CSPack 在构建期间完成其工作?如果我从 .targets 文件中删除 CSPack 调用,会有什么后果吗?
编辑
日志中失败的部分是:-
ModelFile is (TaskId:310)
OutputDirectory is C:\Builds\2\GBC\GBC - CI Build\Binaries\GBC.Web.Azure.csx\ (TaskId:311)
PackRoles is C:\Builds\2\GBC\GBC - CI Build\Sources\GBC\GBC.Web.Azure\obj\Release\GBC.Web.Site\, Name=GBC.Web.Site, EntryPoint=GBC.Web.Site.dll, SourceDir=C:\Builds\2\GBC\GBC - CI Build\Sources\GBC\GBC.Web.Site\ (TaskId:312)
RoleProperties is GBC.Web.Site, EntryPoint=GBC.Web.Site.dll, TargetFrameworkVersion=v4.0 (TaskId:313)
ServiceDefinitionCopy is ServiceDefinition.build.csdef (TaskId:314)
ServiceConfigurationCopy is C:\Builds\2\GBC\GBC - CI Build\Binaries\ServiceConfiguration.cscfg (TaskId:315)
Calling ServicePack (TaskId:316)
Using "CSPack" task from assembly "C:\Program Files (x86)\Windows Azure SDK\v1.4\bin\Microsoft.ServiceHosting.Tools.MSBuildTasks.dll".
Task "CSPack" (TaskId:317)
Searching for imported module Diagnostics at C:\Program Files (x86)\Windows Azure SDK\v1.4\bin\plugins\Diagnostics\Diagnostics.csplugin... (TaskId:317)
Copying 'C:\Builds\2\GBC\GBC - CI Build\Sources\GBC\GBC.Web.Azure\obj\Release\GBC.Web.Site\' to C:\Builds\2\GBC\GBC - CI Build\Binaries\GBC.Web.Azure.csx\roles\GBC.Web.Site\approot... (TaskId:317)
Copying 'C:\Program Files (x86)\Windows Azure SDK\v1.4\bin\runtimes\base\x86' to C:\Builds\2\GBC\GBC - CI Build\Binaries\GBC.Web.Azure.csx\roles\GBC.Web.Site\base\x86... (TaskId:317)
Copying 'C:\Program Files (x86)\Windows Azure SDK\v1.4\bin\runtimes\diagnostics\x86' to C:\Builds\2\GBC\GBC - CI Build\Binaries\GBC.Web.Azure.csx\roles\GBC.Web.Site\diagnostics\x86... (TaskId:317)
C:\Program Files (x86)\MSBuild\Microsoft\Cloud Service\1.0\Visual Studio 10.0\Microsoft.CloudService.targets(202,5): error : Could not find a part of the path 'C:\Builds\2\GBC\GBC - CI Build\Binaries\GBC.Web.Azure.csx\roles\GBC.Web.Site\base\x64\WaIISHost.exe.config'. [C:\Builds\2\GBC\GBC - CI Build\Sources\GBC\GBC.Web.Azure\GBC.Web.Azure.ccproj]
Done executing task "CSPack" -- FAILED. (TaskId:317)
看起来这是 CSPack 的问题 - 它正在从 Program Files...\bin\runtimes\base\x86 复制文件,而不是从 ...\x64 复制文件,然后它期待目标中的某些内容... \x64 目录。可能与 CSPack 的配置方式有关?创建这些文件显然不是 MSBuild 的工作。
【问题讨论】:
-
您的构建机器上是否安装了 Azure 工具?
标签: .net asp.net-mvc-3 tfs azure