Solved

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

Posted on 2006-06-15
2
814 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

Industry Leaders: 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

Suggested Solutions

Title # Comments Views Activity
ASP.Net problem with GridView using filters and checkboxes on lines 9 41
Broken .resx file generating errors 18 42
Data Analysis 7 58
Run software updates from the website 6 49
In this Article, I will provide a few tips in problem and solution manner. Opening an ASPX page in Visual studio 2003 is very slow. To make it fast, please do follow below steps:   Open the Solution/Project. Right click the ASPX file to b…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.

739 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