I’m trying to load an msg file via the ASpose.Email product.
System.TypeInitializationException was unhandled by user code
HResult=-2146233036
Message=The type initializer for ’ ’ threw an exception.
Source=Aspose.Email
TypeName=
StackTrace:
at . (String , & )
at . (String , Encoding& )
at . (String )
at Aspose.Email.Mail.MailAddress…ctor(String , String , UInt32 )
at . (String , Int32& , Boolean )
at Aspose.Email.Mail.MailAddressCollection. (String , Boolean )
at Aspose.Email.Mail.MailAddressCollection. (String , Boolean )
at . ( , Encoding )
at Aspose.Email.Mime.HeaderCollection. ( , Encoding )
at . ()
at . (List`1 , Byte[] )
at . ()
at Aspose.Email.Mail.MailMessage. (Stream )
at Aspose.Email.Outlook.MailMessageInterpretor.LoadMessageHeader(MailMessage mailmessage, MapiMessage mapiMessage)
at Aspose.Email.Outlook.MailMessageInterpretor.Interpret(MapiMessage mapiMessage)
at Aspose.Email.Mail.MailMessage. (Stream , MsgLoadOptions )
at Aspose.Email.Mail.MailMessage. (Stream , LoadOptions )
at Aspose.Email.Mail.MailMessage.Load(Stream stream)
at Aspose.Email.Mail.MailMessage.Load(String fileName)
at PDF.js.Controllers.HomeController.GetFile(String file) in C:\Users\5lukwas\Documents\Visual Studio 2015\Projects\PDF.js\src\PDF.js\Controllers\HomeController.cs:line 46
InnerException:
HResult=-2146233036
Message=The type initializer for ’ ’ threw an exception.
Source=Aspose.Email
TypeName=
StackTrace:
at . (String )
at …cctor()
InnerException:
FileName=zx_9a1fe16f546a416facc09411015ccf75, PublicKeyToken=716fcc553a201e56
FusionLog=""
HResult=-2147024809
Message=Could not load file or assembly ‘zx_9a1fe16f546a416facc09411015ccf75, PublicKeyToken=716fcc553a201e56’ or one of its dependencies. The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))
Source=mscorlib
StackTrace:
at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean forIntrospection)
at System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
at System.Reflection.Assembly.Load(String assemblyString)
at . . ()
at . (Object , ResolveEventArgs )
at System.AppDomain.OnResourceResolveEvent(RuntimeAssembly assembly, String resourceName)
at System.Reflection.RuntimeAssembly.GetResource(RuntimeAssembly assembly, String resourceName, UInt64& length, StackCrawlMarkHandle stackMark, Boolean skipSecurityCheck)
at System.Reflection.RuntimeAssembly.GetManifestResourceStream(String name, StackCrawlMark& stackMark, Boolean skipSecurityCheck)
at System.Reflection.RuntimeAssembly.GetManifestResourceStream(String name)
at . (Assembly , Type , String )
at . (String )
at . (String )
at …cctor()
InnerException:
HResult=-2147024809
Message=The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))
Source=mscorlib
StackTrace:
at System.AppDomain.nApplyPolicy(AssemblyName an)
at System.AppDomain.ApplyPolicy(String assemblyName)
at Microsoft.Dnx.Runtime.Loader.LoadContext.ResolveAssembly(Object sender, ResolveEventArgs args)
at System.AppDomain.OnAssemblyResolveEvent(RuntimeAssembly assembly, String assemblyFullName)
InnerException:
I suppose it because there is a unicode sign \u0006 ? This happens with every email I save from my outlook 2016. I’ve added a sample msg file as an attachment.