ServiceStack/ServiceStack.OrmLite — Issue #32: OrmLite.Sqlite  FileLoadException  dotNet 4 
Author: Developerius
Created: 2012-03-06 06:58:20+00:00
State: open

Throw on startup.
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.

Code:
using System;
using ServiceStack.OrmLite;
using ServiceStack.OrmLite.Sqlite;

namespace SqliteTest
{
public class Session
{
public Guid Id { get; set; }

public string Name;
public DateTime CloseTime;
public bool State;
}

class Program
{
static void Main(string[] args)
{
var s = new System.Data.SQLite.SQLiteConnectionStringBuilder();
s.DataSource = @"d:\test\ormlite.test.db";
var dbFactory = new OrmLiteConnectionFactory(s.ConnectionString, SqliteOrmLiteDialectProvider.Instance);

var con = dbFactory.OpenDbConnection();
var com = con.CreateCommand();

com.CreateTable(false);

var l = com.Select();

var ses = new Session()
{
LifeTime = DateTime.Now,
Name = "aAbir",
State = true
};
com.Insert(ses);
}
}
}