Hi,
When I refer Aspose.Email nuget package in my UWP app, it works fine when I disable .Net Native Tool Chain. But when I enable, the expected functionalities of Aspose.Email nuget are throwing the below exceptions
When I invoke the method PersonalStorage.FromFile method to read a PST file, it throws the below exception
System.TypeInitializationException: A type initializer threw an exception. To determine which type, inspect the InnerException's StackTrace property. ---> System.TypeLoadException: Cannot load type 'System.Void, netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'.
at a.fu(Int32, v, Boolean&, Boolean) + 0x31c
at a.KE(Int32, Boolean) + 0x281
at a.FE(Object[], Type[], Type[], Object[]) + 0x195
at qUE.WUE(a) + 0x73
at qUE.oUE() + 0xad
at hUK..cctor() + 0x9
at System.Runtime.CompilerServices.ClassConstructorRunner.EnsureClassConstructorRun(StaticClassConstructionContext*) + 0xf1
--- End of inner exception stack trace ---
at System.Runtime.CompilerServices.ClassConstructorRunner.EnsureClassConstructorRun(StaticClassConstructionContext*) + 0x1ad
at System.Runtime.CompilerServices.ClassConstructorRunner.CheckStaticClassConstruction(Void, StaticClassConstructionContext) + 0xf
at Aspose.Email.Storage.Pst.PersonalStorage.u(Stream, PersonalStorageLoadOptions, CancellationToken) + 0x27
at Aspose.Email.Storage.Pst.PersonalStorage.FromStream(Stream, Boolean) + 0x40
at Aspose.Email.Storage.Pst.PersonalStorage.FromFile(String, Boolean) + 0xe5
at AsposeNTC.MainPage.<ReadPST_Click>d__2.MoveNext() + 0x28b
System.TypeLoadException: Cannot load type 'System.Void, netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'.
at a.fu(Int32, v, Boolean&, Boolean) + 0x31c
at a.KE(Int32, Boolean) + 0x281
at a.FE(Object[], Type[], Type[], Object[]) + 0x195
at qUE.WUE(a) + 0x73
at qUE.oUE() + 0xad
at hUK..cctor() + 0x9
at System.Runtime.CompilerServices.ClassConstructorRunner.EnsureClassConstructorRun(StaticClassConstructionContext*) + 0xf1
When I invoke the method MailMessage.Load to read an EML file, it throws the below exception
System.TypeLoadException: Cannot load type 'System.IO.Stream, netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'.
at a.fu(Int32, v, Boolean&, Boolean) + 0x31c
at a.KE(Int32, Boolean) + 0x281
at a.ME(Object[]) + 0xba
at a.FE(Object[], Type[], Type[], Object[]) + 0x96
at Aspose.Email.License.SetLicense(Stream) + 0x84
at AsposeNTC.MainPage.<SetLicense_Click>d__1.MoveNext() + 0x2ba
Please let us know if the nuget is really compatible with .Net Native Tool Chain or if we have any other alternate solutions
Please find my POC app “AsposeNTC” in github
AsposeNTC.png (55.3 KB)