Unknown build error, 'Binary format of the specified custom attribute was invalid.'

Posts   
 
    
jerdnox
User
Posts: 1
Joined: 19-Nov-2010
# Posted on: 19-Nov-2010 09:41:05   

Hello, this is probably some microsoft vs2010/.net 4.0 bug but it occures when I'm using llbl.

If SD.LLBLGen.Pro.ORMSupportClasses.NET20 and System.Web.Extensions are refererenced in wpf application (Target framework 4.0), then project cannot by build because of following error:

    Unknown build error, 'Binary format of the specified custom attribute was invalid.'

Same error is described here: http://connect.microsoft.com/VisualStudio/feedback/details/444020/binary-format-of-the-specified-custom-attribute-was-invalid-retrieving-attributes-data-from-net-3-5-assembly-from-a-net-4-0-application

But that look like runtime error, while I get build error.

LLBL version is 2.6 (I try 3.0 trial with same result)

Steps to reproduce: 1) Create new project in vs2010 of type Wpf Application 2) Change TargetFramework in properties to .Net Framework 4.0. Default is .Net Framework 4.0 Client Profile. You cannot use .Net 4.0 Client Profile because LLBL support assemblies depend on assemblies that are not included in Client profile:

Warning 5 The referenced assembly "SD.LLBLGen.Pro.ORMSupportClasses.NET20, Version=3.0.0.0, Culture=neutral, PublicKeyToken=ca73b74ba4e3ff27, processorArchitecture=MSIL" could not be resolved because it has a dependency on "System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" which is not in the currently targeted framework ".NETFramework,Version=v4.0,Profile=Client". Please remove references to assemblies not in the targeted framework or consider retargeting your project.

3) Add reference to SD.LLBLGen.Pro.ORMSupportClasses.NET20 4) Add reference to System.Web.Extensions 5) Build

If I use just one of those assemblies project will build successfully. But if I use both, then build error occure.

Original project where this occured was originaly vs2008/.net 3.5 (no problem there) but was transformed to 2010/4.0. System.Web.Extensions was dependency for another assembly that was shared with one web project. It was changed so it is no more necessary to use System.Web.Extensions so it is no more issue for us. I'm posting it here if somebody else run to similar problem. Or if llbl gen team want to investigate why it happen when SD.LLBLGen.Pro.ORMSupportClasses.NET20 is used.

Walaa avatar
Walaa
Support Team
Posts: 14950
Joined: 21-Aug-2005
# Posted on: 19-Nov-2010 10:50:35   

Sorry, but I can't reproduce it.

I did the following:

1) Create new project in vs2010 of type Wpf Application 2) Change TargetFramework in properties to .Net Framework 4.0. 3) Add reference to System.Web.Extensions 4) Add reference to SD.LLBLGen.Pro.ORMSupportClasses.NET20 5) Build

Posts: 24
Joined: 19-Feb-2007
# Posted on: 21-Jun-2011 00:15:02   

I had this issue and had to re-create the VS2010 Startup project and transfer the files then everything worked perfect.

Must be something residule in VS2010 WPF solution or project file.

It occurred when some projects had ORMSupportClasses 2.6 and others had 3.1 it still built, but when I put everything on 3.1 the mentioned error occured preventing builds.

This was WPF project specific, all other asp.net projects had no issues.

Note: Also this project was using Telerik RadControls, Win and WPF.