Click here to Skip to main content
15,896,726 members
Please Sign up or sign in to vote.
4.00/5 (2 votes)
See more:
I should know this, but have just got myself very confused. Situation:

I have a project which references two external assemblies, A and B, both version 1. Then I receive a new version of A (v2) which has taken advantage of a new version of B (v2). Unfortunately, the markers of B have not made v2 backward compatible with v1, and my project expects v1.

So my project wants B v.1 but uses A v.2 which wants b v.2. There are no strong names. What are my options?
Posted
Comments
Rob Philpott 29-Jul-11 11:49am    
(Suppose one very good option bearing the day and time in mind is to forget about this until Monday and go and drink some Belgian finest...)

I found this[^] to be an interesting read. Should give you an alternate way of using two versions of the same dll.
 
Share this answer
 
I'm not sure if this will work for unsigned assemblies, never had the need to try it http://msdn.microsoft.com/en-us/library/eftw1fys.aspx[^]

If it doesn't work you may want to look into singing the assemblies
http://msdn.microsoft.com/en-us/library/xc31ft41.aspx[^]
 
Share this answer
 
Comments
Rob Philpott 29-Jul-11 12:23pm    
I think that's only for strong named assemblies, which they aren't. And I'm pretty sure you can't do side-by-side without strong names in which case my luck has run out. Thanks for you response!
Your application should typically use it private version of each DLL (except maybe for those that are installed in the GAC).

Thus your application would uses v1 of each assembly since you ship them with your executable.

Since both A and B have new versions (v2), then if you want to use A v.2., you should upgrade tour project to also uses B v.2 which will avoid the problem, reduce the number of DLLs (thus the memory usage and load time).

By the way, I think this is a lot hypothetical... as generally each maker would only depends on itself (and the .NET framework).

Most of the time both version should be compatible or only a few adjustment would be required.
 
Share this answer
 
Comments
[no name] 30-Jul-11 8:29am    
This did nothing to answer the question that was asked.
Philippe Mori 30-Jul-11 9:42am    
Well maybe... But I neverless think that this alternative is preferable.

If we do think that the original poster should not do what he ask for, then I think it is legitimate to provide a solution that suggest to not do it and explain why.

Since A want to use the new version of B, the best thing to do is to also use the new version of B from the application.

If the maker of A was able to upgrade it product to use the new version of B, then the maker of the application, if he is somehow competent, should probably be able to do so himself.

Often making an effort to upgrade our code (if necessary) would make more sense than to blindly want to stay with the obsolete version of A.

It will also be as hard to prove that a solution with 2 versions has less problem that an updated application.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900