Question: Dapper / Dapper.StrongName dependency
AkosLukacs opened this issue · 9 comments
Hi!
Latest MiniProfiler.Providers.SqlServer
depends on Dapper.StrongName
package, this package depends on Dapper
package.
Any idea how to solve this now, or plans to change the dependency of this package to Dapper.StrongName
?
Thanks!
Same here, I get:
Error CS0121 The call is ambiguous between the following methods or properties: 'Dapper.SqlMapper.AsList(System.Collections.Generic.IEnumerable)' and 'Dapper.SqlMapper.AsList(System.Collections.Generic.IEnumerable)'
when I'm trying to use .AsList()
, for instance, because both Dapper
and Dapper.StongName
are referenced.
@AkosLukacs Did you solve it?
Hey @AkosLukacs , I found a solution that worked for me. I added the following to my .csproj:
<Target Name="ChangeAliasesOfStrongNameAssemblies" BeforeTargets="FindReferenceAssembliesForReferences;ResolveReferences">
<ItemGroup>
<ReferencePath Condition="'%(FileName)' == 'Dapper.StrongName'">
<Aliases>SomeAlias</Aliases>
</ReferencePath>
</ItemGroup>
</Target>
Dapper v2 will do away with strong name (the only real solution for this...it's just a big one), but that will be later this year at the earliest. We've been busier than expected and StackExchange.Redis ate a lot more of our v2 time than we planned on. It's next on our list, though.
Tagged this as blocked for now to I keep an eye on it. As soon as we release Dapper v2, I'll release a new exceptional with the dependency to unblock upgrades and the scenario here.
Thanks @lalibi, your solution is just what I've looked for.
Is this now possible with the Dapper 2 release?
Looks MiniProfiler is still referencing Dapper.StrongName, which is not a popular nuget package at all. Instead, Dapper is the primary release. This makes it impossible for Dapper (not Dapper.StrongName) users to use MiniProfiler at all if they need to use MiniProfiler.Providers.XXX.
Anybody finding the same issue: @lalibi 's workaround does work, thanks for sharing!
This workaround with alias helped me in 2024 :) Thanks!