visual-studio-2015msbuildteamcityaspnet-merge

AspNetMerge Task using MSBuild 2015


I'm migrating a project in Visual Studio 2010 up to use newer 2015 tooling and have no idea how to solve this one.

During the build via TeamCity on a new build agent with Visual Studio 2015 installed, the following error occurs:

error MSB4062: The "Microsoft.WebDeployment.Tasks.AspNetMerge" task could not be loaded from the assembly C:\Program Files (x86)\MSBuild\Microsoft\WebDeployment\v10.0\Microsoft.WebDeployment.Tasks.dll. Could not load file or assembly 'file:///C:\Program Files (x86)\MSBuild\Microsoft\WebDeployment\v10.0\Microsoft.WebDeployment.Tasks.dll' or one of its dependencies. The system cannot find the file specified. Confirm that the declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask.

The assembly in question is referenced in the .proj file for the build as a task:

<UsingTask TaskName="Microsoft.WebDeployment.Tasks.AspNetMerge" AssemblyFile="$(MSBuildExtensionsPath)\Microsoft\WebDeployment\v10.0\Microsoft.WebDeployment.Tasks.dll"/>

Now given the version number in those paths is v10.0 I assume it's still referencing an older tool. Problem is that in the new tooling Microsoft.WebDeployment.Tasks.dll no longer exists.

Could anyone tell me what is the new assembly I need to reference in my MSBuild proj in order to perform the aspnet_merge step in the new tools? Is there a better way?

Thanks in advance!


Solution

  • I got this working in the end by changing the assembly the AspNetMerge task uses in the .proj file to this:

    <UsingTask TaskName="AspNetMerge" AssemblyFile="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v14.0\Web\Microsoft.Web.Publishing.Tasks.dll"/>
    

    The AspNetMerge task is now part of the Microsoft.Web.Publishing.Tasks.dll.