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

Free Support Forum - aspose.com

System.TypeLoadException has been thrown

I can run the standard examples locally on my Mac running the latest version of Visual Studio and .net 4.7, however I need to run the project on .Net core.

When I build a new project using Core 2.1 I can compile the program. Running it gives me:

Unhandled Exception: System.TypeLoadException: Could not load type ‘System.Runtime.InteropServices.FILETIME’ from assembly ‘mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089’.
at Aspose.Email.Mapi.MapiMessageReader.ReadMessage()
at Aspose.Email.Mapi.MapiMessage.#=zG9QRwpE=(MapiObjectProperty #=zT9n7coE=)
at Aspose.Email.Mapi.MapiMessage.#=z8uZpTVaQA$L0(#=zn$OQZVxSO5KhM0O64rpfQR57Psv6EGLF13NKbUU= #=zaPUZMqI=, MapiObjectProperty #=zT9n7coE=)
at Aspose.Email.Mapi.MapiMessage.#=zilbjdzXBZCoL(Stream #=zwkBs754=, #=zO$d9yOUjDYVzahI39RG9U9QGLvygvBJEUw== #=zlRekYTM=)
at Aspose.Email.Mapi.MapiMessage.Save(Stream stream)
at Aspose.Email.Mapi.MapiMessage.Save(String fileName)
at aspose_core.MSGExporter.WalkFolders(PersonalStorage pst, FolderInfo folder, String parentFolderName, IList1 folderData) in /Users/aqd/projects/aspose_core/MSGExporter.cs:line 75 at aspose_core.MSGExporter.WalkFolders(PersonalStorage pst, FolderInfo folder, String parentFolderName, IList1 folderData) in /Users/aqd/projects/aspose_core/MSGExporter.cs:line 131
at aspose_core.MSGExporter.WalkFolders(PersonalStorage pst, FolderInfo folder, String parentFolderName, IList`1 folderData) in /Users/aqd/projects/aspose_core/MSGExporter.cs:line 131
at aspose_core.MSGExporter.WalkAllFolders() in /Users/aqd/projects/aspose_core/MSGExporter.cs:line 30
at aspose_core.MSGExporter.Main(String[] args) in /Users/aqd/projects/aspose_core/MSGExporter.cs:line 139

exception from:

MapiMessage message = pst.ExtractMessage(messageInfo);
string tmp_destination = path + "email.msg";
message.Save(tmp_destination);

I’m using Aspose Email 18.10 and referencing the DLL in net20

Please let me know if you’d like to see more of the code.

@aqdeciu432

We have logged this issue with ID “EMAILNET-39191” for further investigation. You will automatically be informed here once we have more information to share.

@aqdeciu432

We have investigated the issue and found that you may need to use the special Aspose.Email.Core.dll assembly from netstandard2.0. It contains assembly to use with frameworks that implements .NET Standard 2.0 such as .NET Core 2.0.