TlbExp.exe error:This assembly is built by a runtime newer

We are moving part of our server to .net 4.0. We already did the move to Vs2010 as a first step but did not change the target framework of any project.

As a second step I'm moving a specific part of our server to target 4.0 so we can use some of the new functionality.

I've run into a problem when calling TLBexp.exe on a Class library DLL that targets 4.0. This DLL also references a lot of DLLs that target 2.0.

I get the error: TlbExp : error TX0000: Could not load file or assembly 'file:Library.dll' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.

I am calling the TLBExp that comes with: Microsoft SDKs\Windows\v7.0A\bin\ In the command I call in the VS2010 command prompt I reference v4.0.30319 binaries (such as mscorlib.tlb)

Is running TLB on a 4.0 DLL that references 2.0 libraries allowed? If yes then any reason why I'm getting this error.

Here is the exact command call i use: "C:\Program Files\Microsoft SDKs\Windows\v7.0A\bin\tlbexp.exe" /silent /win32 /tlbreference:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\mscorlib.tlb" /tlbreference:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\System.tlb" /tlbreference:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\System.Windows.Forms.tlb" /tlbreference:"C:\Windows\system32\stdole2.tlb" C:\Dev\Library.dll

Thanks

9
задан Escristian 14 April 2011 в 20:52
поделиться