Dapper: 1.50.7 Assembly Versioning Issue

Created on 20 Feb 2019  路  13Comments  路  Source: StackExchange/Dapper

When referencing the latest release of 1.50.7 and using another NuGet package (Hangfire) in this case that references an older version of Dapper (1.50.1.0) I get an assembly load error about the "assembly's manifest definition does not match the assembly reference." Using 1.50.5 does not have this problem.

Looking at the commits between 1.50.5 and 1.50.7 I see a version.json file (which I assume AppVeyor uses) was added in this commit: https://github.com/StackExchange/Dapper/commit/e16c69950cc2e2741c99c5a4495617cdd4749a9d#diff-3ef5e0d96a4566e6853165551eb193b0 and the assembly version was specified as 1.50.0.0. I was wondering if 1.50.1.0 had been a previously released assembly version but then the version got bumped down with this new file and thus the possible mismatch which is making the loader fail. I am not using the strong named version of Dapper.

Most helpful comment

1.60.1 is now on NuGet, release notes are updated, and the 1.50.7 release with the issue has been unlisted. Thanks for the help everyone - upgrading to 1.60.1 should resolve, but I'll leave this open for a few confirmations first :)

All 13 comments

I am running into the same issue. We cannot use 1.50.7. Because the assembly version is lower than 1.50.5 or 1.50.2 binding redirects to do not work.

what does your binding redirect look like? You shouldn't need them unless you're manually strong naming the assembly somehow...

@NickCraver sorry, I forgot to specify I'm using .NET Core. (I knew I was forgetting something.) So I don't have any binding redirects in my particular case. I'm not totally sure how .NET Core changed it's binding rules.

@adamkirkton you're right, I'm only having the problem with core as well where the binding are magical

i'm working on a project that I'll upload that demonstrates the problem. In the project is a netstandardDll that uses Dapper 1.50.5. There is also a aspnetcore project that uses Dapper 1.50.7. The aspnetcoreproject calls a method in the netstandardDll. This will cause the error.

i uploaded a simple project that demonstrates the issue. https://github.com/tigrin/DapperError. Run the CoreWeb app in the solution and you should get the error about loading the older version of Dapper.

I am building a 1.60.0 that version locks to 1.60.0 going forward so that our lock is on the current upper bound until we're back at a v2.0 stable to lock to. It's the change in #1198 that should land on MyGet shortly. After a NuGet run and testing on Stack Overflow, we'll de-list 1.50.7 and list 1.60.0 only.

A new release 1.60.1 is headed to NuGet now, it should resolve the issues here - updating release notes in a moment.

1.60.1 is now on NuGet, release notes are updated, and the 1.50.7 release with the issue has been unlisted. Thanks for the help everyone - upgrading to 1.60.1 should resolve, but I'll leave this open for a few confirmations first :)

@NickCraver Confirmed 1.60.1 resolved the problem. Thanks for the quick turnaround.

1.60.1 worked for me as well.

Thanks for the reports and responses all - closing out as good to go on the versioning front.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

yozawiratama picture yozawiratama  路  5Comments

valinoment picture valinoment  路  4Comments

silkfire picture silkfire  路  4Comments

rafakwolf picture rafakwolf  路  5Comments

Abdallah-Darwish picture Abdallah-Darwish  路  3Comments