Nhibernate下操作SQLite报错

来源:互联网 发布:淘宝商城童鞋 编辑:程序博客网 时间:2024/05/22 03:08

"Error creating context 'spring.root': Error thrown by a dependency of object 'SQLite-1.0.47' defined in 'assembly [Spring.Data, Version=2.0.0.40000, Culture=neutral, PublicKeyToken=null], resource [Spring.Data.Common.dbproviders.xml] line 1376' : Unsatisfied dependency expressed through constructor argument with index 2 of type [System.Type] : Could not convert constructor argument value [System.Data.SQLite.SQLiteConnection, System.Data.SQLite, Version=1.0.47.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139] to required type [System.Type] : Cannot convert property value of type [System.String] to required type [System.Type] for property ''.\r\n while resolving 'constructor argument with name dbmetadata' to 'Spring.Data.Common.DbMetadata#13E2EF' defined in 'assembly [Spring.Data, Version=2.0.0.40000, Culture=neutral, PublicKeyToken=null], resource [Spring.Data.Common.dbproviders.xml] line 1376'"

 

解决办法:在app.config中加入

<startup useLegacyV2RuntimeActivationPolicy="true">    <supportedRuntime version="v4.0"/>  </startup>


 

原创粉丝点击