ThinkGeo.com    |     Documentation    |     Premium Support

Error serializing ImagePrinterLayer

Hi,

We are in the process of upgrading to MS Desktop 10. While using the GeoSerializer I ran into an error while trying to serialize an ImagePrinterLayer. The following exception occurs:


Detailed technical information follows:

Date and Time: 1/23/2018 1:00:29 PM
Machine Name: STEVEM6800
IP Address: fe80::4db3:57ed:955c:6826%14
Current User: STEVEM6800\steller

Application Domain: GeoSuite.vshost.exe
Assembly Codebase: file:///C:/Silvics/Visual Studio/GeoFrame/GeoFrame/bin/Debug/GeoSuite.EXE
Assembly Full Name: GeoSuite, Version=2.1.4.0, Culture=neutral, PublicKeyToken=null
Assembly Version: 2.1.4.0
Assembly Build Date: 1/23/2018 12:55:47 PM

Exception Source: System.Xml
Exception Type: System.ArgumentException
Exception Message: Invalid name character in ‘YyU=’. The ‘=’ character, hexadecimal value 0x3D, cannot be included in a name.
Exception Target Site: CheckNCName

---- Stack Trace ----
System.Xml.XmlWellFormedWriter.CheckNCName(ncname As String)
GeoSuite.EXE: N 6696237
System.Xml.XmlWellFormedWriter.WriteStartElement(prefix As String, localName As String, ns As String)
GeoSuite.EXE: N 00750
System.Xml.XmlWriter.WriteElementString(localName As String, ns As String, value As String)
GeoSuite.EXE: N 00033
ThinkGeo.MapSuite.Serialize.XmlGeoSerializationFormatter.eSQ=(node As GeoObjectNode, xmlWriter As XmlWriter)
GeoSuite.EXE: N 00121
ThinkGeo.MapSuite.Serialize.XmlGeoSerializationFormatter.eSQ=(node As GeoObjectNode, xmlWriter As XmlWriter)
GeoSuite.EXE: N 00491
ThinkGeo.MapSuite.Serialize.XmlGeoSerializationFormatter.eSQ=(node As GeoObjectNode, xmlWriter As XmlWriter)
GeoSuite.EXE: N 00491
ThinkGeo.MapSuite.Serialize.XmlGeoSerializationFormatter.SaveCore(model As GeoObjectModel, stream As Stream)
GeoSuite.EXE: N 00131
ThinkGeo.MapSuite.Serialize.GeoSerializer.Serialize(objectToSerialize As Object, targetPathFilename As String)
GeoSuite.EXE: N 00106
MapUtilities.SilvicsPageLayout.SerializeLayoutTemplate(oGeoSerializer As GeoSerializer, sTempZipFileName As String, sFolder As String, oFilesToDelete As Collection`1)
SilvicsPageLayout.vb: line 2303, col 04, IL 0358
MapUtilities.WorkingSet.SaveWorkingSet(oToc As SilvicsTocControl, sCurrentFileName As String&)
WorkingSet.vb: line 0235, col 04, IL 1115

Is this a bug?

Thanks!

Steve

Hi Steve,

I tried to serialize an ImagePrinterLayer instance by GeoSerializer like this:
GeoSerializer geoSerializer = new GeoSerializer();
geoSerializer.Serialize(imagePrinterLayer);

I used the latest stable package, but it looks the exception hadn’t been thrown, so I think maybe your layer contains some other objects.

After that our developer view the ImagePrinterLayer, they also hadn’t found problem there.

Could you please paste some code here so we can look into it?

Regards,

Ethan

Hi Ethan,

Here is a sample project which will demonstrate the problem.

Steve

Serialization Bug.zip (87.8 KB)

Hi Setven,

Thanks for your sample, that’s caused by some change in GeoImage.

Please get https://www.nuget.org/packages/ThinkGeo.MapSuite/11.0.0-beta052, which should had fixed that.

Regards,

Ethan

1 Like

Ethan,

Thank-you, it works! When can I get the production version?

Cheers!

Steve

Hi Steve,

We will move that today, please wait this version: https://www.nuget.org/packages/ThinkGeo.MapSuite/10.2.6

I think this will be available in one days.

Regards,

Ethan

Hi Ethan,

I’m still receiving the exception with ThinkGeo.MapSuite/10.2.6.

Thanks,

Steve

Hi Steve,

It looks the new version upload failed, and I provide incorrect version name.

That should be 10.2.7, because the 10.2.6 is earlier than beta052.

Regards,

Ethan

1 Like

Awesome! It’s working fine with version 10.2.7

Thank-you!

Steve

Hi Steve,

I am glad to hear that works.

Regards,

Ethan

Well…

The image layer now serializes and deserializes OK but there is an error drawing the ImagePrinterLayer after it is deserialized. I have attached a sample project. After the project is started, click the ‘Serialize’ button. Then click the ‘Deserialize’ button. There is an error attempting to draw the ImagePrinterLayer.

Thanks!

Steve

Serialization Bug.zip (111.1 KB)

Hi Steve,

Thanks for your sample and detail reproduce steps.

We reproduced that, the exception is thrown in the code: bitmap.SetResolution(Dpi, Dpi), which is called many times, and the error is .

So that should be not easy to be solved, I have sent it to our developer, any update about that I will let you know.

Regards,

Ethan

Ethan,

Thanks for the information. I have a workaround I can use until this issue is resolved.

Thanks!

Steve

Hi Steve,

Our developer works for this problem and did some changes, please try this package https://www.nuget.org/packages/ThinkGeo.MapSuite/11.0.0-beta058 and see whether it works for you.

But please notice, this change effect many core classes, it maybe a broken change before enough test, so we won’t move it to release before next minor release.

Regards,

Ethan

Ethan,

It works fine with MapSuite/11.0.0-beta058. I understand that releasing the fix in a production version will take awhile. I can use my workaround until then.

Thanks for your help!

Steve

Hi Steven,

It is glad to hear that works for you.
If there is any issue when using MapSuite, please feel free to let us know that.

Thanks
Mark