Umbraco "composing type loader" causes startup cra...
# help-with-umbraco
k
We're using a third-party package (NuGet) that works fine in normal web apps. But when referencing this (directly or indirectly) from Umbraco, it causes a crash on startup in
Umbraco.Cms.Core.Composing.FindAssembliesWithReferencesTo.Find()
The error is > Could not load file or assembly 'Xbim.Geometry.Engine32, Version=0.0.0.0, Culture=neutral, PublicKeyToken=11e3655e576ec5a9'. The system cannot find the file specified. It looks like Umbraco is trying to load too many assemblies to find composers/etc and this one fails. It may be that the package is doing something wrong, but it works in non-Umbraco web apps and console applications. Looks like a "loading DLL with wrong bitness" problem. Anyone have any idea how to resolve this? We're not using the latest version of the third-party package so we can't submit an issue. And they would probably not act since it works outside Umbraco. Is there a way to not have Umbraco load all assemblies on startup?
k
How do I actually add to this list?
.AddComposers
doesn't have any configuration options. Not sure how to actually reach that
Exclude
method.
Should I replace an existing Umbraco service to do this? Which service would that be?
m
Id try the last one
k
It works. Thanks!
Can you explain what "assemblies that accept load exceptions when they are type scanned" means? In which way does the assembly accept or not accept that?
j
When Umbraco scans for types it dynamically loads all the DLLs it finds in the bin directory. Yes, that's a bit mad - perhaps my least favourite thing Umbraco does, because: It may be that there are DLLs in the bin directory that, for whatever reason, can't be loaded - wrong bitness, unmet dependencies, libraries making use of dynamic loading etc. Hence the ability to exclude them from being typescanned using the
AdditionalAssemblyExclusionEntries
setting.
Say you have an assembly that throws on load (i.e. it executes some failing code) but still includes types that you want the type scanner to surface - the
AssembliesAcceptingLoadExceptions
option tells Umbraco to swallow the exceptions for those assemblies.
2 Views