0

I've created Asp.Net MVC 4 application and using 'ServiceStack.OrmLite.Sqlite'. When I load the page I see the following error.

Could not load file or assembly 'ServiceStack.OrmLite.SqliteNET' or one of its dependencies. An attempt was made to load a program with an incorrect format

LOG: DisplayName = ServiceStack.OrmLite.SqliteNET (Partial) WRN: Partial binding information was supplied for an assembly: WRN: Assembly Name: ServiceStack.OrmLite.SqliteNET | Domain ID: 36 WRN: A partial bind occurs when only part of the assembly display name is provided. WRN: This might result in the binder loading an incorrect assembly. WRN: It is recommended to provide a fully specified textual identity for the assembly, WRN: that consists of the simple name, version, culture, and public key token. WRN: See whitepaper http://go.microsoft.com/fwlink/?LinkId=109270 for more information and common solutions to this issue.

I've used Visual studio 2012 Nuget installer to load the files. That means I've all the dependencies in place. I've set my project to 32bit and 64bit to troubleshoot the issue but in either case error is same.

Does ServiceStack.OrmLite.SqliteNET work on .Net 4.5 runtime?

2 Answers2

1

I fixed the same issue on .Net 4.0. I don't believe it's a CLR version related issue. More of a Nuget dependency related one.

When I looked in the fusion log I found:

LOG: Post-policy reference: System.Data.SQLite, Version=1.0.84.0, Culture=neutral, ... LOG: Assembly Name is: System.Data.SQLite, Version=1.0.85.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139 WRN: Comparing the assembly name resulted in the mismatch: Build Number ERR: The assembly reference did not match the assembly definition found.

It looks like the SQLite Nuget package was updated and that broke things.

To fix things: I changed the reference in packages.config to version 1.0.84.0. Did a restore of the Nuget packages and manually rereferenced the two SQLite assemblies to the newly created version 84 folders in the solution level package cache.

Community
  • 1
  • 1
0

Solution/issue reported on GitHub:

Solution is to manually remove System.Data.SQLite dependencies, remove references from package.config an than installing from nuget with '-Version 1.0.84.0'.

Rui Marques
  • 3,429
  • 1
  • 22
  • 26