Muhammad Atif Agha
Muhammad Atif Agha

Reputation: 1545

Mixed mode assembly error in windows forms application when installing on remote computer with installer

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.

Upvotes: 0

Views: 596

Answers (1)

Muhammad Atif Agha
Muhammad Atif Agha

Reputation: 1545

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

Upvotes: 0

Related Questions