I am writing a wrapper for a library that got a drastic change in the API between one version and the other, so I need to create a contract that will allow me to access the two versions of the same API. This is my project structure:
- Client.dll
- References
- Contract.dll
- Version01.dll
- Version02.dll
- Contract.dll
- IMyService.cs
- Version01.dll
- MyServiceImplementation.cs
- References
- Version01Assembly.dll
- Version02.dll
- MyServiceImplementation.cs
- References
- Version02Assembly.dll
Inside the Project Client.dll I may need to call one implementation of the service or another one, and this is quite fine. The issue is that the assembly loaded into the AppDomain is always the Version02Assembly.dll cause in the bin folder of my Client I always find only the latest version of this dependency. How can I keep these two libraries referencing a different version of the same assembly?
I hope the question is clear