Click here to Skip to main content
15,913,941 members
Home / Discussions / C#
   

C#

 
QuestionProblem with Microsoft.Office.Interop.Excel.dll [modified] Pin
mcnam21-Sep-08 18:30
mcnam21-Sep-08 18:30 
AnswerRe: Problem with Microsoft.Office.Interop.Excel.dll Pin
stancrm21-Sep-08 20:24
stancrm21-Sep-08 20:24 
GeneralRe: Problem with Microsoft.Office.Interop.Excel.dll Pin
mcnam21-Sep-08 20:37
mcnam21-Sep-08 20:37 
GeneralRe: Problem with Microsoft.Office.Interop.Excel.dll Pin
stancrm21-Sep-08 20:41
stancrm21-Sep-08 20:41 
GeneralRe: Problem with Microsoft.Office.Interop.Excel.dll Pin
mcnam21-Sep-08 21:48
mcnam21-Sep-08 21:48 
QuestionMing Pin
netJP12L21-Sep-08 18:09
netJP12L21-Sep-08 18:09 
AnswerRe: Ming Pin
Ashfield21-Sep-08 21:35
Ashfield21-Sep-08 21:35 
Questionerror serializing xml. Pin
Rabidgrizzly21-Sep-08 15:45
Rabidgrizzly21-Sep-08 15:45 
Hey, I was writing some code for my class and the assignment is to create a domain model and then also make an xml document of the information. I have been getting the following error
System.InvalidOperationException was unhandled
  Message="There was an error generating the XML document."
  Source="System.Xml"
  StackTrace:
       at System.Xml.Serialization.XmlSerializer.Serialize(XmlWriter xmlWriter, Object o, XmlSerializerNamespaces namespaces, String encodingStyle, String id)
       at System.Xml.Serialization.XmlSerializer.Serialize(XmlWriter xmlWriter, Object o)
       at Assignment2.CustomerSerializer.ObjectToXml(Object obj) in C:\Users\xxxx\Documents\Visual Studio 2008\Projects\Assignment2\Assignment2\CustomerSerializer.cs:line 42
       at Assignment2.CustomerSerializer.SerializeObjectToFile(Object customer, String fileName) in C:\Users\xxxx\Documents\Visual Studio 2008\Projects\Assignment2\Assignment2\CustomerSerializer.cs:line 20
       at Assignment2.Customer.SaveObjectToFile(String fileName) in C:\Users\xxxx\Documents\Visual Studio 2008\Projects\Assignment2\Assignment2\Customer.cs:line 106
       at TestAssignment2.Program.Main(String[] args) in C:\Users\xxxx\Documents\Visual Studio 2008\Projects\Assignment2\TestAssignment2\Program.cs:line 36
       at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
       at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()
  InnerException: System.InvalidOperationException
       Message="A circular reference was detected while serializing an object of type Assignment2.Customer."
       Source="System.Xml"
       StackTrace:
            at System.Xml.Serialization.XmlSerializationWriter.WriteStartElement(String name, String ns, Object o, Boolean writePrefixed, XmlSerializerNamespaces xmlns)
            at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationWriterCustomer.Write3_Customer(String n, String ns, Customer o, Boolean isNullable, Boolean needType)
            at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationWriterCustomer.Write2_Vehicle(String n, String ns, Vehicle o, Boolean isNullable, Boolean needType)
            at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationWriterCustomer.Write3_Customer(String n, String ns, Customer o, Boolean isNullable, Boolean needType)
            at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationWriterCustomer.Write4_Customer(Object o)
       InnerException: 

I checked through the inner exception and found that im getting a circular reference error and when i checked on boards and also other articles I found that basically its because i can't use a circular reference. Im having a hard time understanding this and was hoping that i could get an answer to how this can occur.

Thank you.
AnswerRe: error serializing xml. Pin
PIEBALDconsult21-Sep-08 16:54
mvePIEBALDconsult21-Sep-08 16:54 
GeneralRe: error serializing xml. Pin
Rabidgrizzly21-Sep-08 16:57
Rabidgrizzly21-Sep-08 16:57 
GeneralRe: error serializing xml. Pin
Rabidgrizzly21-Sep-08 17:12
Rabidgrizzly21-Sep-08 17:12 
GeneralRe: error serializing xml. Pin
PIEBALDconsult21-Sep-08 17:50
mvePIEBALDconsult21-Sep-08 17:50 
Questioncmd in programming Pin
Sajjad Izadi21-Sep-08 9:48
Sajjad Izadi21-Sep-08 9:48 
AnswerRe: cmd in programming Pin
Giorgi Dalakishvili21-Sep-08 9:54
mentorGiorgi Dalakishvili21-Sep-08 9:54 
AnswerRe: cmd in programming Pin
Wendelius21-Sep-08 9:56
mentorWendelius21-Sep-08 9:56 
QuestionDesign patterns Pin
mrcooll21-Sep-08 8:19
mrcooll21-Sep-08 8:19 
AnswerRe: Design patterns Pin
Mark Salsbery21-Sep-08 8:36
Mark Salsbery21-Sep-08 8:36 
GeneralRe: Design patterns Pin
mrcooll21-Sep-08 8:46
mrcooll21-Sep-08 8:46 
AnswerRe: Design patterns Pin
Giorgi Dalakishvili21-Sep-08 8:38
mentorGiorgi Dalakishvili21-Sep-08 8:38 
AnswerRe: Design patterns Pin
Caio Kinzel Filho21-Sep-08 8:55
Caio Kinzel Filho21-Sep-08 8:55 
Questionsslstream to make chat client Pin
proaditya21-Sep-08 7:55
proaditya21-Sep-08 7:55 
AnswerRe: sslstream to make chat client Pin
Mark Salsbery21-Sep-08 8:08
Mark Salsbery21-Sep-08 8:08 
QuestionCreate, edit, save and load a Excel file in C# Pin
Mc_Topaz21-Sep-08 7:22
Mc_Topaz21-Sep-08 7:22 
AnswerRe: Create, edit, save and load a Excel file in C# [modified] Pin
Paul Conrad21-Sep-08 7:28
professionalPaul Conrad21-Sep-08 7:28 
GeneralRe: Create, edit, save and load a Excel file in C# Pin
Mc_Topaz21-Sep-08 8:20
Mc_Topaz21-Sep-08 8:20 

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.