Developer forum

Forum » Development » DLL Hell - Improve error message

DLL Hell - Improve error message

Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

Hi there,

When working with custom components, we very regularly run into the error shown in the attached picture. Something is broken, but what? Our solution to find that out is to take out all custom assemblies, and add them back 1 by 1 untuil it break. Then when we found the one that broke it, we look at its dependencies and then ensure we bring in the correct versions of those (often it's because Newtonsoft has been downgraded to 8). Obviously, this is pretty time consuming.

is there any chance the above error message can be improved by walking the tree of LoaderExceptions and add those to the final error message? That would make troubleshooting this *a lot* easier.

Thanks!

Image_786.png

Replies

 
Anders Ebdrup
Anders Ebdrup
Reply

I totally agree! Everytime we have this issue we need to debug this method in ServiceLocator.cs

public virtual IEnumerable<object> GetAllInstances(Type serviceType)
        {
            try
            {
                return DoGetAllInstances(serviceType);
            }
            catch (Exception ex)
            {
                throw new ActivationException(
                    FormatActivateAllExceptionMessage(ex, serviceType),
                    ex);
            }
        }

It will be a great help to have the list of loaderexceptions added to the ActivationException.

 

Best regards, Anders

 

 
Martin Vang
Martin Vang
Reply
This post has been marked as an answer

Hi guys,

That is indeed annoying, so I fixed it right away. If you can just give me a project that makes the testing of this bug easy for qa, we can have the fix ready for you for the next hotfix.

Feature 57629: Improve logging of ServiceLocator framework

I've already fixed what I think is needed, but I need the failing code to explain to QA how to test that the error-message changes in the correct way. Please post a zip or something. :)

BR

Martin

Votes for this answer: 1
 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

Hi Martin,

See attached. This is a DLL that comes with a third party we ship some of our sites with. It has some references to other DLLs. When you drop this DLL into the Bin, the site breaks (Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.), but it gives you no clue as to which DLL or its dependencies is causing the issue.

Let me know if this helps!

 
Martin Vang
Martin Vang
Reply
This post has been marked as an answer

Hi Imar (and Anders),

Extensibility 3.2.6 now shows the correct FullName from the loader-exceptions. Let me know if you have more requests of this kind.

Will be part of next 9.5 hotfix.

BR

Martin

Votes for this answer: 1

 

You must be logged in to post in the forum