SQLite on windows and on mono?

2019-04-29 22:11发布

After reading the question How can I conditionally compile my C# for Mono vs. Microsoft .NET? and seeing this great answer

I was wondering if there is a way to compile using both sqlite for .NET and monos version. On windows I shouldnt require monos lib to exist and on mono systems/runtime i should only need monos reference. The next part is in code i am using namespace System.Data.SQLite OR Mono.Data.Sqlite I cant do both because of name and class collision.

I'm unsure what to do. Maybe i should use monos version but than I don't want to find out the hardware if i must use the mono runtime for that reference (which has a fair chance of being required). How do i use SQLite in a way that runs on windows and on mono?

标签: .net sqlite mono
1条回答
放我归山
2楼-- · 2019-04-29 22:41

Mono.Data.Sqlite works on windows, linux and OSX ( and perhaps solaris too ). You should be able to replace System.Data.Sqlite with it, (SDS was a fork of MDS I think)

System.Data.SQLite I think is fully managed code. While Mono.Data.SQLite is a managed wrapper around the real sqlite C library. For my use this library is slightly faster than the fully managed one.

查看更多
登录 后发表回答