473,703 Members | 2,308 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

XmlSerializer constructor fails with xsd.exe generated class

I'm new to .net so here goes.

I'm tying to deserialize a class that is associated with an XML
schema.

I created the C# class with xsd.exe as below:

xsd.exe /c /n:somenamespace properties.xsd

this creates properties.cs

When I do
XmlSerializer s = new XmlSerializer(t ypeof(somenames pace.properties ));

I get the standard exception everyone gets when the DOM compiler fails
("File or assembly name
_utcyjot.0.dll, or one of its dependencies, was not found") (I copied
the dll name from below)

Using Chris Sells' XmlSerializerPr eCompiler tools gives me the
following errors:

c:\Temp\_utcyjo t.0.cs(269,72): error CS0030: Cannot convert type
'somenamespace. simpleref[]' to 'somenamespace. simpleref'
c:\Temp\_utcyjo t.0.cs(570,64): error CS0030: Cannot convert type
'somenamespace. simpleref[]' to 'somenamespace. simpleref'
c:\Temp\_utcyjo t.0.cs(1087,185 ): error CS0029: Cannot implicitly
convert type 'somenamespace. simpleref' to 'somenamespace. simpleref[]'
c:\Temp\_utcyjo t.0.cs(1632,189 ): error CS0029: Cannot implicitly
convert type 'somenamespace. simpleref' to 'somenamespace. simpleref[]'

It appears as though xsd.exe has created a class that crashes
XmlSerializer. Unless I've done something wrong.

Can anyone reproduce this? How do I give you my .net environment
string? Does anyone know a fix/workaround? Have I done something
wrong? Is my xsd too complex for XmlSerializer or xsd.exe?

Any response always deeply appreciated.

Cheers,

keith

------------------------------
properties.xsd - the schema file
------------------------------
<?xml version="1.0"?>

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="propertie s">
<xs:complexType >
<xs:sequence>
<xs:element minOccurs="0" ref="descriptio n" />
<xs:choice maxOccurs="unbo unded">
<xs:element ref="simple" />
<xs:element ref="simplesequ ence" />
<xs:element ref="test" />
<xs:element ref="struct" />
<xs:element ref="structsequ ence" />
</xs:choice>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="simple">
<xs:complexType >
<xs:sequence>
<xs:element minOccurs="0" ref="descriptio n" />
<xs:element minOccurs="0" ref="value" />
<xs:element minOccurs="0" ref="units" />
<xs:element minOccurs="0" ref="range" />
<xs:element minOccurs="0" ref="enumeratio ns" />
<xs:element minOccurs="0" maxOccurs="unbo unded" ref="kind" />
<xs:element minOccurs="0" ref="action" />
</xs:sequence>
<xs:attribute name="id" type="xs:ID" use="required" />
<xs:attribute name="type" use="required">
<xs:simpleTyp e>
<xs:restricti on base="xs:string ">
<xs:enumerati on value="boolean" />
<xs:enumerati on value="char" />
<xs:enumerati on value="double" />
<xs:enumerati on value="float" />
<xs:enumerati on value="short" />
<xs:enumerati on value="long" />
<xs:enumerati on value="objref" />
<xs:enumerati on value="octet" />
<xs:enumerati on value="string" />
<xs:enumerati on value="ulong" />
<xs:enumerati on value="ushort" />
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="name" type="xs:string " />
<xs:attribute name="mode" default="readwr ite">
<xs:simpleTyp e>
<xs:restricti on base="xs:string ">
<xs:enumerati on value="readonly " />
<xs:enumerati on value="readwrit e" />
<xs:enumerati on value="writeonl y" />
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
</xs:element>
<xs:element name="descripti on" type="xs:string " />
<xs:element name="value" type="xs:string " />
<xs:element name="units" type="xs:string " />
<xs:element name="range">
<xs:complexType >
<xs:attribute name="min" type="xs:string " use="required" />
<xs:attribute name="max" type="xs:string " use="required" />
</xs:complexType>
</xs:element>
<xs:element name="enumerati ons">
<xs:complexType >
<xs:sequence>
<xs:element maxOccurs="unbo unded" ref="enumeratio n" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="enumerati on">
<xs:complexType >
<xs:attribute name="label" type="xs:string " use="required" />
<xs:attribute name="value" type="xs:string " />
</xs:complexType>
</xs:element>
<xs:element name="kind">
<xs:complexType >
<xs:attribute name="kindtype" default="config ure">
<xs:simpleTyp e>
<xs:restricti on base="xs:string ">
<xs:enumerati on value="allocati on" />
<xs:enumerati on value="configur e" />
<xs:enumerati on value="test" />
<xs:enumerati on value="execpara m" />
<xs:enumerati on value="factoryp aram" />
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
</xs:element>
<xs:element name="action">
<xs:complexType >
<xs:attribute name="type" default="extern al">
<xs:simpleTyp e>
<xs:restricti on base="xs:string ">
<xs:enumerati on value="eq" />
<xs:enumerati on value="ne" />
<xs:enumerati on value="gt" />
<xs:enumerati on value="lt" />
<xs:enumerati on value="ge" />
<xs:enumerati on value="le" />
<xs:enumerati on value="external " />
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
</xs:element>
<xs:element name="simpleseq uence">
<xs:complexType >
<xs:sequence>
<xs:element minOccurs="0" ref="descriptio n" />
<xs:element minOccurs="0" ref="values" />
<xs:element minOccurs="0" ref="units" />
<xs:element minOccurs="0" ref="range" />
<xs:element minOccurs="0" maxOccurs="unbo unded" ref="kind" />
<xs:element minOccurs="0" ref="action" />
</xs:sequence>
<xs:attribute name="id" type="xs:ID" use="required" />
<xs:attribute name="type" use="required">
<xs:simpleTyp e>
<xs:restricti on base="xs:string ">
<xs:enumerati on value="boolean" />
<xs:enumerati on value="char" />
<xs:enumerati on value="double" />
<xs:enumerati on value="float" />
<xs:enumerati on value="short" />
<xs:enumerati on value="long" />
<xs:enumerati on value="objref" />
<xs:enumerati on value="octet" />
<xs:enumerati on value="string" />
<xs:enumerati on value="ulong" />
<xs:enumerati on value="ushort" />
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="name" type="xs:string " />
<xs:attribute name="mode" default="readwr ite">
<xs:simpleTyp e>
<xs:restricti on base="xs:string ">
<xs:enumerati on value="readonly " />
<xs:enumerati on value="readwrit e" />
<xs:enumerati on value="writeonl y" />
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
</xs:element>
<xs:element name="values">
<xs:complexType >
<xs:sequence>
<xs:element maxOccurs="unbo unded" ref="value" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="test">
<xs:complexType >
<xs:sequence>
<xs:element ref="descriptio n" />
<xs:element minOccurs="0" ref="inputvalue " />
<xs:element ref="resultvalu e" />
</xs:sequence>
<xs:attribute name="id" type="xs:string " use="required" />
</xs:complexType>
</xs:element>
<xs:element name="inputvalu e">
<xs:complexType >
<xs:sequence>
<xs:element maxOccurs="unbo unded" ref="simple" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="resultval ue">
<xs:complexType >
<xs:sequence>
<xs:element maxOccurs="unbo unded" ref="simple" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="struct">
<xs:complexType >
<xs:sequence>
<xs:element minOccurs="0" ref="descriptio n" />
<xs:element maxOccurs="unbo unded" ref="simple" />
<xs:element minOccurs="0" ref="configurat ionkind" />
</xs:sequence>
<xs:attribute name="id" type="xs:ID" use="required" />
<xs:attribute name="name" type="xs:string " />
<xs:attribute name="mode" default="readwr ite">
<xs:simpleTyp e>
<xs:restricti on base="xs:string ">
<xs:enumerati on value="readonly " />
<xs:enumerati on value="readwrit e" />
<xs:enumerati on value="writeonl y" />
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
</xs:element>
<xs:element name="configura tionkind">
<xs:complexType >
<xs:attribute name="kindtype" default="config ure">
<xs:simpleTyp e>
<xs:restricti on base="xs:string ">
<xs:enumerati on value="configur e" />
<xs:enumerati on value="factoryp aram" />
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
</xs:element>
<xs:element name="structseq uence">
<xs:complexType >
<xs:sequence>
<xs:element minOccurs="0" ref="descriptio n" />
<xs:element maxOccurs="unbo unded" ref="structvalu e" />
<xs:element minOccurs="0" ref="configurat ionkind" />
</xs:sequence>
<xs:attribute name="id" type="xs:ID" use="required" />
<xs:attribute name="structref id" type="xs:string " use="required"
/>
<xs:attribute name="name" type="xs:string " />
<xs:attribute name="mode" default="readwr ite">
<xs:simpleTyp e>
<xs:restricti on base="xs:string ">
<xs:enumerati on value="readonly " />
<xs:enumerati on value="readwrit e" />
<xs:enumerati on value="writeonl y" />
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
</xs:element>
<xs:element name="structval ue">
<xs:complexType >
<xs:sequence>
<xs:element maxOccurs="unbo unded" ref="simpleref" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="simpleref ">
<xs:complexType >
<xs:attribute name="refid" type="xs:string " use="required" />
<xs:attribute name="value" type="xs:string " use="required" />
</xs:complexType>
</xs:element>
</xs:schema>

----------------------------
properties.cs generated by xsd.exe
-----------------------------
//------------------------------------------------------------------------------
// <autogenerate d>
// This code was generated by a tool.
// Runtime Version: 1.1.4322.573
//
// Changes to this file may cause incorrect behavior and will be
lost if
// the code is regenerated.
// </autogenerated>
//------------------------------------------------------------------------------

//
// This source code was auto-generated by xsd, Version=1.1.432 2.573.
//
namespace jvms.xmlimport. sca221prf {
using System.Xml.Seri alization;
/// <remarks/>
[System.Xml.Seri alization.XmlRo otAttribute(Nam espace="",
IsNullable=fals e)]
public class properties {

/// <remarks/>
public string description;

/// <remarks/>
[System.Xml.Seri alization.XmlEl ementAttribute( "structsequence ",
typeof(structse quence))]
[System.Xml.Seri alization.XmlEl ementAttribute( "simplesequence ",
typeof(simplese quence))]
[System.Xml.Seri alization.XmlEl ementAttribute( "simple",
typeof(simple))]
[System.Xml.Seri alization.XmlEl ementAttribute( "test",
typeof(test))]
[System.Xml.Seri alization.XmlEl ementAttribute( "struct",
typeof(@struct) )]
public object[] Items;
}

/// <remarks/>
[System.Xml.Seri alization.XmlRo otAttribute(Nam espace="",
IsNullable=fals e)]
public class structsequence {

/// <remarks/>
public string description;

/// <remarks/>
[System.Xml.Seri alization.XmlAr rayItemAttribut e(typeof(simple ref),
IsNullable=fals e)]
public simpleref[][] structvalue;

/// <remarks/>
public configurationki nd configurationki nd;

/// <remarks/>
[System.Xml.Seri alization.XmlAt tributeAttribut e(DataType="ID" )]
public string id;

/// <remarks/>
[System.Xml.Seri alization.XmlAt tributeAttribut e()]
public string structrefid;

/// <remarks/>
[System.Xml.Seri alization.XmlAt tributeAttribut e()]
public string name;

/// <remarks/>
[System.Xml.Seri alization.XmlAt tributeAttribut e()]
[System.Componen tModel.DefaultV alueAttribute(s tructsequenceMo de.readwrite)]
public structsequenceM ode mode = structsequenceM ode.readwrite;
}

/// <remarks/>
[System.Xml.Seri alization.XmlRo otAttribute(Nam espace="",
IsNullable=fals e)]
public class simpleref {

/// <remarks/>
[System.Xml.Seri alization.XmlAt tributeAttribut e()]
public string refid;

/// <remarks/>
[System.Xml.Seri alization.XmlAt tributeAttribut e()]
public string value;
}

/// <remarks/>
[System.Xml.Seri alization.XmlRo otAttribute(Nam espace="",
IsNullable=fals e)]
public class configurationki nd {

/// <remarks/>
[System.Xml.Seri alization.XmlAt tributeAttribut e()]
[System.Componen tModel.DefaultV alueAttribute(c onfigurationkin dKindtype.confi gure)]
public configurationki ndKindtype kindtype =
configurationki ndKindtype.conf igure;
}

/// <remarks/>
public enum configurationki ndKindtype {

/// <remarks/>
configure,

/// <remarks/>
factoryparam,
}

/// <remarks/>
[System.Xml.Seri alization.XmlRo otAttribute(Nam espace="",
IsNullable=fals e)]
public class @struct {

/// <remarks/>
public string description;

/// <remarks/>
[System.Xml.Seri alization.XmlEl ementAttribute( "simple")]
public simple[] simple;

/// <remarks/>
public configurationki nd configurationki nd;

/// <remarks/>
[System.Xml.Seri alization.XmlAt tributeAttribut e(DataType="ID" )]
public string id;

/// <remarks/>
[System.Xml.Seri alization.XmlAt tributeAttribut e()]
public string name;

/// <remarks/>
[System.Xml.Seri alization.XmlAt tributeAttribut e()]
[System.Componen tModel.DefaultV alueAttribute(s tructMode.readw rite)]
public structMode mode = structMode.read write;
}

/// <remarks/>
[System.Xml.Seri alization.XmlRo otAttribute(Nam espace="",
IsNullable=fals e)]
public class simple {

/// <remarks/>
public string description;

/// <remarks/>
public string value;

/// <remarks/>
public string units;

/// <remarks/>
public range range;

/// <remarks/>
[System.Xml.Seri alization.XmlAr rayItemAttribut e(IsNullable=fa lse)]
public enumeration[] enumerations;

/// <remarks/>
[System.Xml.Seri alization.XmlEl ementAttribute( "kind")]
public kind[] kind;

/// <remarks/>
public action action;

/// <remarks/>
[System.Xml.Seri alization.XmlAt tributeAttribut e(DataType="ID" )]
public string id;

/// <remarks/>
[System.Xml.Seri alization.XmlAt tributeAttribut e()]
public simpleType type;

/// <remarks/>
[System.Xml.Seri alization.XmlAt tributeAttribut e()]
public string name;

/// <remarks/>
[System.Xml.Seri alization.XmlAt tributeAttribut e()]
[System.Componen tModel.DefaultV alueAttribute(s impleMode.readw rite)]
public simpleMode mode = simpleMode.read write;
}

/// <remarks/>
[System.Xml.Seri alization.XmlRo otAttribute(Nam espace="",
IsNullable=fals e)]
public class range {

/// <remarks/>
[System.Xml.Seri alization.XmlAt tributeAttribut e()]
public string min;

/// <remarks/>
[System.Xml.Seri alization.XmlAt tributeAttribut e()]
public string max;
}

/// <remarks/>
[System.Xml.Seri alization.XmlRo otAttribute(Nam espace="",
IsNullable=fals e)]
public class enumeration {

/// <remarks/>
[System.Xml.Seri alization.XmlAt tributeAttribut e()]
public string label;

/// <remarks/>
[System.Xml.Seri alization.XmlAt tributeAttribut e()]
public string value;
}

/// <remarks/>
[System.Xml.Seri alization.XmlRo otAttribute(Nam espace="",
IsNullable=fals e)]
public class kind {

/// <remarks/>
[System.Xml.Seri alization.XmlAt tributeAttribut e()]
[System.Componen tModel.DefaultV alueAttribute(k indKindtype.con figure)]
public kindKindtype kindtype = kindKindtype.co nfigure;
}

/// <remarks/>
public enum kindKindtype {

/// <remarks/>
allocation,

/// <remarks/>
configure,

/// <remarks/>
test,

/// <remarks/>
execparam,

/// <remarks/>
factoryparam,
}

/// <remarks/>
[System.Xml.Seri alization.XmlRo otAttribute(Nam espace="",
IsNullable=fals e)]
public class action {

/// <remarks/>
[System.Xml.Seri alization.XmlAt tributeAttribut e()]
[System.Componen tModel.DefaultV alueAttribute(a ctionType.exter nal)]
public actionType type = actionType.exte rnal;
}

/// <remarks/>
public enum actionType {

/// <remarks/>
eq,

/// <remarks/>
ne,

/// <remarks/>
gt,

/// <remarks/>
lt,

/// <remarks/>
ge,

/// <remarks/>
le,

/// <remarks/>
external,
}

/// <remarks/>
public enum simpleType {

/// <remarks/>
boolean,

/// <remarks/>
@char,

/// <remarks/>
@double,

/// <remarks/>
@float,

/// <remarks/>
@short,

/// <remarks/>
@long,

/// <remarks/>
objref,

/// <remarks/>
octet,

/// <remarks/>
@string,

/// <remarks/>
@ulong,

/// <remarks/>
@ushort,
}

/// <remarks/>
public enum simpleMode {

/// <remarks/>
@readonly,

/// <remarks/>
readwrite,

/// <remarks/>
writeonly,
}

/// <remarks/>
public enum structMode {

/// <remarks/>
@readonly,

/// <remarks/>
readwrite,

/// <remarks/>
writeonly,
}

/// <remarks/>
[System.Xml.Seri alization.XmlRo otAttribute(Nam espace="",
IsNullable=fals e)]
public class test {

/// <remarks/>
public string description;

/// <remarks/>
[System.Xml.Seri alization.XmlAr rayItemAttribut e(IsNullable=fa lse)]
public simple[] inputvalue;

/// <remarks/>
[System.Xml.Seri alization.XmlAr rayItemAttribut e(IsNullable=fa lse)]
public simple[] resultvalue;

/// <remarks/>
[System.Xml.Seri alization.XmlAt tributeAttribut e()]
public string id;
}

/// <remarks/>
[System.Xml.Seri alization.XmlRo otAttribute(Nam espace="",
IsNullable=fals e)]
public class simplesequence {

/// <remarks/>
public string description;

/// <remarks/>
[System.Xml.Seri alization.XmlAr rayItemAttribut e("value",
IsNullable=fals e)]
public string[] values;

/// <remarks/>
public string units;

/// <remarks/>
public range range;

/// <remarks/>
[System.Xml.Seri alization.XmlEl ementAttribute( "kind")]
public kind[] kind;

/// <remarks/>
public action action;

/// <remarks/>
[System.Xml.Seri alization.XmlAt tributeAttribut e(DataType="ID" )]
public string id;

/// <remarks/>
[System.Xml.Seri alization.XmlAt tributeAttribut e()]
public simplesequenceT ype type;

/// <remarks/>
[System.Xml.Seri alization.XmlAt tributeAttribut e()]
public string name;

/// <remarks/>
[System.Xml.Seri alization.XmlAt tributeAttribut e()]
[System.Componen tModel.DefaultV alueAttribute(s implesequenceMo de.readwrite)]
public simplesequenceM ode mode = simplesequenceM ode.readwrite;
}

/// <remarks/>
public enum simplesequenceT ype {

/// <remarks/>
boolean,

/// <remarks/>
@char,

/// <remarks/>
@double,

/// <remarks/>
@float,

/// <remarks/>
@short,

/// <remarks/>
@long,

/// <remarks/>
objref,

/// <remarks/>
octet,

/// <remarks/>
@string,

/// <remarks/>
@ulong,

/// <remarks/>
@ushort,
}

/// <remarks/>
public enum simplesequenceM ode {

/// <remarks/>
@readonly,

/// <remarks/>
readwrite,

/// <remarks/>
writeonly,
}

/// <remarks/>
public enum structsequenceM ode {

/// <remarks/>
@readonly,

/// <remarks/>
readwrite,

/// <remarks/>
writeonly,
}

/// <remarks/>
[System.Xml.Seri alization.XmlRo otAttribute(Nam espace="",
IsNullable=fals e)]
public class enumerations {

/// <remarks/>
[System.Xml.Seri alization.XmlEl ementAttribute( "enumeratio n")]
public enumeration[] enumeration;
}

/// <remarks/>
[System.Xml.Seri alization.XmlRo otAttribute(Nam espace="",
IsNullable=fals e)]
public class values {

/// <remarks/>
[System.Xml.Seri alization.XmlEl ementAttribute( "value")]
public string[] value;
}

/// <remarks/>
[System.Xml.Seri alization.XmlRo otAttribute(Nam espace="",
IsNullable=fals e)]
public class inputvalue {

/// <remarks/>
[System.Xml.Seri alization.XmlEl ementAttribute( "simple")]
public simple[] simple;
}

/// <remarks/>
[System.Xml.Seri alization.XmlRo otAttribute(Nam espace="",
IsNullable=fals e)]
public class resultvalue {

/// <remarks/>
[System.Xml.Seri alization.XmlEl ementAttribute( "simple")]
public simple[] simple;
}

/// <remarks/>
[System.Xml.Seri alization.XmlRo otAttribute(Nam espace="",
IsNullable=fals e)]
public class structvalue {

/// <remarks/>
[System.Xml.Seri alization.XmlEl ementAttribute( "simpleref" )]
public simpleref[] simpleref;
}
}
Nov 12 '05 #1
5 7286
Hi Keith,

Did you get an answer to your question you posted on the online .net
forum on Sep 02, 2004.

I ran into the same problem and would like to know.

Thanks

Andy

Nov 12 '05 #2
Hi Andy,

I've had no replies to this at all, and not been able to solve it.

I was hoping either a Microsoft guy would acknowledge it as a bug, or
someone would tell me what I've done wrong. Neither has happened.

I found something somewhere, perhaps on this newsgroup, posted by a
Micrsoft developer who said XmlSerializer/Xsd.exe would crash when using
complex schema, or jagged arrays. I don't think I've got jagged arrays,
and I didn't think my schema was all that complex.

It seems like it's a known issue in Microsoft (dunno if it's in
KnowledgeBase).

It'd be nice if you could do something like:

try {
doComplexCompli ledWay();
} catch (CompilerExcept ion compilerBug) {
logToMicrosoft( compilerBug);
doSlowButReliab leWay();
}

But alas no.

I've basically given up on the project, but would like to start it up
again if I can get around this bug.

This was my first C# application. It was a bit disappointing to have it
die this early.

Anyway, let me know if you find anything out.

Cheers,

keith
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 12 '05 #3
Keith,

One hack is to remove the "maxoccurs" associated with the field in the
schema. This will get you past the problem.

But, I could only do this because I wasn't using those fields in the
schema I am using (ACORD).

Nov 12 '05 #4
Thanks for that! The xsd is actually automatically generated from a dtd,
so I can probably get rid of that field. I'll have a go when I get a
spare second (a few weeks at best, I'm afraid) and get back to see if it
works.

Cheers!

Keith

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 12 '05 #5
Thanks Vitaleaf! :D I was having the same problem, and taking out the
maxOccurs attribute it works! The difference is that I'm using the
troubled element (is a collection of stock prices).

I came here through google, and I find the answer I was looking for
one week, thank guys!

Greets from Argentina

Nov 12 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1427
by: Johan Appelgren | last post by:
Hi, I'm trying to serialize a class hierarchy using System.Xml.Serialization.XmlSerializer from a class that is loaded as a Com object. But it fails with a InvalidCastException. I don't know what I'm doing wrong and it seems even the most simple cases fail. I tried with a simple class that looks like this public class Class1 {
6
2040
by: Nafai | last post by:
Hello. I want to do something like this: class A { // It's virtual protected: float* data; int n; public: A(int a); virtual float* createData(); //...
0
3027
by: keith bannister via .NET 247 | last post by:
(Type your message here) -------------------------------- From: keith bannister Hi, I'm new to .net (as of last week) but here goes. I want to serialize/deserialize a file the conforms to an XML schema (xsd).
12
8491
by: SJD | last post by:
I've just read Christoph Schittko's article on XmlSerializer: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnxmlnet/html/trblshtxsd.asp . . . and very informative it is too. I, too, am getting nasty FileNotFound exceptions. I've read, and digested the article, and I think I've found a bug -- it's difficult to track, though it does happen often.
4
1991
by: Steve Long | last post by:
Hello, I hope this is the right group to post this to. I'm trying to serialize a class I've written and I'd like to be able to serialze to both binary and xml formats. Binary serialization is working fine but when I try to instantiate an XmlSerializer object with: Dim xmls As New XmlSerializer(GetType(CLayerDefinition)) I get the following error:
0
1175
by: Jeff T. | last post by:
I cannot figure out how to get my class to serialize the way I want it to. Basically, I have generated a number of classes using the XSD utility. I then created a derived class from one of the generated classes to add a default constructor and helper methods. When this class serializes, it includes the xsi:type attribute of my derived type. Because my derived type is not in my schema, validation fails. How can I get my derived type to...
4
2693
by: BuddyWork | last post by:
Hello, When running the following line of code XmlSerializer serializer = new XmlSerializer(typeof (MyXmlTestClass)); I get the following exception message. An unhandled exception of
8
5458
by: cd~ | last post by:
I can provide a test app, the news server won't allow me to post the files because they are too large (93KB and 1.2KB) I downloaded the ESRI ArcXml schema and generated the classes from the schema using xsd.exe, which took a while because xsd doesn't handle recursive elements very well (StackOverFlow exception during generation). Now that I have the classes I am trying to serialize them to an xml document to send to ArcIMS to generate...
0
2628
by: =?Utf-8?B?QW1hemVkc2FpbnQ=?= | last post by:
The simple constructors of XMLSerializer class caches the typed serializer once it is generated. (Probably as you know, other XMLSerializer constructors will result in a memory leak because they will generate the assembly each time instead of using the cached one) a) When an XMLSerializer is used from ASP.NET, where exactly the generated typed serializer is getting cached? What is the probability/crieteria for the object in the cache...
0
9251
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9122
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9017
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7872
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6588
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4433
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3125
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2453
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2069
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.