The type initializer for 'Aspose.Slides.Presentation' threw an exception

System.TypeInitializationException
HResult=0x80131534
Message=The type initializer for ‘Aspose.Slides.Presentation’ threw an exception.
Source=Aspose.Slides
StackTrace:
at Aspose.Slides.Presentation…ctor(String file)
at AsposeDemo.Program.Ppt2Pdf(String fromPath, String toPath) in E:\myproject\SharePrint\code\Demo\AsposeDemo\AsposeDemo\Program.cs:line 145
at AsposeDemo.Program.Main(String[] args) in E:\myproject\SharePrint\code\Demo\AsposeDemo\AsposeDemo\Program.cs:line 47

内部异常 1:
TypeLoadException: Could not load type ‘System.Drawing.FontStyle’ from assembly ‘System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a’.

My Framework is .net core 2.0

@jobroon,
Welcome to our community! Thank you for posting the query. Please check the issue using the latest version of Aspose.Slides. If the issue persists, please share and specify the following:

  • input presentation file you used
  • code example reproducing the exception
  • OS version where the error occurs