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 184.108.40.206).
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=220.127.116.11, 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=18.104.22.168, 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=22.214.171.124, 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=126.96.36.199, 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?