Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 713631
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T04:58:58+00:00 2026-05-14T04:58:58+00:00

When I execute the code saveXML below it generates the error above, why?? using

  • 0

When I execute the code saveXML below it generates the error above, why??

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Xml.Serialization;
using System.IO;

/// <summary>
/// Summary description for Post
/// </summary>
public class Post
{
    private int postIDCounter = 0;
    private String DateCreated;

    public Post()
    {
        Author = "unknown";
        Title = "unkown";
        Content = "";
        DateCreated = DateTime.Now.ToString();
        ID = postIDCounter++;
    }

    public int ID
    {
        get { return ID; }
        set
        {
            if (ID != value) 
                ID = value;
        }
    }

    public string Author
    {
        get { return Author; }
        set
        {
            if (Author != value) 
                Author = value;
        }
    }

    public string Title
    {
        get { return Title; }
        set
        {
            if (Title != value)
                Title = value;
        }
    }

    public string Content
    {
        get { return Content; }
        set
        {
            if (Content != value)
                Content = value;
        }
    }

    public void saveXML()
    {
        XmlSerializer serializer = new XmlSerializer(typeof(Post));
        Stream writer  = new FileStream("..'\'App_Data'\'posts'\'" + new Guid(ID.ToString()).ToString() + ".xml", FileMode.Create);
        serializer.Serialize(writer, this);
        writer.Close();
    }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T04:58:58+00:00Added an answer on May 14, 2026 at 4:58 am

    All your variables are circular reference, that loops for ever and eventually your system stops / crash.

    public string Content
        {
            get { return Content; }
    

    For example, you say here, that get, return the Content, but the return is again the get Content, and get Content, and you understand ? is loop for ever in this line… and in all lines that you have something like that.

    Try to do this way.

       string inside_Content;
    
       public string Content
        {
            get { return inside_Content; }
            set { inside_Content = value;}
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using Microsoft's CSharpCodeProvider to dynamically create and execute code. Right now, it creates
I have Python 3.2.2 downloaded and have been using IDLE to execute code; however,
Using jQuery , I can use the following function to execute code as soon
In object-oriented languages (C++) you can execute code before main() by using a global
Is it possible to execute code when a specific time is reached on an
I would like to execute code sequentially in an NSOperation. This can be easily
I need to execute code at intervals, sometimes 10 seconds, sometimes 5 minutes. The
Suppose I want to execute code, for example value += 5 inside a namespace
Is there any online complier/interpreter to execute code for php 5.3? like there is
The PHP Mongo Driver allows me to execute code in the database. Does this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.