External assembly reference best practise

Topics: Writing modules
Dec 4, 2012 at 12:35 PM

It seems that a modules referenced/external assemblies are copied from the modules bin folder to the the app_data/dependencies folder. If I do a update to a module and this module has a reference to a newer version of the external assembly, it seems not like the newer version is copied to the dependencies folder?

I'm writing several modules that all reference the same external assembly/library. The modules are installed on many Orchard installastions. As the developement goes forward the external assembly and the modules will be updated and changed. 

Case: I do a update to one of the modules and it requires the newest version of the external library. 

Question 1: How can I ensure that the updated module will find its required version of the external library.

Question 2: The newest version of the external assembly will have breaking changes witch makes it unusable for the other (older) modules. How can I ensure that the older modules will still find their requiered reference to the older version of the external assembly.

Dec 5, 2012 at 5:51 AM

Add a lib directory to your module, copy the dependency in there and reference that.

As for question 2, just don't. You'll have to update all modules to use the same version of the dependency. Breaking changes in themselves are bad, but in a composite application like Orchard, they are a complete no-go.