0
votes

i am connecting my windows forms c# .net 4 application with SQlite, as i want to install my application remotly on machines, and dont wana install sql server on every machine, when i execute it gives the 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.

I have seen its solution, < startup useLegacyV2RuntimeActivationPolicy="true" > < supportedRuntime version="v4.0" / >
< /startup > to write in app.config,

but it works fine only in Visual Studio, if i make its setup windows installer and execute on machine, it gives the same error of mixed mode assembly, as it cant find app.config in installed app, then i wrote this in build events to copy app.config on remote location, it copies, but error still occurs. Please solve my issue, or if you know any other db which can be work independently without installation, don't give ms access suggestion, it does not work.

1
Well, doesn't make a lot of sense. But why not just use the .NET 4 compatible build of sqllite so this is not necessary? system.data.sqlite.org/index.html/doc/trunk/www/downloads.wiki - Hans Passant
is it because i am using sqlite for .net2? - Muhammad Atif Agha
i really dont know which .net version of this sqlite is... - Muhammad Atif Agha
It gives the .NET version in the error message :) - Hans Passant
Yes i am seeing the following link you mentioned, you can post this as an answer, so i can rate you if this will work. - Muhammad Atif Agha

1 Answers

0
votes

This error can be resloved by installing sqlite of .Net framework 4, it started giving other exceptions, then i made all dll references to copy local, and then i did execute, it worked. But my advice to all portable dbs developers, to use portable db with application, always use SQL Server Compact, because it is the product of Microsoft and well works with .Net, in case of Sqlite we would require to install runtime for SQLite.
Thanks
Atif