Error: Binary format of the specified custom attribute was invalid.

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
 
S

Steven Cheng[MSFT]

Hello Eric,

For the error you encountered, based on the callstack, it is raised from
the internal framework core code, and as you mentioned that the problem
only occurs on a particular customer environment, I think it is likely the
..net framework environment has been corrupted. Generally, for such
problems, what we can first check is always the problem environment, check
all the latest operating sysetm and .net framework service packs. If still
not work, may consider repari or reinstall some of the components or the
OS. BTW, for some existing or known issue, you can also directly search
error info in the knowledge base:

http://support.microsoft.com

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


This posting is provided "AS IS" with no warranties, and confers no rights.
 
E

Eric Renken

A repair of the .NET framework took care of the problem. I did check
Windows Update and the only update they had available was .NET 3.0

Thanks for the information.

Eric Renken
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top