Issue with simple serialization/deserialization of a double
See original GitHub issueI have been using the package for a while in this application. This seem to have been working. I moved from “standard” serialization to extended because I was having issues with serializing my dictionary.
Fair disclosure…Currently I have been working on other aspects of the project and I may not have noticed if things were not working properly with the serialization. Today I started having issues with serialization/deserialization of dictionary<list<byte[]>, MyCustomClass>. Digging deeper I added test code to serialize and deserialize a variable of type double:
double y = 0;
//Read double test
try
{
using (var stream = storage.TryOpenStream("Test", true))
{
var serializer = new ConfigurationContainer()
.EnableImplicitTyping(typeof(double))
.Create();
serializer.Serialize(stream, y);
Debug.WriteLine("Successfully read test on open");
}
}
catch (Exception ex)
{
Debug.WriteLine(ex);
}
I started having IO exceptions so I uninstalled and reinstalled the NuGet package.
Now when I run the above code I get the following error on the ‘serializer.Serialize’ line:
Exception thrown: 'System.Runtime.InteropServices.COMException' in System.Xml.dll
Exception thrown: 'System.Runtime.InteropServices.COMException' in System.Xml.dll
Exception thrown: 'System.Runtime.InteropServices.COMException' in System.Xml.dll
System.Runtime.InteropServices.COMException (0x80030005): Access Denied. (Exception from HRESULT: 0x80030005 (STG_E_ACCESSDENIED))
at System.Runtime.InteropServices.ComTypes.IStream.Write(Byte[] pv, Int32 cb, IntPtr pcbWritten)
at System.Xml.XmlUtf8RawTextWriter.FlushBuffer()
at System.Xml.XmlUtf8RawTextWriter.Flush()
at System.Xml.XmlWellFormedWriter.Flush()
at ExtendedXmlSerializer.ExtensionModel.Xml.InstanceFormatter.Get(Object parameter)
at ExtendedXmlSerializer.ExtensionMethodsForSerialization.Serialize(IExtendedXmlSerializer this, Stream stream, Object instance)
at Dispensing.DocumentHandler.HandleStorageReadAvailable(IXDocument doc) in C:\Users\erics\source\repos\TestingEFClassLibrary\TestingEFClassLibrary\DocumentHandler.cs:line 159
I am running as administrator as I am developing a class library and debugging requires that the dll gets registered. AFAIK this has not caused an issue before.
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (3 by maintainers)
Top GitHub Comments
Thanks. @flycast from back in my fly fishing days. You are right, it has to be something locally. I saved everything. restarted and restarted with a very, very basic serialization. I have progressively challenged it with more and more complex serializations.
Sorry for the scare.
.NET 4.8.
Everything looks good now. Sorry for the trouble.
By the way. Great response!!! Thanks for adding the test.
Yes! A River Runs Through It is also one of my favorites. Additionally, there used to be an ad agency by that name and it’s how I earned my first “internet coin” (wayyyyyyy before there was anything like crypto) so I am a fan. 😅
Hah! No worries. If it helps, here’s me doing a faceplant of fail on the ASP.NET Core mothership that was actually due to all my own doing. So, I am very (painfully) familiar with having something not work and reaching out in an attempt to track it down. It’s part of what makes open source so cool. 😃
Very glad to hear you got sorted. If you do have any further questions/issues, please do reach out and I’ll do my best to assist. 👍