bc-csharp
bc-csharp copied to clipboard
Type conflict: 'PublicKeyFactory' exists in both BouncyCastle and iTextSharp"
A type conflict has been encountered in the project due to the PublicKeyFactory type being 'maybe' defined in both of the following assemblies:
BouncyCastle.Crypto, Version=1.8.9.0, Culture=neutral, PublicKeyToken=0e99375e54769942itextsharp, Version=5.4.3.0, Culture=neutral, PublicKeyToken=8354ae6d2174ddca
⚠️ Note: I have not directly installed or referenced
itextsharpin the project. Despite that, the build still reports a conflict involving it, which suggests it may be coming in transitively through another dependency.
This results in the following error during build or runtime:
The type 'PublicKeyFactory' exists in both 'BouncyCastle.Crypto, Version=1.8.9.0, Culture=neutral, PublicKeyToken=0e99375e54769942' and 'itextsharp, Version=5.4.3.0, Culture=neutral, PublicKeyToken=8354ae6d2174ddca'
Workarounds Attempted that worked.
- ✅ Package aliasing: I applied an alias to
BouncyCastle.Crypto