Archive

You are currently browsing the archives for the Secret Project 2 category.

May

22

Enterprise Library error: Binary format of the specified custom attribute was invalid fix for Visual Studio 2010

By pcurd

I’ve just started to work on a project and I am using the Enterprise Library 4.1 (http://msdn.microsoft.com/en-gb/library/cc467894.aspx) , download at (http://www.microsoft.com/downloads/details.aspx?FamilyId=1643758B-2986-47F7-B529-3E41584B6CE5&displaylang=en) in Visual Studio 2010 Beta 1.

I kept running into a really annoying problem, an error using DatabaseFactory.Create():

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

and

build key Build Key[Microsoft.Practices.EnterpriseLibrary.Data.Database, null]) failed: Binary format of the specified custom attribute was invalid.

Turns out that Enterprise Library 4.1 doesn’t support .Net Framework 4.0 (http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=444020) so I changed the Project Preferences to use .Net 3.5 and it worked perfectly.