Try our conversational search powered by Generative AI!

Errors logged from Forms after latest update


After the latest update, I see these two errors appearing in the logs.

Failed to eager compile type EPiServer.Forms.Implementation.Elements.ChoiceElementBlock

Failed to eager compile type EPiServer.Forms.Implementation.Elements.SelectionElementBlock

Aug 20, 2020 10:19

same here

Aug 28, 2020 6:11

Me as well

Aug 28, 2020 6:31



EPiServer.CMS.AspNet.11.17.0 -> EPiServer.CMS.AspNet.11.18.0
EPiServer.CMS.Core.11.17.0 -> EPiServer.CMS.Core.11.18.0
EPiServer.Framework.11.17.0 -> EPiServer.Framework.11.18.0
EPiServer.Framework.AspNet.11.17.0 -> EPiServer.Framework.AspNet.11.18.0

2020-08-28 08:38:59,014 [14] ERROR EPiServer.DataAbstraction.RuntimeModel.Internal.ContentTypeModelScanner: Failed to eager compile type EPiServer.Forms.Implementation.Elements.ChoiceElementBlock
System.InvalidOperationException: Calling convention must be VarArgs.

Aug 28, 2020 7:43

I have the same problem.

Failed to eager compile type EPiServer.Forms.Implementation.Elements.ChoiceElementBlock
System.InvalidOperationException: Calling convention must be VarArgs.

Does anyone know the cause or even better a solution?

Oct 06, 2020 8:25

This had to do with the 11.18.0 release for me, see this post by Magnus

Oct 06, 2020 8:58
Valina Eckley - Oct 22, 2020 16:53
We skipped over 11.18 and are now at 11.20, and just noticed this issue. So it is still there, and it caused a few errors across our site.

I have this Error as well and as Jeroen mentioned , it has something to do with 11.18.0. 

at System.Reflection.Emit.ModuleBuilder.GetMemberRefToken(MethodBase method, IEnumerable`1 optionalParameterTypes)
at System.Reflection.Emit.ModuleBuilder.GetMethodTokenInternal(MethodBase method, IEnumerable`1 optionalParameterTypes, Boolean useMethodDef)
at System.Reflection.Emit.ILGenerator.EmitCall(OpCode opcode, MethodInfo methodInfo, Type[] optionalParameterTypes)
at EPiServer.DataAbstraction.RuntimeModel.Internal.ContentModelILCompiler.GenerateMakeReadonly(IEnumerable`1 properties, MethodInfo baseMethod, MethodBuilder overriddenMethod)
at EPiServer.DataAbstraction.RuntimeModel.Internal.ContentModelILCompiler.OverrideMakeReadOnly(Type contentType, TypeBuilder typeBuilder, IEnumerable`1 propertiesToOverride)
at EPiServer.DataAbstraction.RuntimeModel.Internal.ContentModelILCompiler.GenerateType(Type contentType)
at EPiServer.DataAbstraction.RuntimeModel.Internal.ContentModelILCompiler.<GetOrGenerate>b__21_0(Type type)
at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory)
at EPiServer.DataAbstraction.RuntimeModel.Internal.IlGeneratedContentDataActivator.Create(Type contentDataType)
at EPiServer.DataAbstraction.RuntimeModel.Internal.ContentTypeModelScanner.<>c__DisplayClass27_0.<EagerCompileProxies>b__2()
System.InvalidOperationException: Calling convention must be VarArgs.

The error goes away when I add below in my web.config 

<add key="episerver:setoption:EPiServer.Core.ContentOptions.ProxyType,EPiServer" value="Castle" />

I have reached out to  episerver dev support about this error and so far they havent been able to replicate the issue 

Oct 07, 2020 5:49
Mukesh Dubey - Oct 22, 2020 22:54
Epi Support says IL models will throw an exception if a property is declared on a generic class. For Forms, ChoiceElementBlock inherit SelectionElementBlockBase

A fix has been released for this issue    CMS-16988

Oct 30, 2020 2:22

Can confirm it worked for me upgrading to latest CMS version :)

Oct 30, 2020 14:03
* 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.