Solved

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

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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

839 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