SQLite installation problem with visual c# 2010

匆匆过客 提交于 2020-01-13 03:20:10

问题


I'm trying to use SQLite to make databases in visual c# 2010 but when I select "SQLite Database File" I don't get the opportunity to point to a database file. I get a dialog that asks me for a connection string. I have not been able to come up with a connection string that doesn't give me the error "Could not load file or assembly 'Microsoft.VisualStudio.Data, version=9.0.0.0, PublicKeyToken=...'The located assembly's manifest definition does not match the assemble reference."

I've learned that this is due to the data tools for Visual Studio were not successfully installing, but I've tried uninstalls and reinstalls to no avail. The only relevant thread I could find was at http://www.basarat.com/2010/05/sqlite-for-visual-studio-2010.html

I used the latest SQLite-1.0.66.0-setup. Does anyone have any thoughts?


回答1:


May or may not solve your problem. Here's from my blog post on my own experience with getting the latest SQLite up and going in Visual Studio 2010 a few days ago:

The current binary installers from sqllite.org for the System.Data.SQLite .NET assembly do not include the Visual Studio designers or the ADO.NET driver required for use of SQLite in the Server Explorer. So here’s the winning combination I’ve found for getting my environment set up properly.

1.Download and install version 1.0.66.0 from sourceforge.net because current binary installs on SQLite.org at system.data.sqlite.org do not include the Visual Studio designer or ADO.NET driver install.

2.Download and install the latest versions (x86 and x64) from system.data.sqlite.org (currently 1.0.73.0 which contains the SQLite 3.7.6.3 engine). Important Note: If you have Visual Studio 2008 and 2010, be sure to choose both when prompted as I found reports from others who had problems otherwise.

3.Copy the x86 binaries into and overwriting file at C:\Program Files (x86)\SQLite.NET\bin (assuming you used the default install location for version 1.0.66.0 and you're running x64 Windows). And if you are on an x64 box, copy the x64 binaries to the C:\Program Files (x86)\SQLite.NET\bin\x64 directory, overwriting existing files.




回答2:


Try add these lines

<dependentAssembly>   
  <assemblyIdentity name="Microsoft.VisualStudio.Data" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />   
  <bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="10.0.0.0" />   
</dependentAssembly> 

to the file C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\.config

Then restart Visual Studio.




回答3:


See this sqlite forum article. The connection string basically includes the filename and some options. Eg:

"Data Source=mydb.db;Version=3;New=True;"

This would use mydb.db as your sqlite database and use the version 3.0 runtime library (best) and would create a New db file if it did not exist.




回答4:


Download SQLite binaries , extract zip, navigate to "bin/Designer" folder and run install.exe. Maybe this will help.



来源:https://stackoverflow.com/questions/5561399/sqlite-installation-problem-with-visual-c-sharp-2010

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!