Click here to Skip to main content
15,937,198 members
Please Sign up or sign in to vote.
2.33/5 (2 votes)
See more:
In my project I am uploading Excel sheets by a file upload control into a shared folder and displaying the name of the excel sheet in the page.After clicking on the name its opening the Excel sheet.But the problem is that its working fine in local system.when i am hosting it in IIS its not able to execute Process.start().I am using windows authentication.Please someone provide the solution....
Herbisaurus 12-Sep-13 2:26am    
Who voted 1 for this question??
It's a pretty good question and rather userful in many situations!

You are string a process from within the web application, this means you can only do what the ASP.NET worker process is allowed to do!

ASP.NET Web page and server control code executes in the context of the ASP.NET worker process on the Web server. If you use the Start method in an ASP.NET Web page or server control, the new process executes on the Web server with restricted permissions. The process does not start in the same context as the client browser, and does not have access to the user desktop.
[MSDN] See article - Process.Start Method (ProcessStartInfo)[^]

Resolution: (See more on Unable to Start a Process from ASP.NET Thread[^]

These are steps that needs to be followed,

1. Give permission for ASP.NET worker process account (<localmachine>\ASPNET) to interact with desktop or allow ASP.NET worker process to run in SYSTEM account.

To know how to allow worker process to run in SYSTEM account and to know the default permissions of ASPNET account, check this article
INFO: Process and Request Identity in ASP.NET (;en-us;317012)

2. Enable IIS Admin Service to interact with desktop

To configure this, follow this steps.

a. Open Control Panel and follow these steps:
For Windows NT: click Services.
For Windows 2000, Windows XP, and .NET Server: click Administrative Tools, and then click Services.

b. Double-click IIS Admin Service.

c. On the Log On tab, select the Allow Service to Interact with Desktop check box.
Note: This article assumes that the IIS Admin Service runs as a local system.

d. Stop and restart the IIS Admin Service.

Share this answer
How does a web site work? That's actually basics: a client requests a web page, and the web server sends the page's contents as HTML text to the client; if an image / video etc is to be embedded in the page, some special tags are used in the page which are interpreted by the browser (on client side!), and the browser requests then the files from the locations indicated. That's all: just transfer of text or files from server to client after client request.
So: how do you expect Excel to work in such a setting?
If IIS opens Excel, that happens on the server. And how can the cleint see that? No, it cannot. No way to do so.
Return to start: build a simple static web page. Then have an application create the HTML of the pages. And then go to more complicated scenarios. Then you'll understand that your idea cannot work.
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900