Showing posts with label Mixed Mode Assembly Sqlite Error. Show all posts
Showing posts with label Mixed Mode Assembly Sqlite Error. Show all posts

Sunday 3 August 2014

Mixed mode assembly is built against version 'v2.0.50727' of the runtime


Error :- 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

Error Explanation -
During using Sqlite Database with Csharp Applications you may suffer from this error Don't fear from it this is simple error

This problem is seen often . The main reasonof this problems  is that, because of the support for side-by-side runtimes in .Net Technology , .NET framework 4.0 has changed its way of binding  to older framework mixed-mode assemblies. These assemblies are those that are compiled from old  C++\CLI. Currently available DirectX assemblies are mixed mode. If you see a message like this then you know you have run into the issue:

Mixed mode assembly is built against version 'v1.1.4322' of the runtime and cannot be loaded in the 4.0 runtime without additional configuration information.

SOLUTION :
Add the Following code in App.config file . App.config file will be available in Solution Explorer . If App.config is not available then you can add it by :-

  1. Right click on Project's folder in Solution Explorer 
  2. Click on Add then click on New
  3. Now scroll and find Application Configuration file and Click ok
  4. Now App.config will be successfully added .
  5. Now make the code of your App.config file similar to the following code or the replace the <startup> tag with tag given below

    <startup useLegacyV2RuntimeActivationPolicy="true">
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
     <requiredRuntime version="v4.0.20506" />
    </startup>
  6. Now All errors Will be gone and continue your code with SQlite Csharp using link below :-

    How To Use Sqlite Database With Csharp