.NET 6 지원

소개

Starting in Aspose.Slides 23.2, support for.NET6 was implemented. The peculiarity of this support is that .NET6 no longer supports System.Drawing.Common for Linux (breaking change) and Slides implements this graphical subsystem itself as a C++ component.

Aspose.Slides for .NET now work without dependencies on GDI/libgdiplus on:

  • Windows
  • Linux

MacOS support is in progress.

AWS 및 Azure에서 .NET 6용 Slides 사용

.NET6 is the preferred version for Aspose.Slides used on the cloud (AWS, Azure, or other cloud solutions).

Previously, when Aspose.Slides was used on a Linux host, additional dependencies (libgdiplus) had to be installed and this was often inconvenient or impractical (for example, when using AWS Lambda). With Slides for .NET6, those dependencies are no longer needed, so deployment is much easier.

Another consideration is problems that occurred when Aspose.Slides was used on a cloud solution with a Windows host. For example, Azure Functions have limitations for the process and results in problems during a PDF export operation (see this). The usage of Aspose.Slides for .NET6 resolves this issue.

System.Drawing.Common 패키지 및 .NET 6용 Slides 클래스 사용 (CS0433: Slides와 System.Drawing.Common 모두에 유형이 존재합니다 오류)

Sometimes, both System.Drawing and Slides for .NET6 dependencies have to be used in a project (for example, when the .NET6 project depends on other packages, which in turn depend on System.Drawing). This may cause complication errors like these:

  • CS0433: The type ‘Image’ exists in both ‘Aspose.Slides, Version=23.2.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56’ and ‘System.Drawing.Common, Version=6.0.0.0
  • CS0433: The type ‘Graphics’ exists in both ‘Aspose.Slides, Version=23.2.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56’ and ‘System.Drawing.Common, Version=6.0.0.0

In this case, you can use extern alias for Aspose.Slides (version less than 24.8):

  1. Select Aspose.Slides assembly from the project’s dependencies and then click Properties. Aspose Slides 패키지 속성
  2. Set an alias (for example, “Slides”). Aspose Slides 별칭

Now, the types from System.Drawing.Common will be used by default. External assembly alias should be specified where Aspose.Slides types are needed.

extern alias Slides;
using Slides::Aspose.Slides;

전체 예제:

extern alias Slides;
using Slides::Aspose.Slides;

static Slides::System.Drawing.Image GetThumbnail(Presentation pres)
{
    return pres.Slides[0].GetThumbnail();
}

Starting with version 24.8, the deprecated public API with dependencies on System.Drawing has been removed. Regarding the code example above, you can get the slide image as below.

static Aspose.Slides.IImage GetThumbnail(Presentation presentation)
{
    return presentation.Slides[0].GetImage();
}

The new API is described in more detail in Modern API.