Win 7 application (.exe console) runs under Win 7 but errors under Server 2003 RRS feed

  • Question

  • This is a fairly simple application that reads a copy of a file from a server 2003, manipulates the file then writes a new file back to the S 2003 disk.  I developed it using Visual Studio 2008 and C# and it runs well on my development machine but errors out in an odd way when run on the 2003.

    Error reading - File is in use
    I run the command line a second time and the application runs but fails to exit.  There are no timers in the application and I use filereaders and filestreams including the appropriate modes and closures.  Any suggestions?
    Monday, January 18, 2010 10:55 PM


  • Hi,

    Attempting to read the file for Windows Servers (tm), the following error is seen in the installation log: "Error reading - File is in use"


     Possible causes:

     1.    The user trying to read the file, that does not have enough permissions(i.e. for reading and witing)( Confirm the SYSTEM account is granted Full access and security permission rights for the directory and all sub-directories where the installation files exist).


    2.   After reading the file using filestreams. Try to close the file stream(strem reader or stream writer)( You need to check if the file resources are released before the application exited(Call the Close method of a stream). You also need to check if the code executing enters a infinite loop.).


    3 . The error indicates the file is accessed by another process. In windows server 2003, some directories or files are probably shared among lots of machines. It is also likely that you run another process of your application. Below is a similar thread:

    • Marked as answer by mreynol6 Friday, May 21, 2010 12:55 PM
    Thursday, February 4, 2010 1:44 PM