Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

Unable to Start a Process from ASP.NET


Author: Saravana Kumar MVP

View products that this article applies to.

Symptoms

If you start a process from ASP.NET using System.Diagonistics.Process.Start method. Process might start in the background (you can even see it in task manager), �but you cant see it in the desktop.

↑ Back to the top


Cause

This will happen because of two reasons.

1. By default, ASP.NET runs its worker process (Aspnet_wp.exe) with a weak account (the local machine account, which is named ASPNET) which don't have permission to interact with desktop.

2. By default, IIS Admin Service won't allow its application to interact with desktop.

↑ Back to the top


Resolution

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�(http://support.microsoft.com/default.aspx?scid=kb;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.������

↑ Back to the top


More information

Steps to Reproduce the Behavior

��������1. In Microsoft Visual Studio .NET, create a new ASP.NET Web Application project by using Visual Basic .NET or Visual C# .NET. Name the project����������
����������� CreateProcess. By default, WebForm1.aspx is created.

������� 2. Right-click WebForm1.aspx, and then click View Code.

������� 3. Modify the Page_Load event as follows :


Visual C# .NET Sample Code

�����������������private�void�Page_Load(object�sender,�System.EventArgs�e)

�������������������{

������������������������System.Diagnostics.Process.Start("Notepad.exe");

�������������������}


Visual Basic .NET Sample Code

�����������������Private�Sub�Page_Load ByVal�sender�As�System.Object,�ByVal�e�As�System.EventArgs)�Handles�MyBase.Load

����������������������������System.Diagnostics.Process.Start("Notepad.exe")

�����������������End�Sub


���������4. On the Build menu, click Build Solution.

�������� 5. Type the following URL in the browser:
������������ http://<ServerName>/CreateProcess/WebForm1.aspx

↑ Back to the top


Properties

COMMUNITY SOLUTIONS CONTENT DISCLAIMER
MICROSOFT CORPORATION AND/OR ITS RESPECTIVE SUPPLIERS MAKE NO REPRESENTATIONS ABOUT THE SUITABILITY, RELIABILITY, OR ACCURACY OF THE INFORMATION AND RELATED GRAPHICS CONTAINED HEREIN. ALL SUCH INFORMATION AND RELATED GRAPHICS ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT AND/OR ITS RESPECTIVE SUPPLIERS HEREBY DISCLAIM ALL WARRANTIES AND CONDITIONS WITH REGARD TO THIS INFORMATION AND RELATED GRAPHICS, INCLUDING ALL IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, WORKMANLIKE EFFORT, TITLE AND NON-INFRINGEMENT. YOU SPECIFICALLY AGREE THAT IN NO EVENT SHALL MICROSOFT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY DIRECT, INDIRECT, PUNITIVE, INCIDENTAL, SPECIAL, CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF USE, DATA OR PROFITS, ARISING OUT OF OR IN ANY WAY CONNECTED WITH THE USE OF OR INABILITY TO USE THE INFORMATION AND RELATED GRAPHICS CONTAINED HEREIN, WHETHER BASED ON CONTRACT, TORT, NEGLIGENCE, STRICT LIABILITY OR OTHERWISE, EVEN IF MICROSOFT OR ANY OF ITS SUPPLIERS HAS BEEN ADVISED OF THE POSSIBILITY OF DAMAGES.

↑ Back to the top


Community solutions content disclaimer

Microsoft corporation and/or its respective suppliers make no representations about the suitability, reliability, or accuracy of the information and related graphics contained herein. All such information and related graphics are provided "as is" without warranty of any kind. Microsoft and/or its respective suppliers hereby disclaim all warranties and conditions with regard to this information and related graphics, including all implied warranties and conditions of merchantability, fitness for a particular purpose, workmanlike effort, title and non-infringement. You specifically agree that in no event shall Microsoft and/or its suppliers be liable for any direct, indirect, punitive, incidental, special, consequential damages or any damages whatsoever including, without limitation, damages for loss of use, data or profits, arising out of or in any way connected with the use of or inability to use the information and related graphics contained herein, whether based on contract, tort, negligence, strict liability or otherwise, even if Microsoft or any of its suppliers has been advised of the possibility of damages.

↑ Back to the top


Keywords: KB555134, kbhowto, kbpubmvp, kbpubtypecca

↑ Back to the top

Article Info
Article ID : 555134
Revision : 1
Created on : 7/19/2004
Published on : 7/19/2004
Exists online : False
Views : 332