?
Solved

UnauthorizedAccessException on execution of C# Console App with cgi

Posted on 2011-02-25
2
Medium Priority
?
751 Views
Last Modified: 2013-12-25
Hello!

This is the situation:
I'm using IIS6 on windows server 2003
In my wwwroot, I have set up a folder cgi-bin, with a script in it that launches a console application on the server.
This works fine, the console application gets launched, but it fails writing to a log file with the following exception:

System.UnauthorizedAccessException: Access to the path 'D:\Website\error.log' is denied.

Open in new window


Now, when I start the console application straight from command line on the server it works fine.
Moreover, the permissions for both the ASP.NET Machine account and the NETWORK SERVICE account on this folder D:\Website are set to allow everything.

Apparently I'm missing a setting somewhere, but I don't know where to look.

Thanks in advance for your time!
Dieter
0
Comment
Question by:DieterW
2 Comments
 
LVL 13

Accepted Solution

by:
devlab2012 earned 2000 total points
ID: 34980447
The script itself is launched under Internet Guest Account and then maybe your application is also called under that account. Set the permissions on D:\Website folder to give all permissions to internet guest account.
0
 

Author Closing Comment

by:DieterW
ID: 34997581
That worked!
I hadn't heard of the Internet Guest Account.
Thanks!
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Prologue It is often required to host multiple websites on a single instance of IIS, mostly in development environments instead of on production servers. I am sure it is not much a preferred solution on production servers but this is at least a pos…
This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
The viewer will learn how to dynamically set the form action using jQuery.
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
Suggested Courses
Course of the Month14 days, 6 hours left to enroll

807 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