Unresolved Assembly Reference when Merging Precompiled ASP.NET Assemblies

If you need to merge the output DLLs generated after precompiling an ASP.NET website from Visual Studio 2008 and later, you need to use the ASP.NET merge tool. The location of this tool is a bit tricky, though. The tools are usually in %Program Files%\Microsoft SDKs\Windows\v7.0A\Bin\ for .NET Framework 4, but the version of aspnet_merge in that folder is for .net 3.5!

Trying to merge .net4 assemblies with this tool will give the error message below:

Utility to merge precompiled ASP.NET assemblies. Version 3.5.30729.
Copyright (c) Microsoft Corporation 2007. All rights reserved.

aspnet_merge: error occurred: An error occurred when merging assemblies: Unresolved assembly reference not allowed:

The correct version to use is actually in %ProgramFiles%\Microsoft SDKs\Windows\v7.0A\Bin\NETFX 4.0 Tools\. I have to admit that I got some help from the blog Self Documenting Code after scanning google search results like Neo in the first Matrix movie.

Leave a comment