On my ASP.NET Web API i have a method that parses some data from email messages using MsgReader. It works OK, but after a while it starts to throw following exception:
System.IO.FileNotFoundException: Could not load file or assembly 'MsgReader.resources, Version=2.1.3.0, Culture=en-US, PublicKeyToken=47f99f3a9a2648df' or one of its dependencies. The system cannot find the file specified.
File name: 'MsgReader.resources, Version=2.1.3.0, Culture=en-US, PublicKeyToken=47f99f3a9a2648df' ---> System.IO.FileNotFoundException: The system cannot find the file specified. (Exception from HRESULT: 0x80070002)
at System.Reflection.RuntimeAssembly.nLoadFile(String path, Evidence evidence)
at System.Reflection.Assembly.LoadFile(String path)
at System.AppDomain.OnAssemblyResolveEvent(RuntimeAssembly assembly, String assemblyFullName)
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.InternalGetSatelliteAssembly(String name, CultureInfo culture, Version version, Boolean throwOnFileNotFound, StackCrawlMark& stackMark)
at System.Resources.ManifestBasedResourceGroveler.GetSatelliteAssembly(CultureInfo lookForCulture, StackCrawlMark& stackMark)
at System.Resources.ManifestBasedResourceGroveler.GrovelForResourceSet(CultureInfo culture, Dictionary`2 localResourceSets, Boolean tryParents, Boolean createIfNotExists, StackCrawlMark& stackMark)
at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo requestedCulture, Boolean createIfNotExists, Boolean tryParents, StackCrawlMark& stackMark)
at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents)
at System.Resources.ResourceManager.GetString(String name, CultureInfo culture)
at MsgReader.Mime.MessagePart..ctor(Byte[] rawBody, MessageHeader headers) in C:\Users\Kees\Documents\GitHub\MsgReader\MsgReader\Mime\MessagePart.cs:line 242
at MsgReader.Mime.Message..ctor(Byte[] rawMessageContent, Boolean parseBody) in C:\Users\Kees\Documents\GitHub\MsgReader\MsgReader\Mime\Message.cs:line 139
at MsgReader.Mime.Message.Load(Stream messageStream) in C:\Users\Kees\Documents\GitHub\MsgReader\MsgReader\Mime\Message.cs:line 301
at MsgReader.Outlook.Storage.Message.LoadClearSignedMessage(IStorage storage) in C:\Users\Kees\Documents\GitHub\MsgReader\MsgReader\Outlook\Message.cs:line 1558
at MsgReader.Outlook.Storage.Message.LoadStorage(IStorage storage) in C:\Users\Kees\Documents\GitHub\MsgReader\MsgReader\Outlook\Message.cs:line 1384
at MsgReader.Outlook.Storage..ctor(Stream storageStream, FileAccess fileAccess) in C:\Users\Kees\Documents\GitHub\MsgReader\MsgReader\Outlook\Storage.cs:line 196
...
After i recycle application pool, it works again (for a while) then at some time the error repeats...
I tried with assemblyBinding
<dependentAssembly>
<assemblyIdentity name="MsgReader" publicKeyToken="47f99f3a9a2648df" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.1.3.0" newVersion="2.1.3.0" />
</dependentAssembly>
but no success...
I think the problem the problem is with Culture? Because as i see in error the Culture is en-US, but in MsgReader package there are only these cultures:
Thank you for help
Aucun commentaire:
Enregistrer un commentaire