Aspose.Slides Linux Container - System.PlatformNotSupportedException: System.Drawing.Common Is Not Supported on non-Windows Platforms

Here’s the stack trace:

Unhandled exception: System.InvalidOperationException: 
There was an error setting the license: Authentication failed.
   at DocumentServiceLibrary.AsposeTotal.AsposeLicenseManager.SetAsposeMeteredLicense() in /application/app/<>/AsposeTotal/AsposeLicenseManager.cs:line 

Here’s the sample code:

using Aspose.Words;
namespace <>.AsposeTotal;

public class AsposeLicenseManager
{
    static AsposeLicenseManager()
    {
        EnvironmentLoader.LoadEnvironmentVariables();
    }

    public static void SetAsposeMeteredLicense()
    {
        try
        {
            if (Metered.IsMeteredLicensed())
            {
                return;
            }

            // public and private keys set here

            if (string.IsNullOrEmpty(publicKey) || string.IsNullOrEmpty(privateKey))
            {
                throw new InvalidOperationException("Aspose metered keys are not set in the environment variables.");
            }

            Metered metered = new Metered();
            metered.SetMeteredKey(publicKey, privateKey);

            // Retry mechanism to check if the license is applied
            int retryCount = 5;
            int delay = 1000; // 1 second delay

            for (int i = 0; i < retryCount; i++)
            {
                if (Metered.IsMeteredLicensed())
                {
                    return;
                }
                System.Threading.Thread.Sleep(delay);
            }

            throw new InvalidOperationException("Aspose metered license is not applied.");
        }
        catch (Exception e)
        {
            throw new InvalidOperationException("\nThere was an error setting the license: " + e.Message);
        }
    }
}

Hi @andrey.potapov , any progress on the keys regeneration?

@sudi.karmacharya,
Our managers informed me that they sent you the new keys.

@sudi.karmacharya Setting metered license works fine on my side with Aspose.Words. So perhaps the problem is with your keys.

@andrey.potapov , thank you for checking. Where were the keys sent?

Sounds good. I’ll report back once I am able to use the new keys

@sudi.karmacharya,
I am waiting for information from our developers for you. Thank you for your patience.

Thank you @andrey.potapov .

I was wondering if this ticket can be converted to a public post (after deleting sensitive data) or if there’s a way to generate a link that would give permission to see this post to the people I share the link with.

Thank you,
@sudi.karmacharya

@sudi.karmacharya,
Of course. Please let us know when we can make this forum thread public, and we will do so.

You can also do this yourself in the following way:

  1. At the bottom of your first post, click on the “show more” button.
  2. Click on the “edit this post” button.
  3. Reset the “Private Topic” check box.
  4. Click on the “Save Edit” button.

Awesome. Thank you for the pointers.

Would you be able to delete the message with order ID? I’ll change this post to public after that.

Thank you,
@sudi.karmacharya

@sudi.karmacharya,

It’s done. The relevant post/reply by @andrey.potapov, where your order ID was mentioned, has been removed. You can now safely make the thread public.

1 Like

The issues you found earlier (filed as SLIDESNET-44935) have been resolved in Aspose.Slides for .NET 25.6 (ZIP, MSI, NuGet, Cross-platform).
You can check all fixes on the Release Notes page.
You can also find the latest version of our library on the Product Download page.