Skip to main content
Filter by
Sorted by
Tagged with
0 votes
0 answers
39 views

I am working with XML serialization in C# where I have multiple versions of a message class that inherit from each other. Here’s a simplified version of my code: namespace XMLSerializeProblem.Base { ...
Yash2304's user avatar
1 vote
1 answer
82 views

I'm working with a .NET 8 codebase that uses DataContractSerializer to convert an object model into XML and back again (for storing in a file system). At the moment, none of the classes used in the ...
David Keaveny's user avatar
1 vote
1 answer
50 views

I need to generate some .xml given an example file. I notice that some of the nodes break convention and are camelCase instead of PascalCase. I'd like my code models to keep good conventions, but ...
eriyg's user avatar
  • 162
0 votes
0 answers
43 views

I have a C# class that includes a string property: public string Location { get => _Location; set => _Location = value; } private string _Location; I use XmlSerializer for reading and writing ...
Andrew Truckle's user avatar
0 votes
2 answers
56 views

I am trying to generate this Soap XML: <soapenv:Envelope xmlns:bsvc="urn:com.workday/bsvc" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0....
Rita's user avatar
  • 11
1 vote
1 answer
65 views

I have been having problem with deseriailizing XML code genereated by XmlSerializer when child classes are used. The UnknownAttribute and UnknownNode events triggers and I assumed there was an error ...
qnyz's user avatar
  • 505
0 votes
2 answers
71 views

I have some derived classes to serialize to XML: public void Main() { LevelCollection collection = new LevelCollection(); collection.Add(new SubLevel1("aaa")); ...
Radek S's user avatar
0 votes
1 answer
37 views

I'm trying to read two Aux files with one class, but I'm having trouble. I'm getting an error when I try to serialize my class. The xml schema is defined by a third-party and I can't change it. The ...
이주영's user avatar
0 votes
3 answers
123 views

I am working on a deserializer in C# for an XML file type for a program I don't have any control over. Unfortunately, the XML file structure completely breaks conventions in two major ways, as far as ...
Groove Wizard's user avatar
1 vote
1 answer
116 views

I want to (de)serialize internal classes. internal class Data { public string? Name { get; set; } public string? Type { get; set; } public List<DataWithAttribute> DataList { get; set;...
Kartopelka's user avatar
0 votes
0 answers
166 views

I am calling the following constructor: var serializer = new XmlSerializer(typeof(List<Slot>)); and end up with this exception in the log : Unable to resolve assembly System.Private.CoreLib....
Cervelle's user avatar
2 votes
1 answer
48 views

My goal is to output XML like the sample below: <FunctionList name="list1"> <Space title="RoomA"> <Space title="Cabinet1"> <Device title="...
Lennart's user avatar
  • 102
1 vote
1 answer
81 views

I'm using C++ boost::serialization library to read and write configuration XMLs. To provide backward compatibility to the user, while reading an XML if some XML elements are absent, it needs to have ...
Rishad C's user avatar
0 votes
0 answers
109 views

In my ASP.NET Core project, I have a custom type which needs to be serialized using some external service: public struct MyCustomType { private int value; public MyCustomType(int value) { ...
Ozren Kinkela's user avatar
0 votes
1 answer
159 views

This is my class: [XmlRoot(ElementName = "Package")] public class Package<T>: MyBase { public Messages<T> Messages { get { return _messages; } set { ...
Lucy82's user avatar
  • 693
-1 votes
1 answer
102 views

I am serializing an XML file with the classes created automatically with paste special of an XML. I did everything without problems, more than 3,000 lines (and the Xml file more than 600), but I have ...
Paco's user avatar
  • 1
0 votes
1 answer
97 views

I am using boost ( 1.69.0 ) serialization to generate an XML template file. The result I want to achieve is unfortunately bad. This is example code: struct A { struct B { int bInt; ...
Zozus's user avatar
  • 11
1 vote
1 answer
184 views

I want to be able to write fragments of indented XML with no namespaces, no XML preambles, and \n for line endings, using XmlSerializer for each fragment and using a single XmlWriter instance for all ...
Dmitry Avtonomov's user avatar
0 votes
1 answer
46 views

In case my xml file has the non-pretty format: <ArrayOfColumn><Column><COLUMN_NAME>SomeName1</COLUMN_NAME></Column><Column><COLUMN_NAME>SomeName2</...
Shahar Shokrani's user avatar
0 votes
1 answer
85 views

I have simple C#9 positional record with an empty constructor (in addition to primary one): public record FiscalTag(int Code, string Value, List<FiscalTag> ChildTags) { public FiscalTag() : ...
bairog's user avatar
  • 3,539
0 votes
1 answer
67 views

In the process of serializing to XML file, I'm encountering an infinite loop issue. I'm using java.beans, and through XMLEncoder, I'm attempting to serialize three classes: Category, Contact, and ...
KopyKay's user avatar
  • 31
1 vote
1 answer
164 views

I am facing an issue while deserializing/serializing XML into a C# object. The XML structure has mixed order of elements, and I am encountering problems with elements that have the same name but ...
Nick G's user avatar
  • 13
0 votes
1 answer
104 views

Experienced with PowerShell, but new to C#. I am creating a Binary PowerShell Cmdlet and have run into an issue when trying to serialize PSCredential to XML with the XmlSerializer. When I serialize ...
Qrm's user avatar
  • 13
0 votes
0 answers
25 views

I have two types of file XML that share some common information but also have some specialization: <Source Alias="Hrc"> <Variable HandleType="Ext.Poll"> <Id&...
vent1's user avatar
  • 13
1 vote
2 answers
311 views

Im trying to Deserialize a XML im getting from a service. But the XmlSerializer failes when encountering the first attribute. My shortened xml looks like this: <?xml version="1.0" ...
merger's user avatar
  • 734
0 votes
1 answer
37 views

I have the following classes: public interface IVariable { string Name { get; } dynamic Value { get; set; } } public class Namespace : IVariable, IXmlSerializable, IEnumerable<IVariable>...
RoadieRich's user avatar
  • 6,679
2 votes
1 answer
212 views

So I'm building a simulated file-system in C++ to study the language better and maybe some system level programming. Im using Boost::Serialization to save the state of the file system when the user ...
Panagiotis Foliadis's user avatar
0 votes
0 answers
52 views

I have a custom serializable generic collection, defined (a simplified example) like this: [Serializable] public class ArrayOfItems<T> : IEnumerable<T> { [XmlAttribute("Setting&...
ElDog's user avatar
  • 1,417
-1 votes
1 answer
79 views

<n-hierarchy> <n name="ABC" n_id="971" /> <n name="XYZ" n_id="972"> <n name="jkl" n_id="973"> ...
VInayK's user avatar
  • 1,559
0 votes
0 answers
781 views

I'm working with code in C# trying to serialize an object to XML. I cannot add XML attributes or extra properties (e.g. bool ShouldSerializeFoo) to this object. Nor can I add any [Xml*] attributes to ...
Scott DePouw's user avatar
  • 3,979
0 votes
0 answers
71 views

I am migrating a WCF client application from DotNet Framework to DotNet (Core) 7. The object I am using serializes using ASCII character 0x07 as a separator, which under DotNet Framework would be ...
Andy W's user avatar
  • 229
0 votes
0 answers
99 views

Problem I have a large file that was serialized using BinaryFormatter that I need to create a class for, so that I can serialize similar files. What I have tried I came across this answer that ...
Tyler's user avatar
  • 333
0 votes
2 answers
102 views

I know how to serialize a "Date" to / from XML using C#: [XmlElement(DataType ="date")] public DateTime LastInvited { get => _LastInvited; set => _LastInvited = value; } ...
Andrew Truckle's user avatar
0 votes
2 answers
344 views

I would like to update an old piece of code, but I can't find the correct way to do it with the new system suggested from the deprecated class XmlSerializer, it was deprecated in Xerces 2.9.0. and it ...
4535992's user avatar
  • 418
0 votes
1 answer
608 views

How to make the example working in Swagger while still having [Produces("application/json", "application/xml")] definition in controller method. In .Net Core 6 API, have set up ...
Beli's user avatar
  • 3
0 votes
2 answers
55 views

I have a class implements IXmlSerializable, after ReadXml been called, the deserialization process returns and ignore other properties. The xml file is completed, but when deserial it, only the first ...
Lamp's user avatar
  • 442
0 votes
0 answers
25 views

I have a problem with serialization c# in .net public class User { public int Id { get; set; } public string Name { get; set; } public string Email { get; set; } } Is possible to control ...
Radamanthys's user avatar
0 votes
2 answers
62 views

I am working on an application where I need to convert string XML into C# object but I am receiving following error. There is an error in XML document (1, 23) InvalidOperationException: was not ...
Muhammad Kamran's user avatar
1 vote
1 answer
93 views

I'm supporting a legacy, internal API that uses two classes that are serialized using XML. Both classes are sub-classes of a common base class: namespace My.Namespace { [ Serializable, ...
FunctionalFolds's user avatar
0 votes
1 answer
264 views

I'm working on creating service that talks with Finn API, that requires XML instead of JSON. Based on *.dtd file and xsdata library I generated classes that allows me to build an request object and ...
Krystian's user avatar
0 votes
0 answers
230 views

I need to be able to save a delegate with the information of which function it is connected to. Something like this: In C#: public class Skill { [XmlAttribute("SkillFunction")] ...
user avatar
1 vote
1 answer
223 views

Good day all, I have trouble adding namespaces correctly to my XML. Both the parent and child elements have the own namespaces. When restructure the code I have gotten mixed results. My sample code ...
learning's user avatar
1 vote
0 answers
42 views

I have a pretty simple console application. Ignoring missing checks, the program is as follows: using System.Drawing; using System.Xml; using System.Xml.Schema; using System.Xml.Serialization; ...
Doshorte  Dovencio's user avatar
1 vote
1 answer
37 views

I recently had an issue that I traced to the fact that when I serialize/deserialize a DataSet to and from XML using WriteXML/ReadXML at very specific times near a DST changeover, the DateTimes are not ...
user21414783's user avatar
-1 votes
1 answer
368 views

I want to deserialize this kind of XML-files that have SOAP-envelope and invalid .xsd address in the header that doesn't exist anymore (finvoiceack.xsd). Would like to get the nodes to dataset or into ...
Janizei's user avatar
0 votes
3 answers
243 views

I need to serialize an XML to attach for an API PUT request. I am using System.Xml.Serialization. The end result needs to resemble the following: <?xml version="1.0" encoding="UTF-8&...
tbproto's user avatar
1 vote
1 answer
1k views

I'm trying to deserialize an xml response I get from a call. I've used Visual Studios "Paste Special" function to prepare my program for how the file is gonna look, and the only change I've ...
Kiesp's user avatar
  • 76
0 votes
1 answer
333 views

Consider the following minimal example (fiddle): using System; using System.IO; using System.Xml.Serialization; public class Program { public class C { public string S { get; ...
Heinzi's user avatar
  • 173k
-2 votes
1 answer
793 views

Passing the root to the xsd.exe, successfully generates the Classes with the proper structure according to the XSD, we can now assign values to the objects of those classes and populate them, the ...
Ariox66's user avatar
  • 670
1 vote
0 answers
150 views

Is there a built-in (or 3rd party) mechanism/library/analyzer that can be used to validate that the xml serialization attributes on a class/property matches the schema. I know that you can't do full ...
Christopher Haws's user avatar

1
2 3 4 5
94