Getting compilation error 'The type XXX exists in both Aspose.Drawing and System.Drawing.Common' using aspose task on a windows forms application

getting the below error

image.png (40.2 KB)

I have also attached my sample project
AsposeTest.zip (100.8 KB)

@dileepawijay,
we need some time to investigate the problem.

@dileepawijay,
Aspose.Tasks targeting .NET 6.0 now uses Aspose.Drawing for graphics-related routines.
Aspose.Drawing is intended to seamlessly replace System.Drawing library and thus have the same namespaces and class names.

In order to resolve naming confilct you need to add the following workaround: add Aspose.Drawing as package reference (should be version 22.12) and set its Alias:

This can be done by editing AsposeTest.csproj file:

  <ItemGroup>
    <PackageReference Include="Aspose.Tasks" Version="23.5.0" />
    <PackageReference Include="Aspose.Drawing" Version="22.12.0">
        <Aliases>AsposeDrawing</Aliases>
    </PackageReference>
  </ItemGroup>

or by adding a package reference in Visual Studio and editing its property.

This is a problem for us, we have an API that uses the aspose component, we cannot expect our customers to do this.

@dileepawijay,
Could you provide more details?
For example, how is the API distributed?

We distribute our API through a Nuget package

It references Aspose.Tasks for .NET which targets .NET 6.0 ?

@dileepawijay,

We included version targeting .net6.0-windows in our latest release.
The version depends on System.Drawing instead of Aspose.Drawing.

Could you check it?

Release Notes can be found here

We had so many issues with Aspose.Drawing, we removed it and ended using System.Drawing.