Error thrown by a dependency of object 'System. Data. SQLite 'Solution

Source: Internet
Author: User

The. net4 + mvc3 + spring. net1.3.2 + nhibernate32 + SQLite 1.0.79 used in the project should be the latest version,

It is okay to use NH to link SQLite separately, but the problem of configuring nhib.pdf with spring.net is coming,

 

Version 1.3.2 supports sqlite1.0.72, because I use version 1.0.79. If it is written as system. Date. SQLite, the error is

Note the Red Line Error. I checked the source code of spring.net, which is written in this way,

 

Why does he report the error here:

 
<Alias name = "SQLite-1.0.65" alias = "system. Data. SQLite"/>

He directly maps this to version 1.0.65, and the highest version is 1.0.72, without 1.0.79. The solution is very simple. Just add one, note:

 
<! -- Database provider --> <DB: additionalproviders resource = "assembly: // mark/mark. configfiles/SQLite. xml"/>

This SQLite. XML is written by myself. In fact, it is written by the copy method. I just don't know what the publickeytoken is. I deleted it directly. The same can be used, SQLite. the content in XML is:

<? XML version = "1.0" encoding = "UTF-8"?> <Objects xmlns = "http://www.springframework.net" xmlns: DB = "http://www.springframework.net/database"> <Object ID = "SQLite-1.0.79" type = "Spring. data. common. dbprovider, spring. data "Singleton =" false "> <constructor-Arg name =" dbmetadata "> <object type =" Spring. data. common. dbmetadata "> <constructor-Arg name =" productname "value =" SQLite "/> <constructor-Arg name =" assemblyname "value =" system. data. SQLite, versio N = 1.0.79.0, culture = neutral "/> <constructor-Arg name =" connectiontype "value =" system. data. SQLite. sqliteconnection, system. data. SQLite, version = 1.0.79.0, culture = neutral "/> <constructor-Arg name =" commandtype "value =" system. data. SQLite. sqlitecommand, system. data. SQLite, version = 1.0.79.0, culture = neutral "/> <constructor-Arg name =" parametertype "value =" system. data. SQLite. sqliteparameter, system. data. SQ Lite, version = 1.0.79.0, culture = neutral "/> <constructor-Arg name =" dataadaptertype "value =" system. data. SQLite. sqlitedataadapter, system. data. SQLite, version = 1.0.79.0, culture = neutral "/> <constructor-Arg name =" commandbuildertype "value =" system. data. SQLite. sqlitecommandbuilder, system. data. SQLite, version = 1.0.79.0, culture = neutral "/> <constructor-Arg name =" commandbuilderiveparametersmethod "Value = "Not supported"/> <constructor-Arg name = "parameterdbtype" value = "system. data. SQLite. typeaffinity, system. data. SQLite, version = 1.0.79.0, culture = neutral "/> <constructor-Arg name =" parameterdbtypeproperty "value =" dbtype "/> <constructor-Arg name =" parameterisnullableproperty "value =" isnullable "/> <Constructor -Arg name = "parameternameprefix" value = ": "/> <constructor-Arg name =" exceptiontype "value =" syste M. data. SQLite. sqliteexception, system. data. SQLite, version = 1.0.79.0, culture = neutral "/> <constructor-Arg name =" useparameternameprefixinparametercollection "value =" true "/> <constructor-Arg name =" useparameterprefixinsql "value =" true "/> <Constructor -Arg name = "bindbyname" value = "true"/> <! -- This is only true. NET 1.1 kept it here just in case we want to revert back to this strategy for obtaining error codes --> <constructor-Arg name = "errorcodeexceptionexpression" value = "errorcode. tostring ('D') "/> <property name =" errorcodes. badsqlgrammarcodes "> <value> </property> <property name =" errorcodes. dataaccessresourcefailurecodes "> <value> 1 </value> </property> <property name =" errorcodes. dataintegrityviolationcodes "> <value> </property> <property name =" errorcodes. cannotacquirelockcodes "> <value> 15 </value> </property> <property name =" errorcodes. deadlocklosercodes "> <value> 5, 6 </value> </property> </Object> </constructor-Arg> </Object> </objects>

Then write:

 
<DB: provider id = "dbprovider" provider = "SQLite-1.0.79" connectionstring = "Data Source = | datadirectory | XXXX. DB; version = 3; failifmissing = false;"/>

Run again. No error is reported.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.