We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

AsposeTasks:TypeInitializationException:The type initializer for 'Gdip' threw an exception

I’m building an application that runs on both windows and macos.

This application converts mpp to pdf.

On Windows (10) it works but on MacOs I get:

TypeInitializationException:The type initializer for ‘Gdip’ threw an exception.

We’re using the latest AsposeTasks and the app is built in .net 6.

See code example:

AsposeTasks.zip (28.4 KB)

@nielsbosma,

Aspose.Tasks currently uses System.Drawing to render (in particular, to save to PDF) projects.
Microsoft marked System.Drawing as a Windows-specific library and now classes from System.Drawing assembly throw exception you’ve observed.

More details are on Microsoft site .

As a temporary fix you can disable this behavior and enable support for non-Windows platforms by setting configuration switch (see the link above).

We are going to remove usages of System.Drawing in future release, but cannot provide an exact E.T.A.

Workaround doesn’t work.

We are going to remove usages of System.Drawing in future release, but cannot provide an exact E.T.A.

Can you add a ticket reference to this thread?

@nielsbosma

Which version of .NET do you use?

Thank you for noticing. I’ve linked the ticket.