Revit API Forum
Welcome to Autodesk’s Revit API Forums. Share your knowledge, ask questions, and explore popular Revit API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Loading different versions of same third party library?

10 REPLIES 10
SOLVED
Reply
Message 1 of 11
erikeriksson5686
1684 Views, 10 Replies

Loading different versions of same third party library?

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

Erik Eriksson
White
10 REPLIES 10
Message 2 of 11

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





Message 3 of 11

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





Message 4 of 11

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...
Erik Eriksson
White
Message 5 of 11

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

Erik Eriksson
White
Message 6 of 11

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





Message 7 of 11

Hi,

 

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

 

Thanks

Erik Eriksson
White
Message 8 of 11

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

Message 9 of 11

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

Erik Eriksson
White
Message 10 of 11
Revitalizer
in reply to: Revitalizer

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





Message 11 of 11

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. 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Rail Community