Type Analysis Conflict: "dynamic" type becomes unusable in Dapper/EF after installing v1.21.1 on .NET 8

Hello,

I am the Lead Backend Engineer for

a fintech/multi-vendor platform (Maqadhi). We recently encountered a strange behavior when upgrading Hangfire.PostgreSql to version 1.21.1 in a .NET 8.0 environment.

The Issue: After installing v1.21.1, the IDE (Visual Studio/Rider) and the compiler started throwing errors on unrelated Dapper queries that use the dynamic type. The error was: "Type 'dynamic' has no settable fields or properties".

Findings:

  • The code was working perfectly on SQL Server and on older versions of the PG storage.

  • Removing v1.21.1 or downgrading to v1.20.9 immediately resolves the issue.

  • This suggests a dependency conflict (possibly with Npgsql or metadata resolution) that affects the Dynamic Language Runtime (DLR) interpretation in .NET 8.

Environment:

  • Target Framework: .NET 8.0

  • Dapper Version: 2.1.66

  • Hangfire.PostgreSql: 1.21.1 (Broken) vs 1.20.9 (Working)

Has anyone else experienced this metadata/DLR pollution with the latest version?