Virtual Happy Hour this month, Jun 28, we'll be getting a sneak preview at our soon to launch SaaS CMS!

Try our conversational search powered by Generative AI!

Binary format of the specified custom attribute was invalid.

Vote:
 

When creating a specific custom page type I receive this error:

Binary format of the specified custom attribute was invalid.

 

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.Reflection.CustomAttributeFormatException: Binary format of the specified custom attribute was invalid.

Source Error: 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.


Stack Trace: 

[CustomAttributeFormatException: Binary format of the specified custom attribute was invalid.]
   System.Reflection.CustomAttributeEncodedArgument.ParseAttributeArguments(IntPtr pCa, Int32 cCa, CustomAttributeCtorParameter[]& CustomAttributeCtorParameters, CustomAttributeNamedParameter[]& CustomAttributeTypedArgument, IntPtr assembly) +0
   System.Reflection.CustomAttributeEncodedArgument.ParseAttributeArguments(ConstArray attributeBlob, CustomAttributeCtorParameter[]& customAttributeCtorParameters, CustomAttributeNamedParameter[]& customAttributeNamedParameters, Module customAttributeModule) +212
   System.Reflection.CustomAttributeData..ctor(Module scope, CustomAttributeRecord caRecord) +722
   System.Reflection.CustomAttributeData.GetCustomAttributes(Module module, Int32 tkTarget) +182
   System.Reflection.CustomAttributeData.GetCustomAttributes(MemberInfo target) +69
   Castle.DynamicProxy.<GetNonInheritableAttributes>d__0.MoveNext() +114
   Castle.DynamicProxy.Generators.MetaProperty.BuildPropertyEmitter(ClassEmitter classEmitter) +245
   Castle.DynamicProxy.Contributors.CompositeTypeContributor.ImplementProperty(ClassEmitter emitter, MetaProperty property, ProxyGenerationOptions options) +42
   Castle.DynamicProxy.Contributors.CompositeTypeContributor.Generate(ClassEmitter class, ProxyGenerationOptions options) +342
   Castle.DynamicProxy.Generators.ClassProxyGenerator.GenerateType(String name, Type[] interfaces, INamingScope namingScope) +680
   Castle.DynamicProxy.Generators.BaseProxyGenerator.ObtainProxyType(CacheKey cacheKey, Func`3 factory) +718
   Castle.DynamicProxy.ProxyGenerator.CreateClassProxy(Type classToProxy, Type[] additionalInterfacesToProxy, ProxyGenerationOptions options, Object[] constructorArguments, IInterceptor[] interceptors) +141
   PageTypeBuilder.Activation.TypedPageActivator.CreateInstance(Type typedType, Object[] ctorArguments) +75
   PageTypeBuilder.Activation.TypedPageActivator.CreateAndPopulateTypedInstance(PageData originalPage, Type typedType) +18
   PageTypeBuilder.PageTypeResolver.ConvertToTyped(PageData page) +61
   PageTypeBuilder.Initializer.DataFactory_LoadedPage(Object sender, PageEventArgs e) +41
   EPiServer.Core.PageStoreBase.RaisePageEvent(Object key, PageEventArgs eventArgs) +77
   EPiServer.DataFactory.GetDefaultPageData(PageReference parentPageLink, Int32 pageTypeID, ILanguageSelector selector) +200
   EPiServer.UI.Edit.EditPanel.CreateNewPageData() +281
   EPiServer.UI.Edit.EditPanel.GetCurrentPage() +49
   EPiServer.UI.Edit.EditPanel.get_CurrentPage() +32
   EPiServer.UI.Edit.XFormPostings.GetCurrentPage() +46
   EPiServer.UI.Edit.XFormPostings.PageContainsFormProperties() +20
   EPiServer.UI.Edit.XFormPostings.List() +10
   EPiServer.PlugIn.AssemblyTypeInfo.UseCustomLoader(Type type, PlugInAttribute matchAttribute, ArrayList list) +115

[PlugInException: A error occured while calling ICustomPlugInLoader.List from "EPiServer.UI.Edit.XFormPostings": Binary format of the specified custom attribute was invalid.]
   EPiServer.PlugIn.AssemblyTypeInfo.UseCustomLoader(Type type, PlugInAttribute matchAttribute, ArrayList list) +528
   EPiServer.PlugIn.AssemblyTypeInfo.ListPlugInDescriptorsForSort(PlugInAttribute matchAttribute, ArrayList list) +255
   EPiServer.PlugIn.PlugInLocator.Search(PlugInAttribute matchAttribute) +180
   EPiServer.UI.WebControls.TabStrip.LoadPlugIns() +109
   EPiServer.UI.WebControls.TabStrip.OnInit(EventArgs e) +48
   System.Web.UI.Control.InitRecursive(Control namingContainer) +143
   System.Web.UI.Control.InitRecursive(Control namingContainer) +391
   System.Web.UI.Control.InitRecursive(Control namingContainer) +391
   System.Web.UI.Control.InitRecursive(Control namingContainer) +391
   System.Web.UI.Control.InitRecursive(Control namingContainer) +391
   System.Web.UI.Control.InitRecursive(Control namingContainer) +391
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1477

 

I have no clue to what's causing this issue.

#51263
May 31, 2011 5:58
Vote:
 

I could do a line by line deletion of the cs file for debugging purposes but it might take a long time. Is there an efficient way to troubleshoot this error?

#51264
May 31, 2011 6:03
Vote:
 

For what it's worth, this is the closest thing I got: http://etf.codeplex.com/workitem/30520

"It is a problem related to the EPiServer.dll version that the PageType is compiled with. It seems like it has to be the same as the running version."

I got this project from an older version EPiServer Project and now I'm using it with the latest EPiServer release. The funny thing is, other page types built on that same project is perfectly working.

#51265
May 31, 2011 6:08
Vote:
 

Have you downloaded the latest PageTypeBuilder and tried?

#51269
May 31, 2011 9:33
Vote:
 

I'm using PageTypeBuilder 1.3. I think the latest is 1.3.1 but I'm not sure if upgrading will fix my problem because that same error exists in 1.3.1 http://pagetypebuilder.codeplex.com/workitem/8277

#51294
Jun 01, 2011 1:38
Vote:
 

I updated all the referenced EPiServer DLLs of the project to the same referenced DLLs of the site. The problem was fixed.

#51295
Jun 01, 2011 3:05
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.