I am working on a WinForms application using EF 6.3 and .NET Framework 4.5.1. The application is compiled as X86 and running on different Win10 x64 machines.
The application throws a XmlException
intermittently. After including the source code of EF, I pinned it down to:
System.Data.Entity.Core.Metadata.Edm.MetadataArtifactLoaderResource:
private bool TryCreateResourceStream(out Stream resourceStream)
{
resourceStream = _assembly.GetManifestResourceStream(_resourceName);
return resourceStream != null;
}
For some weird reason the embedded resource of the csdl gets corrupted.
For example the tag Name will be replaced by Naméy followed by some not printable characters.
Once you restart the application works like expected. Sometimes uses can work a whole day without problems and some times even a restart does not help and the have to do it a third time.
In the environment environment I can reproduce the problem but might have to start a debug session 20 times.
I cannot figure out which process my corrupt the stream returned by GetManifestResourceStream
.
Any ideas?