E
Eric Renken
I have a Windows .NET 2.0 application that has been working fine for last
year, and now all of a sudden on one customers computer I am getting this
error, "Binary format of the specified custom attribute was invalid."
Here is a stack trace of the error:
at System.Reflection.CustomAttribute._CreateCaObject(Void* pModule, Void*
pCtor, Byte** ppBlob, Byte* pEndBlob, Int32* pcNamedArgs)
at System.Reflection.CustomAttribute.CreateCaObject(Module module,
RuntimeMethodHandle ctor, IntPtr& blob, IntPtr blobEnd, Int32& namedArgs)
at System.Reflection.CustomAttribute.GetCustomAttributes(Module
decoratedModule, Int32 decoratedMetadataToken, Int32 pcaCount, RuntimeType
attributeFilterType, Boolean mustBeInheritable, IList derivedAttributes)
at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeType
type, RuntimeType caType, Boolean inherit)
at System.RuntimeType.GetCustomAttributes(Type attributeType, Boolean
inherit)
at
System.ComponentModel.ReflectTypeDescriptionProvider.ReflectGetAttributes(Type
type)
at
System.ComponentModel.ReflectTypeDescriptionProvider.ReflectedTypeData.GetAttributes()
at
System.ComponentModel.TypeDescriptor.TypeDescriptionNode.DefaultTypeDescriptor.System.ComponentModel.ICustomTypeDescriptor.GetAttributes()
at System.ComponentModel.TypeDescriptor.GetAttributes(Object component,
Boolean noCustomTypeDesc)
at System.ComponentModel.TypeDescriptor.GetAttributes(Object component)
at System.Windows.Forms.Binding.CheckBinding()
at System.Windows.Forms.Binding.SetBindableComponent(IBindableComponent
value)
at System.Windows.Forms.ControlBindingsCollection.AddCore(Binding
dataBinding)
at System.Windows.Forms.ControlBindingsCollection.Add(String
propertyName, Object dataSource, String dataMember, Boolean
formattingEnabled, DataSourceUpdateMode updateMode, Object nullValue, String
formatString, IFormatProvider formatInfo)
at System.Windows.Forms.ControlBindingsCollection.Add(String
propertyName, Object dataSource, String dataMember)
The error seems to be happening when I am binding one of the properties from
my object to a text box. I am not able to reproduce the issue on my
computer. I deleted all of my files and put in place known working files
and it still failed.
We actually just got this working on the customers computer as I type this,
so I thought other people might like to know. The problem appears to have
been a corruption in the .NET 2.0 framework on that computer. We did a
repair of the 2.0 framework and installed .NET 3.0 and after a reboot the
program started working again. Not sure how the corruption happened, but my
program works again so the customer is happy and I am happy.
Eric Renken
year, and now all of a sudden on one customers computer I am getting this
error, "Binary format of the specified custom attribute was invalid."
Here is a stack trace of the error:
at System.Reflection.CustomAttribute._CreateCaObject(Void* pModule, Void*
pCtor, Byte** ppBlob, Byte* pEndBlob, Int32* pcNamedArgs)
at System.Reflection.CustomAttribute.CreateCaObject(Module module,
RuntimeMethodHandle ctor, IntPtr& blob, IntPtr blobEnd, Int32& namedArgs)
at System.Reflection.CustomAttribute.GetCustomAttributes(Module
decoratedModule, Int32 decoratedMetadataToken, Int32 pcaCount, RuntimeType
attributeFilterType, Boolean mustBeInheritable, IList derivedAttributes)
at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeType
type, RuntimeType caType, Boolean inherit)
at System.RuntimeType.GetCustomAttributes(Type attributeType, Boolean
inherit)
at
System.ComponentModel.ReflectTypeDescriptionProvider.ReflectGetAttributes(Type
type)
at
System.ComponentModel.ReflectTypeDescriptionProvider.ReflectedTypeData.GetAttributes()
at
System.ComponentModel.TypeDescriptor.TypeDescriptionNode.DefaultTypeDescriptor.System.ComponentModel.ICustomTypeDescriptor.GetAttributes()
at System.ComponentModel.TypeDescriptor.GetAttributes(Object component,
Boolean noCustomTypeDesc)
at System.ComponentModel.TypeDescriptor.GetAttributes(Object component)
at System.Windows.Forms.Binding.CheckBinding()
at System.Windows.Forms.Binding.SetBindableComponent(IBindableComponent
value)
at System.Windows.Forms.ControlBindingsCollection.AddCore(Binding
dataBinding)
at System.Windows.Forms.ControlBindingsCollection.Add(String
propertyName, Object dataSource, String dataMember, Boolean
formattingEnabled, DataSourceUpdateMode updateMode, Object nullValue, String
formatString, IFormatProvider formatInfo)
at System.Windows.Forms.ControlBindingsCollection.Add(String
propertyName, Object dataSource, String dataMember)
The error seems to be happening when I am binding one of the properties from
my object to a text box. I am not able to reproduce the issue on my
computer. I deleted all of my files and put in place known working files
and it still failed.
We actually just got this working on the customers computer as I type this,
so I thought other people might like to know. The problem appears to have
been a corruption in the .NET 2.0 framework on that computer. We did a
repair of the 2.0 framework and installed .NET 3.0 and after a reboot the
program started working again. Not sure how the corruption happened, but my
program works again so the customer is happy and I am happy.
Eric Renken