Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Different versions of Enterprise Library in one process

We are developing an add-in for Autodesk Inventor. Our software is a bunch of dll assemblies loaded into Inventor at runtime. We have decided to use the Microsoft Enterprise Library 5.0 for logging and exception handling.

Now we have a problem, because it turns out Inventor 2013 uses Enterprise Library 4.1. When our add-in is loading, it fails to load the proper version of an assembly, because Inventor already has an older version in its Bin directory.

Options we have considered so far:

  1. During deployment of our product, overwrite the old libraries in Inventor's Bin folder
  2. Use EL 4.1 in our assemblies

Both are bad and I'm running out of ideas, so I'm asking for help.

Option 1 raises this question: is the Enterprise Library backwards compatible and will replacing those DLL's in the Bin folder cause problems? I have tried it, Inventor doesn't complain and works as expected (haven't checked the EL functionality).

Option 2 makes us use the older version and binds us to the version Autodesk is using, so we would have to watch when they upgrade, especially when they release a new version of Inventor.

What is the best practice in this scenario?

UPDATE:
We solved this by just putting the newer version of Enterprise Library in GAC. I think what happened here was that .NET tried loading the older version first (because it was higher in assembly search order) and after failing never went any further to look for the proper version. When in GAC, it correctly resolves.

like image 754
jur Avatar asked Nov 13 '12 12:11

jur


People also ask

Is Microsoft Enterprise Library still relevant?

This project is no longer under development. Unity has new ownership and has relocated to GitHub. The remainder of the application blocks will no longer be developed.

What is the use of Microsoft Enterprise Library?

Microsoft Enterprise Library is a collection of reusable application blocks designed to assist software developers with common enterprise development challenges.

What is enterprise library in C#?

The Microsoft Enterprise Library is a set of tools and programming libraries for the Microsoft . NET Framework. It provides APIs to facilitate proven practices in core areas of programming including data access, logging, exception handling and others.

What is Enterprise Library logging?

The Microsoft Enterprise Library is a collection of reusable software components (application blocks) designed to assist software developers with common enterprise development cross-cutting concerns, such as logging, validation, data access, exception handling, and many others.


1 Answers

From what I can see, a reasonable solution would be to embed the assemblies and access them using the ResourceManager class, this would allow you to use the newer versions whilst maintaining the parent projects logging mechanism.

You might find this question useful: Embedding assemblies inside another assembly

like image 124
talegna Avatar answered Sep 30 '22 15:09

talegna