开发者

.NET compiled third-party DLL reference conflict

开发者 https://www.devze.com 2023-01-17 23:52 出处:网络
I am using Umbra开发者_JAVA技巧co (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

I am using Umbra开发者_JAVA技巧co (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 


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消