2

I am using Umbraco (a .NET CMS), and it has a reference to a specific version of a DLL (see 1 Umbraco Reference below). This is fine until I try to hook into the .NET MailChimp API which references a different vesion of the same DLL (see 2 PerceptiveMCAPI below).

I can think of a couple of options for resolving this

a. Get either the Umbraco or PerceptiveMCAPI source and reference the same version of the DLL, really do not want to do this for compatibility reasons

b. Dump the 2 DLLs in the GAC, I want to avoid this as I see deployment issues arising if someone forgets (I know we should have an automated deployment but time is restricted)

I remember that there is a third option to specify what version of the DLL to use in the configuration. Is this possible and what is the code for it?

1 Umbraco Reference

// Assembly Reference CookComputing.XmlRpcV2

Version: 2.4.0.0 
Name: CookComputing.XmlRpcV2, Version=2.4.0.0, Culture=neutral, PublicKeyToken=a7d6e17aa302004d 

2 PerceptiveMCAPI

// Assembly PerceptiveMCAPI, Version 1.2.4.3


Location: C:\Work\AEGPL\AEGPL_Website\bin\PerceptiveMCAPI.dll 
Name: PerceptiveMCAPI, Version=1.2.4.3, Culture=neutral, PublicKeyToken=null 
Type: Library 
Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Burt
  • 7,680
  • 18
  • 71
  • 127
  • Please notice that the third option will only work if there are no breaking changes between the two versions, i.e, if both Umbraco and PerceptiveMCAPI work with the same version without issue. – R. Martinho Fernandes Sep 27 '10 at 16:46
  • I'm not entirely sure it would work, but a fourth option could be to use ILMerge and merge each library with the version it requires, this way getting rid of the references altogether. – R. Martinho Fernandes Sep 27 '10 at 16:49

1 Answers1

2

This is exactly the reason the GAC exists. The only other workaround I can think of is to stuff these DLLs in subdirectories so the CLR cannot find them and implement AppDomain.AssemblyResolve. You now get to maintain that code for every new version update.

Hans Passant
  • 922,412
  • 146
  • 1,693
  • 2,536
  • Like I mentioned the GAC could be problematic when it comes to deployment. We typically XCopy folders for deployment and if a DLL doesn't exist in the bin it could easily get forgotten. The solution I am working on I would ultimately like it to work in a shared hosting environemnt and the GAC is off limits in this situation. – Burt Sep 27 '10 at 19:16