I'm using TFS to build an Azure project including an ASP.NET MVC 3 web role.
Currently my builds are failing with the following error:-
C:\Program Files (x86)\MSBuild\Microsoft\Cloud Service\1.0\Visual Studio 10.0\Microsoft.CloudService.targets (202): Could not find a part of the path...
Followed by a path to a file called "WaIISHost.exe.config" under "{AzureProject}\roles\{WebRole}\x64\".
I've checked on the build server, and indeed this file does not exist. In fact, the entire "{webRole}\x64\" directory does not appear to have been created. The directory is also not created when I build on my own machine. I created a fresh Azure project with the wizard (with an MVC 2 web role also created by the wizard) and the directory wasn't created for that either.
Line 202 in Microsoft.CloudService.targets appears to be invoking the CSPack utility - which presumably is attempting to package the WebRole for deployment. It expects files in the "...\x64" directory and isn't finding them - hence the build failure.
Despite the "missing" files, I can build and publish from my own machine. I only get errors on the build server.
Any idea why the "...\x64" directory is not being created for my web role?
Is it possible to instruct CSPack to not look for these files?
What relies on CSPack having done its job during the build? If I delete the CSPack invocation from the .targets file, will there be any consequences?
Edit
The part of the log that's failling is:-
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)
Looks like it's a problem with CSPack - it's copying the files in from Program Files...\bin\runtimes\base\x86, but not from ...\x64, then it's expecting something in the target ...\x64 directory. Possibly something to do with the way CSPack is configured? Definitely looks like it's not MSBuild's job to be creating those files.