Click here to Skip to main content
15,886,919 members
Home / Discussions / C#
   

C#

 
GeneralRe: Function waiting Pin
pradnya_k2-Oct-09 1:41
pradnya_k2-Oct-09 1:41 
QuestionHow to wait for a window to appear before sending keystrok using sendkeys? Pin
Paramhans Dubey30-Sep-09 20:31
professionalParamhans Dubey30-Sep-09 20:31 
AnswerRe: How to wait for a window to appear before sending keystrok using sendkeys? Pin
Mycroft Holmes30-Sep-09 23:28
professionalMycroft Holmes30-Sep-09 23:28 
AnswerRe: How to wait for a window to appear before sending keystrok using sendkeys? Pin
Luc Pattyn30-Sep-09 23:58
sitebuilderLuc Pattyn30-Sep-09 23:58 
GeneralRe: How to wait for a window to appear before sending keystrok using sendkeys? Pin
Paramhans Dubey1-Oct-09 0:23
professionalParamhans Dubey1-Oct-09 0:23 
GeneralRe: How to wait for a window to appear before sending keystrok using sendkeys? Pin
Paramhans Dubey1-Oct-09 0:24
professionalParamhans Dubey1-Oct-09 0:24 
GeneralRe: How to wait for a window to appear before sending keystrok using sendkeys? Pin
Luc Pattyn1-Oct-09 0:48
sitebuilderLuc Pattyn1-Oct-09 0:48 
QuestionIssues with XML Deserializing of List Pin
User 1278230-Sep-09 19:44
User 1278230-Sep-09 19:44 
I have an object (InputFile) that I am able to successfully serialize to XML and deserialize back into the object through an IXmlSerializable interface.

Now I'm trying to serialize a List<inputfile> to XML. I'm using the following code:

XmlSerializer s = new XmlSerializer(typeof(List<Inputs.InputFile>));
TextWriter w = new StreamWriter("c:\\out.xml");

XmlSerializerNamespaces ns = new XmlSerializerNamespaces();
ns.Add("", "");

w.Serialize(w, Global.Pool.InputFiles, ns);
w.Close();


This produces the following XML:

<?xml version="1.0" encoding="utf-8"?>
<ArrayOfInputFile>
  <InputFile FileName="file1.hdr" GUID="XYZ" TimeShift="0">
  //objects from a list in the InputFile list
  </InputFile>
  <InputFile FileName="file2.hdr" GUID="ABC" TimeShift="0">
  //objects from a list in the InputFile list
  </InputFile>
</ArrayOfInputFile>


This looks well formed and good to me.

I use the following to deserialize:
XmlSerializer s = new XmlSerializer(typeof(Inputs.InputFile));
TextReader r = new StreamReader("c:\\out.xml");

List<Inputs.InputFile> a = (List<Inputs.InputFile>)s.Deserialize(r);
r.Close();


I get an exception on the Deserialize line:
InvalidOperationException: {"There is an error in XML document (2, 2)."}
{"<ArrayOfInputFile xmlns=''> was not expected."}

I've had no issues Serializing/Deserializing List<>s before.

Any ideas where I went wrong?

Thanks,
Aaron

modified 12-Jul-20 21:01pm.

AnswerRe: Issues with XML Deserializing of List Pin
SeMartens30-Sep-09 22:14
SeMartens30-Sep-09 22:14 
GeneralRe: Issues with XML Deserializing of List Pin
User 127821-Oct-09 6:01
User 127821-Oct-09 6:01 
GeneralRe: Issues with XML Deserializing of List Pin
SeMartens1-Oct-09 21:29
SeMartens1-Oct-09 21:29 
GeneralRe: Issues with XML Deserializing of List Pin
User 127822-Oct-09 10:01
User 127822-Oct-09 10:01 
GeneralRe: Issues with XML Deserializing of List Pin
User 127822-Oct-09 10:54
User 127822-Oct-09 10:54 
QuestionHow to create a powerpoint chart using C# code? Pin
Ahsan Nabi Khan30-Sep-09 19:36
Ahsan Nabi Khan30-Sep-09 19:36 
QuestionIT Help desk Pin
mirianakoi30-Sep-09 17:33
mirianakoi30-Sep-09 17:33 
AnswerRe: IT Help desk Pin
Christian Graus30-Sep-09 17:36
protectorChristian Graus30-Sep-09 17:36 
GeneralRe: IT Help desk Pin
mirianakoi6-Oct-09 17:01
mirianakoi6-Oct-09 17:01 
GeneralRe: IT Help desk Pin
Shamaniac27-Jun-11 19:19
Shamaniac27-Jun-11 19:19 
AnswerRe: IT Help desk Pin
AndieDu30-Sep-09 17:42
AndieDu30-Sep-09 17:42 
GeneralRe: IT Help desk Pin
mirianakoi6-Oct-09 17:03
mirianakoi6-Oct-09 17:03 
AnswerRe: IT Help desk Pin
Blikkies30-Sep-09 19:52
professionalBlikkies30-Sep-09 19:52 
GeneralRe: IT Help desk Pin
Mycroft Holmes30-Sep-09 23:01
professionalMycroft Holmes30-Sep-09 23:01 
GeneralRe: IT Help desk Pin
Blikkies1-Oct-09 4:06
professionalBlikkies1-Oct-09 4:06 
GeneralRe: IT Help desk Pin
Mycroft Holmes1-Oct-09 12:25
professionalMycroft Holmes1-Oct-09 12:25 
GeneralRe: IT Help desk Pin
mirianakoi6-Oct-09 17:05
mirianakoi6-Oct-09 17:05 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.