tags:

views:

26

answers:

1

I have one asp.net simple page, on button click I'm trying to start one process(.net console application) but I'm having access denied exception.. If the process is simple windows applications like notepad.exe, or anything else "not .net assembly" the code works...

The problem only happens when I'm running the code from IIS, but from Visual Studio it works.

+2  A: 

Where is the .net console application located?

The 'Access Denied' message indicates that it's probably located somewhere that the user the application pool is running as doesn't have access to.

If you run Internet Information Services Manager (from Control Panel > Administrative Tools) and navigate to Internet Information Services > MACHINE NAME (local computer) > Application Pools in the treeview at the left of the window, you'll see a list of application pools (processes that IIS uses to run your website). Then:

  • Expand each one in turn until you find the one that has your virtual directory listed underneath it.
  • Right-click on the one application pool that's the correct one (probably DefaultAppPool) and choose Properties
  • In the window that appears go to the "Identity" tab

The window will tell you what user the website is running as, you need to make sure that user has permissions to your console application, or, change the user to one that already does.

Rob