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

  • SEARCH
  • Home
  • 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 6626801
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T21:56:14+00:00 2026-05-25T21:56:14+00:00

I am working C#.NET CF 3.5 on Windows CE 5.0 , and have another

  • 0

I am working C#.NET CF 3.5 on Windows CE 5.0 , and have another problem.
in my app i load/save some data from/to a XML file as my config by using ‘XElement’ class.
i have static methods named ‘Load’ and ‘Save’ that get a key and a string value to load and save. it works fine. but when i call the my Save method more than 4 times i get a native error. it seems that the previously loaded XElement docs must be disposed or something like that. but how? or what’s the matter?
my Save method :

private static void Save(string keyName,string Value)
{
    string strConfigFilePath = CheckConfigFileExistence(); // checks file existence and returns only the file name

    XElement xeDoc = XElement.Load(strConfigFilePath); // HERE! throws a native exception at 4th method call! 
    XElement xeAppSettings = xeDoc.Element("appSettings"); // find 'appSettings' section
    XElement xKey = xeAppSettings.Elements("add").Where(el => el.Attribute("key").Value == keyName).FirstOrDefault(); // find the desired key

    xKey.Attribute("value").Value = Value;
    xeDoc.Save(strConfigFilePath);
}
  • 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-25T21:56:15+00:00Added an answer on May 25, 2026 at 9:56 pm

    Thanks to Waleed and Henk Holterman ,
    Depend on my experience , the native exception with native error code 0x00000005 occures for some reasons of memory leaks in working with unmanaged codes and native DLLs. i faced same error with in many other points. in my project, i called some native DLL functions writing to input/output parameters like byte[] and *BYTE and etc. i think any fault and indelicacy in writing to memory by unmanaged code and C++ codes causes that exceptions later in irrelevant points in managed code!

    hope this be useful.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

hello i have created one windows application in c# .net and its working fine
ASP.NET 4.0 Need some help with this vexing HTTP POST problem - I have
I have an intermittent problem with some code that writes to a Windows Event
I have created a C# .Net windows service. There are some configuration files which
I am working on a VB.Net Windows application. I am trying to use MaskedTextBox
I am working on an old .NET 1.1 windows application. In the debugging configuration
I've been working in windows forms applications and ASP.Net applications for the past 10
I am working on a Windows Forms application in C#/.Net. I want to use
I am working on a mobile application in .NET. This is a windows mobile
I have a working .Net WCF HTTP service. If I put the URL into

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.