1

I have a schema file I used to generate corresponding classes in C# with xsd2code. When I run the application in VS2010 debugger, I get all the data from my xml file in, but when I run .exe from cmd, some of the data is not loaded. Any ideas why or how to find out why?

 ...
 // reading file storing into a buffer
 Stream bufStream = new MemoryStream(buffer);
 using (TextReader textReader = new StreamReader(bufStream))
 {
     XmlSerializer deserializer = new XmlSerializer(typeof(ReportTypeFromXSD));
     ReportTypeFromXSD rep = (ReportTypeFromXSD)deserializer.Deserialize(textReader);


     ...
     foreach(PersonType person in rep.Persons)
     {
         ...
         // check if the node data is present             
         if( person.residentialHist != null && person.residentialHist.Count > 0 )
         {
           // Log how many there and load Into DB               
         }
         // check if the node data is present
         if( person.employmentHist != null && person.employmentHist.Count > 0 )
         {
           // Log how many there and load Into DB               

         }
         ...
     }
 }

So, when I run from debugger, I always get the employment history loaded, but when I run it as a windows task, I don't get employment history at all.

Thanks, Jenny

Boroda
  • 195
  • 1
  • 7
  • 23

0 Answers0