天天看點

C#資料庫sqlit,未能加載檔案或程式集“System.Data.SQLite, Version=

C#資料庫sqlit,未能加載檔案或程式集“System.Data.SQLite, Version=

在一個有sqlit 項目A的基礎上,增加一個新的項目B,如果B引用之前的sqlit A項目,如果都把該有的dll都放進去項目B的debug下面了,而且X64或者X32的版本都對的上,還是報錯什麼未加載,什麼程式集版本不對之類的,需要在該項目App.config裡面增加以下代碼,其實這個代碼在舊的項目裡面的App.config也可以找的到

<runtime>
	<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
		<dependentAssembly>
			<assemblyIdentity name="System.Data.SQLite" publicKeyToken="db937bc2d44ff139" culture="neutral" />
			<bindingRedirect oldVersion="0.0.0.0-1.0.113.0" newVersion="1.0.113.0" />
		</dependentAssembly>
	</assemblyBinding>
</runtime>