I get an error in IIS but not ASP.NET Development Server...The process cannot access the file because it is being used by another process problem

Hello

This problem has been bothering me for more than a week so i need someone's input.

I have a web application that uses excel.

In the asp.net development server, things work fine but in iis7, I get the following error.

"The process cannot access the file because it is being used by another process" . The file the program is trying to access is an excel file.

My environment is Vista Business edition, VS2008 professional. So I'm guessing this is vista related problem because I used to run this web application on XP professinal. I migrated to vista business recently, and it works fine on cassini but not iis7.

Any tips would be greatly appreciated. Thanks in advance.

0
kawano
3/13/2009 4:52:23 AM
asp.net.config-deploy 12495 articles. 0 followers. Follow

3 Replies
1171 Views

Similar Articles

[PageSpeed] 48
Get it on Google Play
Get it on Apple App Store

Ok, I got it to work finally.

I added Network Services to Administrators account, then it worked fine.

But I really don't wanna add Network Services to Administrators accont.

Does anyone know a better way? Probably this is becoming more like IIS question rather than ASP.NET, but I would appreciate if someone can give me any tips so as to avoid making Network services a member of Administrators.

Thanks in advance.

0
kawano
3/16/2009 8:05:29 AM

Hello,

You could also ask your question in http://forums.iis.net , the same login as here.

Regards


Windows Hosting ASP.NET | Top ASP.NET Hosts | Dedicated Windows Hosting
0
HostingASPNet
3/16/2009 8:51:27 AM

Hi,

If we run application from Visual Studio, the application is executed under the account that you log in your system. If the application is running under IIS 7.0, ASP.NET process identity is NETWORK SERVICE which has low permission.

In this case, you can grant proper right to NETWORK SERVICE on the file your application tries to access.You can follow this article (http://www.asp.net/learn/whitepapers/denied-access-to-iis-directories/) to implement it.

If you want your ASP.NET application to perform other tasks that need high privileges, you can use Impersonation to impersonate a specific user instead of adding Network Services to Administrators account. So you can use impersonation to access local resources and perform operations by using the authenticated user's identity or by using a specific Windows identity.

For more information, see How To: Use Impersonation and Delegation in ASP.NET 2.0 (http://msdn.microsoft.com/en-us/library/ms998351.aspx).

 

I look forward to receiving your test results.


Thomas Sun
Microsoft Online Community Support

Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question.
0
Thomas
3/17/2009 6:10:11 AM
Reply:

Similar Artilces:

Error: The process cannot access the file because it is being used by another process. on File.Open
I have a gridView that has a bunch on document names stored in it. In a template column I have a view button. When the view button is clicked I run some javascript that that opens a new window and passes a documentID. In the viewDocuments form I make a call to the server passing to ID to get document details: Dim cmdSELDoc As New SqlCommand("[get_document]", conHTA) cmdSELDoc.CommandType = Data.CommandType.StoredProcedure Dim prmDocID As SqlParameter = cmdSELDoc.Parameters.Add("@i_document_id", Data.SqlDbType.Int) prmDocID.Value = Request.QueryString("docID") Try reader = cmdSELDoc.Ex...

Export data to Excel, get the error "The process cannot access the file ... because it is being used by another process"
Hi, Well, I hope this is the right forum, I didn't find one related to generating excel files dynamically. I'm having the error I mentioned, it happens when I get an oledb connection to send data to an excel file. The problem arises when I generate large files and not with small files. So, I assume with this that the code is fine, because it works most of the times. I tried to isolate the problem, so now I'm just generating the file on the server and I'm not even sending it to the client. This is what I'm doing: Dim conn As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;"...

PLease help getting error as The process cannot access the file 'D:\Inventracksys\Inventorytracking Vendorwisereport_1.emf' because it is being used by another process
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 printing feature to button click by exporting the data to EMF format and print Now when I run it through IDE VS2005 then it does not show any error. But when I run in through IIS in intranet it showing me this error   The process cannot access the file 'D:\Inventracksys\Inventorytracking Vendorwisereport_1.emf' because it is being used by another process Where I am going wrong pl...

PLease help getting error as The process cannot access the file 'D:\Inventracksys\Inventorytracking Vendorwisereport_1.emf' because it is being used by another process #2
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 printing feature to button click by exporting the data to EMF format and print Now when I run it through IDE VS2005 then it does not show any error. But when I run in through IIS in intranet it showing me this error   The process cannot access the file 'D:\Inventracksys\Inventorytracking Vendorwisereport_1.emf' because it is being used by another process Where I am going wrong pl...

Developed C#.net WebService 1.1 for Client C#.net 1.1. Getting error "Server was unable to process the Request" Pls Help
Hi., I developed Microsoft C#.net Web Services2003 for the Client Application C#.net 2003. When it runs in 5 machines it gives good performance and has no errors. But if i run the same application in about 80 client machines. Getting error "Server was unable to process the request". I use Sql Server 2005 as my database. I get error even when i login at a time for about 25 users. Tried modifying machine.config too. But went unsuccessful. Live Server is 2003 using IIS 6.0 I use very expensive data handling.  Its very urgent pls help. Have to post in Live Server. Thank u., ...

How to fix error "The process cannot access the file because it is being used by another process"
I am getting the error "The process cannot access (file name) because it is being used by another process" and don't know what to do. I upload an image file, the page is reposted, I resize the image file to a new file, and then I want to delete the original posted file but get the above error. I have read Microsoft article Q238644 to put my delete into a try/catch, saying: "The only known solution to this problem is to retry the operation until the internal lock is released and the operation succeeds." So, I tried this: Dim successfullyDeleted As Boolean =...

SqlBulkCopy & problem: The process cannot access the file '' because it is being used by another process.
I use the SQLBulkCopy class to insert data from a excel file to SQL Server table.             Dim OleDbConn As OleDbConnection = New OleDbConnection(sExcelConnectionString)            Dim OleDbCmd As OleDbCommand = New OleDbCommand(("SELECT * FROM " & sWorkbook), OleDbConn)            OleDbConn.Open()            Dim dr As OleDbDataReader = OleDbCmd.ExecuteReade...

Trying to Delete a file gives: The process cannot access the file because it is being used by another process.
Hello, when trying to delete a file I had copied into a file share on a computer I get the following error:  The process cannot access the file '\\SomeServer\SomeDirrectory\SOmeFIle.ext' because it is being used by another process. This file was placed in the file share using File.copy() and that seemed to work fine. Now in the second page to this app I want to give the option to delete the file. After having read some posts it seems possible that the file stream is not getting closed after the file.copy() but, I do not know how to close this stream, or how to find out i...

The process cannot access the file because it is being used by another process.
I've inherited a system w/5 projects - I'll refer to them as P1 thru P5 - P5 being the executable... P1 has no dependents. P2 is dependant upon P1 P3 has no dependents. P4 is dependant upon P1, P2, P3 P5 is dependant upon P1, P2, P3, P4 The build order is: P1, P2, P3, P4, P5 So far so good? I'm setting the 'Build' path of each project to Px\obj\debug with the exception of the main project (P5)- that is being built into its \BIN folder... When I set the necessary references that each project needs to reference, for example, P2 needs a reference to P1, so I'll set...

Process cannot access file because it is being used by another process
I'm using the SharpZipLibrary : http://www.icsharpcode.net/OpenSource/SharpZipLib/. I'm unzipping a zipped folder to a location, and based on some conditions, my code attempts to move that folder to a new location after unzipping.  I'm using the fastzip class to do this, but I keep getting the wonderful "process cannot access file because it is being used by another process."  FastZip doesn't have a dispose method, so I don't know how to get it to release the file, so I can then (maybe) move it.  Does anyone have any ideas for how I can get around this? Thanks ...

The process cannot access the file,because it is being used by another process.
Hi.. I am working ASP.NET 2.0 + C#. I am using the XmlDocument to read the data from an xml file. As the xml file is used by another thread, when I refresh the page, I sometimes get an error as : An exception of type 'System.IO.IOException' occurred and was caught.---------------------------------------------------------------------Type : System.IO.IOException, mscorlib, Version=2.0.0.0, Culture=neutral, Message : The process cannot access the file 'D:\my.xml' because it is being used by another process. What should be done? How to close the XmlDocument? How to get ...

The process cannot access the file ....because it is being used by another process.
   private void Form1_Load(object sender, EventArgs e)        {            pictureBox1.Image = Image.FromFile("1.jpg");            pictureBox1.Image = Image.FromFile("2.jpg"); ;                    }        private void button1_Click(object sender, EventArgs e)        {  &n...

The process cannot access the file because it is being used by another process?
Hi, I am totally stuck on this one and would really appreciate any help. I am reading and writing xml files in my web app. When I try to open an xml file with any kind of TextReader more than once I get this error. "The process cannot access the file [the file path] because it is being used by another process." I have used the close method and I have also tried Response.clearContent(). Apparently the server can only open a file once? I find this to be really awkward and I'm surprised not to have found a work around for this out there. Has anyone else run into this...

The process cannot access the file because it is being used by another process.
Hi all, I had executing the following piece of code and it always give me the above error. Does someone know what is the problem? Please help      if (Directory.Exists(mydir)) { fs = new FileStream(mydir + myfile, FileMode.Append, FileAccess.Write, FileShare.None); } else { Directory.CreateDirectory(mydir); fs = new FileStream(mydir + myfile, FileMode.Append, FileAccess.Write, FileShare.ReadWrite);   } try { sw = new StreamWriter(mydir + myfile); sw.WriteLine("test"); sw.Close(); fs.Close(); } catch (IOException exIO) { //sw.Close(); //fs....

The process cannot access the file because it is being used by another process
If want to read the schedule task log from  c:\WINDOWS\SchedLgU.Txt but its giving me the error The process cannot access the file  because it is being used by another process i have tried fileaccess.open etc. but no luck plz help me its urgent   Dim stream As FileStream = Nothing Dim succeeded = False While succeeded = False Try stream = File.Open(_Path, FileMode.Open, FileAccess.Read, FileShare.ReadWrite) succeeded = True ...

Web resources about - I get an error in IIS but not ASP.NET Development Server...The process cannot access the file because it is being used by another process problem - asp.net.config-deploy

Agile Software Development - Better ways of developing software
- All things cross-platform, mobile, and mobile-web. Especially Qt/QML related - I love developing software, but also practice managing projects ...

United States Department of Housing and Urban Development - Wikipedia, the free encyclopedia
Robert C. Weaver Federal Building , 451 7th Street SW , Washington, D.C. 38°53′2.17″N 77°1′21.03″W  /  38.8839361°N 77.0225083°W  / 38.8839361; ...

Jarryd Hayne says time on San Francisco 49ers practice squad has accelerated his development
Jarryd Hayne's first NFL season is drawing to a close, but he insists his career in America's most popular sport is just beginning. ...

Software Development Conferences Forecast December 2015
Here is a list of software development related conferences and events on Agile project management ( Scrum, Lean, Kanban), software testing and ...

Watch 10 years of Toro Rosso F1 development in 60 seconds
Filed under: Motorsports , Videos Scuderia Toro Rosso released this fascinating video showing the evolution of its F1 cars over the past ten ...

Look out, Jeff Bezos: Spending bill would undermine development of new rocket engine
Amazon founder Jeff Bezos' plans to build rocket engines for future heavy lift rockets to orbit may be undermined by a provision in the omnibus ...

Advanced Development Process with Apps Script
... and best practices for developing more complex Apps Script solutions by pointing out some community contributions. Apps Script and modern development ...

Jenna Fischer: ‘My parents saw college as personal development’
... is having a human National Geographic nature documentary happening in your house at all times. I just love observing the growth and development ...

REPORT: Expensive US Development Programs Lead To Increased Taliban Support
A USAID development program intended to stop Taliban influence has actually led to increased Taliban support in Afghan villages in addition to ...

Cable Net Z Living Inks Development Deal With 3 Ball Entertainment
Health entertainment network Z Living has closed a development deal with 3 Ball Entertainment ( Bar Rescue, Extreme Weight Loss ), the first ...

Resources last updated: 12/22/2015 10:04:40 PM