单声道sqlite,没有在Windows上的单声道吗? [英] mono sqlite w/o mono on windows?

查看:114
本文介绍了单声道sqlite,没有在Windows上的单声道吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

曾几何时,我问是否有一种方法可以在Windows/Linux上使用不带两个二进制文件的sqlite数据库.有人建议使用mono,我问Windows上的.NET是否需要进行mono安装,并被告知否.

Once upon a time i asked if there was a way to use a sqlite db on windows/linux w/o two binaries. Someone suggested using mono and i asked if .NET on windows requires a mono install and was told no.

我从Linux虚拟机中获取了此参考文件

I grabbed this reference file from my linux vm

mono\gac\Mono.Data.Sqlite\2.0.0.0__0738eb9f132ed756\Mono.Data.Sqlite.dll

然后我在main()中写了这两行

Then i wrote these two lines in my main()

var connection = new Mono.Data.Sqlite.SqliteConnection("Data Source=test.db3");
connection.Open();

我得到这个例外

System.TypeInitializationException was unhandled
  Message=The type initializer for 'Mono.Data.Sqlite.SqliteConvert' threw an exception.
  Source=Mono.Data.Sqlite
  TypeName=Mono.Data.Sqlite.SqliteConvert
  StackTrace:
       at Mono.Data.Sqlite.SqliteConvert.Split(String source, Char separator)
       at Mono.Data.Sqlite.SqliteConnection.ParseConnectionString(String connectionString)
       at Mono.Data.Sqlite.SqliteConnection.Open()
       at rsa_test.Program.Main(String[] args) in Program.cs:line 56
  InnerException: System.ArgumentException
       Message=Value does not fall within the expected range.
       Source=mscorlib
       StackTrace:
            at System.Runtime.CompilerServices.RuntimeHelpers.InitializeArray(Array array, RuntimeFieldHandle fldHandle)
            at Mono.Data.Sqlite.SqliteConvert..cctor()
       InnerException: 

因此无法使用不安装Mono的Mono sqlite吗?还是我做错了什么?

So is it not possible to use mono sqlite w/o mono being installed? or did i do something wrong?

推荐答案

不能使用.NET 4.0,必须使用.NET 3.5

You can not use .NET 4.0, you have use .NET 3.5

有一个错误: https://bugzilla.xamarin.com /show_bug.cgi?format=multiple&id=152

这篇关于单声道sqlite,没有在Windows上的单声道吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆