C# Windows Form View Designer Showing error

Posted by: ajmesh3 on 13 May 2023, 3:20 am EST

  • Posted 13 May 2023, 3:20 am EST

    Recently I have upgraded my application from .net 4.8 to .net 6.

    In many forms (not all) in which C1.Win.TrueDBGrid.C1TrueDBGrid control is used showing given below error.

    Any help please?

    Type ‘System.Drawing.Printing.PageSettings’ in Assembly ‘System.Drawing.Common, Version=6.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51’ is not marked as serializable.

    Instances of this error (1)

    1. Hide Call Stack

    at System.Runtime.Serialization.FormatterServices.InternalGetSerializableMembers(Type type)

    at System.Runtime.Serialization.FormatterServices.<>c.b__5_0(MemberHolder mh)

    at System.Collections.Concurrent.ConcurrentDictionary

    2.GetOrAdd(TKey key, Func
    2 valueFactory)

    at System.Runtime.Serialization.FormatterServices.GetSerializableMembers(Type type, StreamingContext context)

    at System.Runtime.Serialization.Formatters.Binary.ReadObjectInfo.InitMemberInfo()

    at System.Runtime.Serialization.Formatters.Binary.ReadObjectInfo.InitReadConstructor(Type objectType, ISurrogateSelector surrogateSelector, StreamingContext context)

    at System.Runtime.Serialization.Formatters.Binary.ObjectMap…ctor(String objectName, String memberNames, BinaryTypeEnum binaryTypeEnumA, Object typeInformationA, Int32 memberAssemIds, ObjectReader objectReader, Int32 objectId, BinaryAssemblyInfo assemblyInfo, SizedArray assemIdToAssemblyTable)

    at System.Runtime.Serialization.Formatters.Binary.BinaryParser.ReadObjectWithMapTyped(BinaryObjectWithMapTyped record)

    at System.Runtime.Serialization.Formatters.Binary.BinaryParser.ReadObjectWithMapTyped(BinaryHeaderEnum binaryHeaderEnum)

    at System.Runtime.Serialization.Formatters.Binary.BinaryParser.Run()

    at System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(BinaryParser serParser)

    at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream)

    at Microsoft.DotNet.DesignTools.Utilities.Resources.ResXDataNode.GenerateObjectFromDataNodeInfo(DataNodeInfo dataNodeInfo, ITypeResolutionService typeResolver)

    at Microsoft.DotNet.DesignTools.Utilities.Resources.ResXResourceReader.ParseDataNode(XmlTextReader reader, Boolean isMetaData)

    at Microsoft.DotNet.DesignTools.Utilities.Resources.ResXResourceReader.ParseXml(XmlTextReader reader) sampleForm.zip

  • Posted 15 May 2023, 1:20 am EST

    Hi Ajmesh,

    It seems like you have created a similar case on our support portal as well (Case ID: CAS-40386-F8Y7C4). We have replied to your query there and request you continue the thread there to avoid confusion.

    Best Regards,

    Kartik

  • Posted 12 March 2025, 10:13 pm EST

    I’m having the same issue - could someone please post the solution for this error?

  • Posted 13 March 2025, 12:05 am EST

    Hi,

    In the older versions, the C1TrueDBGrid.PrintInfo.PageSettings property used to be set in the .resx file. But in the latest versions, it is not set in the .resx file and instead, it is set internally.

    Therefore, to fix the issue, please delete the entry for C1TrueDBGrid.PrintInfo.PageSettings property from your Form’s .resx file. The entry is shown in the attached screenshot - ResxEntry.zip

    Best Regards,

    Kartik

  • Posted 13 March 2025, 12:33 am EST - Updated 13 March 2025, 12:33 am EST

    I found the suggestion already Googling … but shouldn’t this be part of the migration guide for C1 components from .NET 4.8 > .NET 6/7/8/9 ? I strongly suggest this is included, including hints for editing the lay-out of (legacy) C1TrueDbGrid objects using the Columns or Splits > DisplayColumns designer properties.

    I suspect other people struggle with the same issues during migration.

  • Posted 17 March 2025, 12:52 am EST

    Hi,

    We completely understand your concerns. However, we currently do not have a dedicated migration guide for transitioning from .NET Framework 4.8 to .NET 6+. If we plan to create one, we will definitely consider adding this point.

    While migrating our controls from .NET Framework 4.8 to .NET 6+, we ensured that the APIs remained as similar as possible. This means there are no major changes for customers migrating their applications. However, due to architectural differences, there may be minor changes that need to be handled manually.

    Regarding C1TrueDBGrid, it is not under active development and is currently in maintenance mode, meaning only critical customer-reported bugs are fixed. The C1TrueDBGrid control was ported to .NET 6+ due to requests from existing customers migrating their applications. However, our main focus remains on the FlexGrid control.

    Best Regards,

    Kartik

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels