Solved

UnauthorizedAccessException on execution of C# Console App with cgi

Posted on 2011-02-25
2
744 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 13

Accepted Solution

by:
devlab2012 earned 500 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

[Webinar] Learn How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

Batch, VBS, and scripts in general are incredibly useful for repetitive tasks.  Some tasks can take a while to complete and it can be annoying to check back only to discover that your script finished 5 minutes ago.  Some scripts may complete nearly …
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Learn the basics of lists in Python. Lists, as their name suggests, are a means for ordering and storing values. : Lists are declared using brackets; for example: t = [1, 2, 3]: Lists may contain a mix of data types; for example: t = ['string', 1, T…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…

688 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