Loading different versions of same third party library?

Anonymous

Loading different versions of same third party library?

Anonymous
Not applicable

Hi,

 

I've seen that Revit only loads one instance of a third party library even though different addons reference different versions.

This can be handled if it is only your own addons so that you can control what library the addons load, but what if it is other addons that you cant control?

I've seen different versions of log4net then the one we use in addons people download and this causes problems when our (or the other addons) try to load their libraries...


Has anyone come across this problem and have a nice solution for it?

Thanks!

 

/Erik

0 Likes
Reply
Accepted solutions (1)
2,159 Views
10 Replies
Replies (10)

Revitalizer
Advisor
Advisor

Hi,

 

even worse, Autodesk itself uses third-party libs:

http://adndevblog.typepad.com/aec/2013/01/sqlite-version-conflict-with-revit-add-ins.html

 

 

Revitalizer




Rudolf Honke
Software Developer
Mensch und Maschine





0 Likes

Revitalizer
Advisor
Advisor

Hi,

 

developers could use Revit's built-in JournalData instead of log4net, but that doesn't solve existing conflicts.

Also, as far as I can see, JournalData can only be used in command or idling context, but not, for example, OnStartup.

 

 

Revitalizer




Rudolf Honke
Software Developer
Mensch und Maschine





0 Likes

Anonymous
Not applicable
Hi,
yeah. Ok so we have a real problem.
It doesnt feel like the situation with appdomains and so on is well suited for addon development (not saying its Autodesks fault).

Do you know of way to make your own addons less sensitive?
To stop enforcing a specific version for instance, and try to invoke their methods anyway?
One could hope that log4net doesnt change their base method signatures too often...
0 Likes

Anonymous
Not applicable

By the way, Revitalizer,
do you know if its SQLite that is the actual database engine for Revit?

0 Likes

Revitalizer
Advisor
Advisor

Hi,

 

no idea, I'm not an Autodesk employee.

But I think that even the people who know the answer will not reply to your question because it's a company's secret.

 

 

Revitalizer




Rudolf Honke
Software Developer
Mensch und Maschine





0 Likes

Anonymous
Not applicable

Hi,

 

ok, doesnt matter. Im just curious to know more about it.

 

Thanks

0 Likes

jeremytammik
Autodesk
Autodesk
Accepted solution

Dear Erik and Revitalizer,

 

I think this is more of a .NET issue and has very little to do with Autodesk, except that we have to suffer the DLL hell just like everybody else using the Windows and .NET platform.

 

I have no idea either what version of SQLite is used by Revit

 

In general, my motto has always been to minimise all external dependencies, or preferably elmimnate them altogether.

 

Then this issue disappears and all are happy.

 

Unfortunately not always feasible, I absoluetely realise.

 

You say:

 

> Do you know of way to make your own addons less sensitive?

 

If possible, it might help to add version numbers into the referenced DLL names.

 

> To stop enforcing a specific version for instance, and try to invoke their methods anyway?

 

You might explore the .NET framework for DLL conflict resolution functionality.

 

I believe that you can register callbacks to react on DLL version issues, and implement automatic resolution mechanisms.

 

I hope this helps.

 

Cheers,

 

Jeremy



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

Anonymous
Not applicable

Hi Jeremy,

 

Having a logging tool installed in all apps is a really good help when it comes to finding bugs in client machines.

That said, I actually came up with the same idea the other day.
I've been using the assemplyresolve event for other things previously. Im gonna give that a go.

 

Thanks!

 

/Erik

0 Likes

Revitalizer
Advisor
Advisor

Hi,

 

an addition, for completeness' sake:

 

one can indeed use Revit's journaling mechanism OnStartup and OnShutdown(UIControlledApplication application).

application.ControlledApplication.WriteJournalComment()

 

 

Revitalizer




Rudolf Honke
Software Developer
Mensch und Maschine





0 Likes

MattKincaid
Advocate
Advocate

We've spent some time researching this problem and have documented our findings at the attached URL (the forum was giving me some trouble pasting the URL directly).

 

One solution we've found is to download the source code of the third party library (assuming it is available) and do a custom build with a different dll name.  The main downside to this is it makes updating to a newer version of the third party library a more significant undertaking.