While compiling perfectly fine on developer's local machine, Team Build for an ASP.Net project may fail on a build server with a failure to load Microsoft.Web.Deployment assembly
Possible Solution:
Download and install Web Deploy 2.0 Refresh for your platform. This version can coexist with previous, 1.1 version.
x86: http://go.microsoft.com/fwlink/?LinkId=209115
x64: http://go.microsoft.com/fwlink/?LinkId=209116
Error:
Target "CheckAndCleanMSDeployPackageIfNeeded" in file "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.targets" from project ".....csproj" (target "GenerateMsdeployManifestFiles" depends on it):
Using "IsCleanMSDeployPackageNeeded" task from assembly "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.Tasks.dll".
Task "IsCleanMSDeployPackageNeeded"
Failed to load this version Microsoft.Web.Deployment (8.0) reason:Could not load file or assembly 'Microsoft.Web.Deployment, Version=8.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified..
Trying the next one specified in $(_MSDeployVersionsToTry)..
Failed to load this version Microsoft.Web.Deployment (7.5) reason:Could not load file or assembly 'Microsoft.Web.Deployment, Version=7.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified..
Trying the next one specified in $(_MSDeployVersionsToTry)..
Failed to load this version Microsoft.Web.Deployment (7.1) reason:Could not load file or assembly 'Microsoft.Web.Deployment, Version=7.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified..
Trying the next one specified in $(_MSDeployVersionsToTry)..
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.targets(2850,5): error MSB4018: The "IsCleanMSDeployPackageNeeded" task failed unexpectedly. [.......csproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.targets(2850,5): error MSB4018: System.NullReferenceException: Object reference not set to an instance of an object. [......csproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.targets(2850,5): error MSB4018: at Microsoft.Web.Publishing.Tasks.Common.Utility.CheckMSDeploymentVersion() [......csproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.targets(2850,5): error MSB4018: at Microsoft.Web.Publishing.Tasks.Common.Utility.get_IsMSDeployInstalled() [......csproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.targets(2850,5): error MSB4018: at Microsoft.Web.Publishing.Tasks.Common.Utility.CheckMSDeploymentVersion(Task task) [.....csproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.targets(2850,5): error MSB4018: at Microsoft.Web.Publishing.Tasks.IsCleanMSDeployPackageNeeded.Execute() [.....csproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.targets(2850,5): error MSB4018: at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() [......csproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.targets(2850,5): error MSB4018: at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask, Boolean& taskResult) [......csproj]
Done executing task "IsCleanMSDeployPackageNeeded" -- FAILED.
Done building target "CheckAndCleanMSDeployPackageIfNeeded" in project ".....csproj" -- FAILED.
Done executing task "CallTarget" -- FAILED.
Thanks for this post it really saved my bacon!
ReplyDelete