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 847909
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T06:51:47+00:00 2026-05-15T06:51:47+00:00

We recently started working with XML files, after many years of experience with the

  • 0

We recently started working with XML files, after many years of experience with the old INI files.

My coworker found some CodeProject sample code that uses System.Xml.XmlDocument.Save. We are getting exceptions when two programs try to write to the same file at the same time.

System.IO.IOException: The process
cannot access the file ‘C:\Test.xml’
because it is being used by another
process.

This seems obvious in hindsight, but we had not anticipated it because accessing INI files via the Win32 API does not have this limitation. I assume there’s some arbitration done by the Win32 calls that work at a higher level than the the XmlDocument.Save method.

I’m hoping there are higher level XML routines somewhere in the .Net library that work similarily to the Win32 functions, but don’t know where to start looking.

Or maybe we can set up our file access permissions to allow multiple programs to write to the same file?

Time is short (like almost all SW projects), and if we can’t find a solution quickly, we’ll have to hold our noses and go back to INI files.

  • 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-15T06:51:48+00:00Added an answer on May 15, 2026 at 6:51 am

    This isn’t going to work. Even if the 2 processes could write to the same file, it would just corrupt your file. If you really need multiple programs writing at the same time, I would use a database instead.

    Or could you split your single XML file up into separate files? Let each process write to its own file, then combine all of the files together during your “Read” method.

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

Sidebar

Related Questions

I recently started working with MVC or MVC2 to be more exact. I found
I have recently started working on a very large C++ project that, after completing
I've recently started working on a web app with a new company and found
I've recently started working with RoR for some projects and I quite like the
I’ve recently started working on a Win Forms application which needs some improving and
I've recently started working with JPA on the Google App Engine. In reading some
I recently started working on a large complex application, and I've just been assigned
I recently started working in Java and was introduced to the wild and crazy
I recently started working at a company with an enormous enterprisey application. At my
I've only recently started working with asp.net and c#. Is there a standard practice

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.