473,395 Members | 1,521 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

The process cannot access the file

37
Hi All,

I have deployed the application on the windows 2003 and its domain controller, and i m accessing the application
from client machine which has access to all the resources on the server.

in the code i am trying to write data in .csv file but i m getting this error.


Exception: System.IO.IOException:
The process cannot access the file 'D:\MMLIVFILTRE_080717_132556.CSV' because it is being used by another process.

i am closing and deposing the object.

its works fine on my development machine.

is anyone had the same problem before. can you tell me what is the problem.

Thanks

-joseph
Jul 17 '08 #1
4 1191
Plater
7,872 Expert 4TB
Grab yourself a copy of Process Explorer (free from microsoft technet) and run it and go to Find->"Find Handle..." and put in that file name.
That will show you who has the file open.
Jul 17 '08 #2
john20
37
Hi Thanks for ur reply..

I did the same as but it is not helping.

some more information :

on the server in the web.config <identity Impersonation="True" >

when i run from the server it works fine but when i try to access the application from user machine then it is giving the above error.

for testing i have given the full control to the user.

is this a permission issue ?
Jul 18 '08 #3
Plater
7,872 Expert 4TB
What identity are you impersonating?
Actually I suspect that when you test it and it "works fine", it's keeping the file open. So when the next user tries to to use the file its locked and they can't access it.
Jul 18 '08 #4
john20
37
What identity are you impersonating?
Actually I suspect that when you test it and it "works fine", it's keeping the file open. So hwne the next user tries to to use the file its locked and they can't access it.
on winodws 2003 server i am impersonating the user which is created on the domain.

like :
<identity impersonate="true" userName ="ABC\john" password ="*****"/>

and everytime i am creating the new file.

below is the code:

Expand|Select|Wrap|Line Numbers
  1.  
  2. Dim objSW As StreamWriter = New StreamWriter(sExportFolder & "\" & sSession & ".CSV")
  3.  
  4. objSW.WriteLine(fi.DirectoryName & sColSep & fi.Name & sColSep & fi.Length & sColSep & fi.Extension.Replace(".", "") & sColSep & "144" & sColSep & Format(fi.CreationTime, "dd/MM/yyyy") & sColSep & Format(fi.LastWriteTime, "dd/MM/yyyy") & sColSep & Format(fi.LastAccessTime, "dd/MM/yyyy") & sColSep & sFIOwner)
  5.  
  6.  
  7.                objSW.Close()
  8.                 objSW.Dispose()
  9.                 objSW = Nothing
  10.  
  11.  
closing and deposing the object after writing to the file.

Thanks
john
Jul 21 '08 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

9
by: Paul | last post by:
Hi, VB.NET is saying the file I am creating is in use by another process and won't complete its task of moving the file to the specified destination folder. Here is my code (the main bit...
4
by: Mountain Bikn' Guy | last post by:
I am having serious problems with the following IDE bug: Could not write to output file 'x.dll' -- 'The process cannot access the file because it is being used by another process. ' and BUG:...
3
by: trellow | last post by:
Hello, I am writing an application that needs to read a file that is already open by another process for writing. When I do the following: FileStream fs = new FileStream(fileName,...
2
by: Raed Sawalha | last post by:
Hello , I have windows service which do listening to specified directory using FileSystemWatcher , on Created Event and Get all the files in the directory using Directory.GetFiles function then...
3
by: guoqi zheng | last post by:
Dear sir, There is an import tool on my web application, user can upload Ms Access file, the file is saved at a temp folder on the server. After the import is finished, for security reason, I...
0
by: Sin | last post by:
> Xxxxx : error PRJ0008 : Could not delete file 'd:\xxxxxxx.dll'. > Make sure that the file is not open by another process and is not write-protected. > > LINK : fatal error LNK1168: cannot open...
5
by: ZWeng | last post by:
I created a windows service using FileSystemWatcher to moniter a folder for file drops. The service uses FileStream and StreamReader to read and process the file. After it is done, the file is...
0
by: imranabdulaziz | last post by:
Dear All, I am making web application using Asp.net C#(Visual Studio2005). And Sql server 2005 as a back End I generated local mode report but as there was no printing option available . I assign...
0
nightangel
by: nightangel | last post by:
Hi dude,what i was done in my application is uploading a image file to my server using FTP, it work great when pushing a file into the server path using FTP. The problem i met now is i need to do a...
4
by: =?Utf-8?B?VkIgSm9ubmll?= | last post by:
I am at my witless end here, please help! I have an ASP.Net aspx web page, hosted on Windows Server 2003, that receives a query string with the path to an autocad drawing file selected from a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.