CoreCompat.System.Drawing + .NET Core 2.2 (System.Drawing) conflict

Hi!

Im migrating a .NET 4.6 app to .NET Core 2.2 and I found a problem using the FastReport.Core on it.

Since ASP.NET Core 2.2 already has System.Drawing, when I add reference to FastReport.Core and try to use the type "Image" on my application it shows:
Error	CS0433	The type 'Image' exists in both 'CoreCompat.System.Drawing, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' and 'System.Drawing.Common, Version=4.0.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'

Is there a way to fix this? I already tried to force reference the type using "System.Drawing.Image" on code but since both libraries implement it on the same namespace, it shows the same error and I couldn't find a way to work around this issue.

Comments

  • edited 3:12PM
    1. use fully typed : namespace.class or
    2. alias, https://www.dotnetperls.com/using-alias
  • Hello!

    To resolve this issue, you can completely remove the CoreCompat.System.Drawing NuGet package from your project and use only the official System.Drawing.Common (or, for modern .NET 8+ systems on Linux/macOS, switch to the latest FastReport.Core.Skia, which does not depend on System.Drawing.Common at all).

This discussion has been closed.