Try our conversational search powered by Generative AI!

Exception from FormsExtensions "cannot get all types from assembly"

Vote:
 

I am seeing the following error repeated quite often in my log files in all our environments.

The first occurance I can find of this exception being logged is when we switch to Azure AD login.

-- [1] ERROR EPiServer.Forms.Helpers.Internal.FormsExtensions: cannot get all types from assembly Microsoft.IdentityModel.Protocol.Extensions, Version=1.0.40306.1554, Culture=neutral, PublicKeyToken=31bf3856ad364e35. 
System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)
at System.Reflection.Assembly.GetTypes()
at EPiServer.Forms.Helpers.Internal.FormsExtensions.GetTypesFromAssembly(Assembly assembly)
System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)
at System.Reflection.Assembly.GetTypes()
at EPiServer.Forms.Helpers.Internal.FormsExtensions.GetTypesFromAssembly(Assembly assembly)

Does anyone know if this is a problem that needs solving or that I can ignore?

The assemblyBinding is included in our web.config

<dependentAssembly>
  <assemblyIdentity name="Microsoft.IdentityModel.Protocol.Extensions" publicKeyToken="31bf3856ad364e35" culture="neutral" />
  <bindingRedirect oldVersion="0.0.0.0-1.0.40306.1554" newVersion="1.0.40306.1554" />
</dependentAssembly>

I have no idea if the error that is getting logged is related to a phenomenon we are seeing when using edit mode, but we are experiencing blank screens in edit mode, after we switched to Azure AD.

The blank screen problem occurs mostly in Chrome and can be solved by refreshing or resizing the window.

If I open the development console in Chrome, it do not see any errors.

Environment information:

  • Self hosted
  • .NET 4.7.1
  • CMS 11.11.0
  • Forms 4.21.0
  • Azure AD for authentication
#200710
Edited, Jan 23, 2019 10:29
Vote:
 

it's not about whether you have binding or not. type load exceptions might come in for various reasons. IMHO Episerver forms code should also respect settings on episerver.framework element and look for types that are excluded (it just does this `AppDomain.CurrentDomain.GetAssemblies()`).

IMHO these errors can be ignored until the moment when you see your own assembly there that contains Episerver forms components that should participate in application logic..

#200717
Jan 23, 2019 12:26
Vote:
 

Thanks for you reply, I will just ignore them for now.

#200718
Edited, Jan 23, 2019 12:51
Vote:
 

I filed a bug regarding this and hopefully Form team will fix it in future. I would recommend to reach out for developer support service for further assistance 

#200719
Jan 23, 2019 13:00
Vote:
 

thx

#200724
Jan 23, 2019 14:01
Vote:
 

Hi,

The errors can be ignored.

EPiServer.Forms basically just gets all assemblies in current domain and then get all types from each domain.

ReflectionTypeLoadException is thrown when any classes of modules can not be loaded. Because assemblies can be loaded dynamically (e.g load all assemblies in a folder) and sometimes it fails to load. Fortunately, when it fails to load, the Exception still contains the information we need.

For more infor, check out this post or StackOverFlow answer

#200741
Jan 24, 2019 2:58
Vote:
 

still IMHO forms should respect episerver assembly scanning rules and check for the assemblies that are allowed to scan. this will also help to avoid perfomrance implications that we are seeing :) we do have ~ 200 .dll in bin. hahahaa I know - there is something wrong with my bin directory.

#200750
Jan 24, 2019 8:56
Vote:
 

Yes we have rules for scanning assembly :). I'll check it again.

#200760
Edited, Jan 24, 2019 10:34
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.