Skip to content

C# winform Exception on few systems

narasimman g

Asked Nov 9, 2010, 3:02 AM EST1 answer
Share
LinkedInX
this is c# winform
I'm performin write  operation on the application startup path.Out of 3/5 systems below exception occurs. is this happening due to Admin/Access Rights on that system/drive?
System.IO.IOException: The process cannot access the file 'C:\Program Files\Sample\test.xml' because it is being used by another process.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options)
 

1 Answer

Know the answer? Post it. Somebody with the same question will find it here.

  • 0
    Any replies!!
    I analyzed my teammate coding.he missed out to close and dispose the filestream.I guess this might be the problem.
    But on other side exception occurs in few system and not in all systems. those who gets this error installed all versions of dot net framework, Is this cause any conflict?
    Advanced thanks for your suggesstions
     
    0