Process PowerPoint Prestation in C# .NET Core Framework using Aspose.Slides REST API conflict with Microsoft.Extensions.Logging.Debug

Hi,
Getting error when I use Aspose.Slides-Cloud 21.2.0 package with Microsoft.Extensions.Logging.Debug 5.0.0

The error that I’m getting:
System.MissingMethodException
HResult=0x80131513
Message=Method not found: ‘Microsoft.Extensions.Logging.ILoggerFactory Microsoft.Extensions.Logging.DebugLoggerFactoryExtensions.AddDebug(Microsoft.Extensions.Logging.ILoggerFactory, Microsoft.Extensions.Logging.LogLevel)’.
Source=Aspose.Slides.Cloud.Sdk
StackTrace:
at Aspose.Slides.Cloud.Sdk.RequestHandlers.DebugLogRequestHandler…ctor(Configuration configuration)
at Aspose.Slides.Cloud.Sdk.RequestHandlers.JwtRequestHandler…ctor(Configuration configuration)
at Aspose.Slides.Cloud.Sdk.ApiAccessor…ctor(Configuration configuration)
at Aspose.Slides.Cloud.Sdk.ApiBase…ctor(Configuration configuration)
at Aspose.Slides.Cloud.Sdk.ApiBase…ctor(String appSid, String appKey)
at Aspose.Slides.Cloud.Sdk.SlidesApi…ctor(String appSid, String appKey)

The project of reproducing this bug in attachment.

AsposeCloudSlideBugReproducing.zip (6.7 KB)

@kapusta

I am afraid I am unable to run your shared project. However, I am unable to notice any issue with my sample project using Aspose.Slides Cloud SDK for .NET 21.2 and Microsoft.Extensions.Logging.Debug 5.0.0. We will appreciate it if you please share a working project to reproduce the issue.

Thank you for quick response.
Example solution in attachment. It has 2 projects (console projects):

  1. AsposeCloudSlideBugReproducing_net3 - use .net core 3.1, Aspose.Slides-Cloud 21.2.0 and Microsoft.Extensions.Logging.Debug 3.0.0
  2. AsposeCloudSlideBugReproducing_net5 - use .net core 5, Aspose.Slides-Cloud 21.2.0 and
    Microsoft.Extensions.Logging.Debug 5.0.0

In both project the same bug should be reproducing.
The projects are simple for example AsposeCloudSlideBugReproducing_net3:
AsposeCloudSlideBugReproducing_net3.csproj file looks:

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>net5.0</TargetFramework>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Aspose.Slides-Cloud" Version="21.2.0" />
    <PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="5.0.0" />
  </ItemGroup>

</Project>

And Program.cs looks:

using System;
using Aspose.Slides.Cloud.Sdk;

try
{
    var slidesApi = new SlidesApi("", "");
    Console.WriteLine("It works!");
}
catch(Exception ex)
{
    Console.WriteLine(ex.Message);
} 

In both project in output you can see the error:
Method not found: ‘Microsoft.Extensions.Logging.ILoggerFactory
Microsoft.Extensions.Logging.DebugLoggerFactoryExtensions.AddDebug(Microsoft.Extensions.Logging.ILoggerFactory, Microsoft.Extensions.Logging.LogLevel)’.

Let me know please, if you will not be able to reproducing it.
Thank you in advance!

AsposeCloudSlideBugReproducing.zip (1.6 MB)

@kapusta

Thanks for sharing more details. Please note Aspose.Slides Cloud provides a separate SDK solution for .NET Standard. Please try to use .NET Standard Solution from Aspose.Slides Cloud Github repo. Hopefully, it will help you to accomplish the task.

Hello, Thank you for point to the code.

The problem that I am getting when I use library with Microsoft.Extensions.Logging.Debug version 5.0.0 happens here:

For package Microsoft.Extensions.Logging.Debug with version >= 3, it has some changes for LoggerFactory:

Announcements in asp.net: Breaking Logging changes and new additions · Issue #238 · aspnet/Announcements · GitHub

‘Aspose.Slides.Cloud.Sdk.netstandard’ uses Microsoft.Extensions.Logging.Debug version 2.0.0.

The issue happens when i try to use ‘Aspose.Slides.Cloud.Sdk.netstandard’ and Microsoft.Extensions.Logging.Debug version 5.0.0 due to method AddDebug doesn’t exit in this version.

@kapusta

Thanks for sharing the details. We have logged a ticket SLIDESCLOUD-1139 in our issue tracking system after initial investigation. We will keep you updated about the issue resolution progress within this forum thread.