Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win


File.Copy : The process cannot access the file because it is being used by another process.  (Using ASP.NET and VB.NET)

Posted on 2004-10-26
Medium Priority
Last Modified: 2012-08-13
Using ASP.NET and VB.NET

When I attempt:

       File.Copy(strSource, strFileName, True)

I get this error:  The process cannot access the file "\\SERVER\www-folder$\Menu\Xml\myMenu.xml" because it is being used by another process.

I am running ASP.NET on IIS 5 with .NET Framework 1.1

I am really stuck...  Any help would be nice.
Question by:afsanchez001
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

Accepted Solution

Lacutah earned 172 total points
ID: 12417414
Make sure that any code that edits / opens the resource in question explicitely CLOSE it when you are finished working with the file before moving or deleting it with the code specified.

Assisted Solution

toddhd earned 164 total points
ID: 12417433
Looks like a web server folder - is the indexing service running and indexing that folder? That would do it.

You may also have a rights issue.
LVL 96

Assisted Solution

by:Bob Learned
Bob Learned earned 164 total points
ID: 12417465
Yeah, it does sound like a rights issue, which is common with ASP.NET, since a lot of people don't realize all the goes into security.


Author Comment

ID: 12425042
You guys ROCK!!!

Expert Comment

ID: 14606000
Hi All,
I am wondering what actually resolved this problem.  Was the problem really resolved?  I have a similar problem inside a windows service.  Any help is appreciated.

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Suggested Courses

610 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