Click here to Skip to main content
15,879,474 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
XML
Hi All,

i am working on one app in which i am using SQLite connectivity for my database.while connecting to my database it is giving me below error :-

"Message = "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."

I searched on web and found below two different solutions which i have added  in my code :

1. Added in  my app.config file :

  <startup useLegacyV2RuntimeActivationPolicy="true">
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
  </startup>

2. Modified project property:

"generate serialization assembly = Off"

but after doing this still i am facing same issue. Please help me out..

Thanks
Posted
Comments
venu gopal reddy manchikanti 27-Dec-13 17:53pm    
Hi,

I am also having same problem with SQLite. Did you find why it is throwing the above exception? Please send me if you have found a way around.
ZurdoDev 27-Dec-13 20:43pm    
Try http://stackoverflow.com/questions/6425707/mixed-mode-assembly-is-built-against-version-v2-0-50727-of-the-runtime
Sergey Alexandrovich Kryukov 27-Dec-13 21:04pm    
Why using assembly built to v.2.0 of the framework at all? Can't you get or build it for v.4.0?
—SA

Hi


You should replace SQLite DLL v2.0 with SQLite DLL ver 4.0 download SQLite ver 4.0 of these links:

SQLite ver 4.0 32 bit
SQLite ver 4.0 64 bit

for getting more information please look at SQLite Org.

and I suggest to you read my article maybe it can change your solution ;-)
Build Your Own Generic Data Access Layer: Part II[^]

Best Regards.
 
Share this answer
 
v2
Hi,

I found a way around this after 3-4 hours of googling. I have added the following 
<startup selegacyv2runtimeactivationpolicy="true">
  <supportedruntime version="v4.0" sku=".NETFramework,Version=v4.0,Profile=Client" />
</startup>

If this doesn't solve your problem then--> In the Project References Right Click on System.Data.SQLite--> Select Properties--> Check the Run-time Version --> If it is v2.0.50727 then we know the problem.
The Problem is:- you are having 2.0 Version of SQLite DLL.
Solution is:- You can delete the System.Data.SQLite from the Project references and then download the latest version of DLL's from the following link and add the reference of the latest version DLL reference then it will work.

http://system.data.sqlite.org/index.html/doc/trunk/www/downloads.wiki
 
Share this answer
 
v6

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900