Handling Third Party Library DLL Conflicts

A recurring question just came up again, on handling conflicts between DLLs loaded by Revit add-ins.

For instance, this can be caused by a scenario in which add-ins A and B both make use of library DLL C, but specify different versions. A soon as the first add-in has loaded its version of C, the second add-in is prevented from loading the version it requires and cannot run.

I have no official solution to suggest for this, just these discussion threads and articles suggesting various workarounds:

DLL hell?

Addendum – Updated ILMerge Link

As noted by Micah Gray in his comment below:

The ILMerge link above no longer works. It appears to have moved over to the GitHub ILMerge repository.