Mixed-mode error with System.Data.SQLite

.NET obfuscator and automated error reporting

Mixed-mode error with System.Data.SQLite

Postby harmn1 » Tue Jan 31, 2012 12:35 pm

I have a project built on .NET 4 (full, not client profile) comprising three class libraries and a main application. Several of the class libraries reference System.Data.SQLite (1.0.66), which is built against .NET 2.0.50727. All the class libraries and the main program have the useV2LegacyRuntimeActivationPolicy enabled in their app.config files and everything works fine before applying SA (I'm using

I am currently not obfuscating or pruning or embedding - I just want error reporting for my internal deployment testing.

Whenever I run the postprocessed version of the assembly one of the class libraries throws the 'Mixed-mode assembly is built against 'v2.0.50727' of the runtime and cannot be loaded without additional configuration information' error. The fusion log shows that it is unable to load System.Data.SQLite.dll :

*** Assembly Binder Log Entry (31/01/2012 @ 12:31:59) ***

The operation failed.
Bind result: hr = 0x80004005. Unspecified error

Assembly manager loaded from: C:\\Windows\\Microsoft.NET\\Framework\\v4.0.30319\\clr.dll
Running under executable C:\\Users\\nickharmer\\Documents\\Visual Studio 2010\\Projects\\ILFRA\\CEASRClient\\bin\\Release\\CEASR_SA.exe
--- A detailed error log follows.

=== Pre-bind state information ===
LOG: User = OLDNICK\\nickharmer
LOG: DisplayName = System.Data.SQLite, Version=, Culture=neutral, PublicKeyToken=db937bc2d44ff139
LOG: Appbase = file:///C:/Users/nickharmer/Documents/Visual Studio 2010/Projects/ILFRA/CEASRClient/bin/Release/
LOG: Initial PrivatePath = NULL
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = CEASR_SA.exe
Calling assembly : ForensicExhibits, Version=, Culture=neutral, PublicKeyToken=443f8a80a0a83fe8.
LOG: This bind starts in default load context.
LOG: No application configuration file found.
LOG: Using host configuration file:
LOG: Using machine configuration file from C:\\Windows\\Microsoft.NET\\Framework\\v4.0.30319\\config\\machine.config.
LOG: Post-policy reference: System.Data.SQLite, Version=, Culture=neutral, PublicKeyToken=db937bc2d44ff139
LOG: GAC Lookup was unsuccessful.
LOG: Attempting download of new URL file:///C:/Users/nickharmer/Documents/Visual Studio 2010/Projects/ILFRA/CEASRClient/bin/Release/System.Data.SQLite.DLL.
LOG: Assembly download was successful. Attempting setup of file: C:\\Users\\nickharmer\\Documents\\Visual Studio 2010\\Projects\\ILFRA\\CEASRClient\\bin\\Release\\System.Data.SQLite.dll
LOG: Entering run-from-source setup phase.
LOG: Assembly Name is: System.Data.SQLite, Version=, Culture=neutral, PublicKeyToken=db937bc2d44ff139
LOG: Binding succeeds. Returns assembly from C:\\Users\\nickharmer\\Documents\\Visual Studio 2010\\Projects\\ILFRA\\CEASRClient\\bin\\Release\\System.Data.SQLite.dll.
LOG: Assembly is loaded in default load context.
ERR: Rejecting IJW module built against v2.0.50727 because it could be loaded into another runtime in this process.

Why does SA seem to be discarding my legacy runtime activation policy and how can I fix it?


Nick Harmer
Posts: 1
Joined: Tue Jan 31, 2012 12:24 pm

Postby james.davies » Wed Feb 01, 2012 2:18 pm


Please try upgrading to v6.6.
The release notes ( http://www.red-gate.com/supportcenter/Content/SmartAssembly/articles/version_6xx_SmartAssembly) explain there has been a bug fixed (where attributes were being removed during processing even with no features used).

If this bug was removing the useLegacyV2RuntimeActivationPolicy attribute then that would explain the problem.
James Davies
Technical Support Engineer
Red Gate Software
Posts: 46
Joined: Tue Apr 19, 2011 1:39 pm

Return to SmartAssembly 6

Who is online

Users browsing this forum: No registered users and 0 guests