Solved

System.IO.IOException: The process cannot access the file because it is being used by another process.

Posted on 2006-06-15
2
816 Views
Last Modified: 2012-05-05
Hi

I am writing an integration program to a webservice.

I am getting this error when I try to get the response from the webservice and write it into a text file. It was working fine till a week ago and this program runs fine in the live server.
I have closed all other procces in my program. Any help will be much appreciated.

Here is my code snippet.

  catch (Exception e)
        {

            string file = Server.MapPath("error.txt");
            lblError.Text = "There was an error processing your package,please make sure all your values are correct and try again.";
            StreamWriter er = new StreamWriter(file);
            er.Write(Response);
                       er.Close();          
        }

Thanks
0
Comment
Question by:Watson_User
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 7

Accepted Solution

by:
ExpertAdmin earned 250 total points
ID: 16916279
The good news is that the problem is probably not your code. This is a confirmed bug in the .Net framework.  Read this article to find out how to fix it:

http://support.microsoft.com/?kbid=892544



M@
0
 

Author Comment

by:Watson_User
ID: 16921494
Thanks Much.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question