views:

2743

answers:

2

I recently upgraded a VS2005 web deployment project to VS2008 - and now I get the following error when building:

The specified task executable location "bin\aspnet_merge.exe" is invalid.

Here is the source of the error (from the web deployment targets file):

<Target Name="AspNetMerge" Condition="'$(UseMerge)' == 'true'" DependsOnTargets="$(MergeDependsOn)">
    <AspNetMerge
      ExePath="$(FrameworkSDKDir)bin"
      ApplicationPath="$(TempBuildDir)"
      KeyFile="$(_FullKeyFile)"
      DelaySign="$(DelaySign)"
      Prefix="$(AssemblyPrefixName)"
      SingleAssemblyName="$(SingleAssemblyName)"
      Debug="$(DebugSymbols)"
      Nologo="$(NoLogo)"
      ContentAssemblyName="$(ContentAssemblyName)"
      ErrorStack="$(ErrorStack)"
      RemoveCompiledFiles="$(DeleteAppCodeCompiledFiles)"
      CopyAttributes="$(CopyAssemblyAttributes)"
      AssemblyInfo="$(AssemblyInfoDll)"
      MergeXmlDocs="$(MergeXmlDocs)"
      ErrorLogFile="$(MergeErrorLogFile)"
      />

What is the solution to this problem?

Note - I also created a web deployment project from scratch in VS2008 and got the same error.

+7  A: 

Apparently aspnet_merge.exe (and all the other SDK tools) are NOT packaged in Visual Studio 2008. Visual Studio 2005 packaged these tools as part of its installation.

The place to get this is an installation of the Windows 2008 SDK (latest download). Windows 7/Windows 2008 R2 SDK: here

The solution is to install the Windows SDK and make sure you set FrameworkSDKDir as an environment variable before starting the IDE. Batch command to set this variable:

SET FrameworkSDKDir="C:\Program Files\Microsoft SDKs\Windows\v6.1"

NOTE: You will need to modify to point to where you installed the SDK if not in the default location.

Now VS2008 will know where to find aspnet_merge.exe.

Adam
+2  A: 

I just ran into this same problem trying to use MSBuild to build my web application on a server. I downloaded the "web" version of the SDK because the setup is only 500KB and it prompts you for which components to install and only downloads and installs the ones you choose. I unchecked everything except for ".NET Development Tools". It then downloaded and installed about 250MB worth of stuff, including aspnet_merge.exe and sgen.exe

You can download the winsdk_web.exe setup for Win 7 and .NET 3.5 SP1 here.

BigJoe714