SmartAssembly 7

The assembly [assembly] is being merged, but the dependent assembly [assembly] isn't. Either merge both assemblies, or neither.

This article applies to SmartAssembly 6.6.4 and later.

When building your application with Dependencies Merging enabled, you may see the following error message:

The assembly [assembly] is being merged, but the dependent assembly [assembly] isn't. Either merge both assemblies, or neither. 

Background

Sometimes, your main assembly will use a dependency (let's call it 'A'), which itself calls another dependency ('B'):

In SmartAssembly 6.6.3 or earlier, you could merge Dependency B into your main assembly, whilst leaving Dependency A as a separate file:

This behavior was a bug, because if you obfuscated the main assembly (with the merged Dependency B), the code in Dependency A often could not interact with Dependency B. Consequently, many users experienced broken builds.

To resolve the issue

In SmartAssembly 6.6.4 and later, you must merge all dependencies with their related dependencies. That is, if you merge Dependency B, you must also merge Dependency A:

In some cases, for example if Dependency A employs integrity protection, you cannot merge Dependency A. In this scenario, you cannot use SmartAssembly 6.6.4 or later to merge Dependency B either. You should embed both Dependency A and Dependency B instead. For more information, see Embedding dependencies.


Didn't find what you were looking for?