I have a project in which I'd like to use some of the .NET 4.0 features but a core requirement is that I can use the System.Data.SQLite framework which is compiled against 2.X. I see mention of this being possible such as the accepted answer here but I don't see how to actually achieve this.
When I just try and run my 4.0 project while referencing the 2.X assembly I get:
Mixed mode assembly is built against version 'v2.0.50727' of the runtime and cannot be loaded in the 4.0 runtime without additional configuration information.
What "additional configuration" is necessary?
SGEN
, then the fix needs to be in a filesgen.exe.config
, next tosgen.exe
. For example, for VS 2015, createC:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6 Tools\sgen.exe.config
. Source: SGEN Mixed mode assembly Minimum file contents:<configuration><startup useLegacyV2RuntimeActivationPolicy="true"/></configuration>