Solved

UnauthorizedAccessException on execution of C# Console App with cgi

Posted on 2011-02-25
2
740 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
The Windows functions GetTickCount and timeGetTime retrieve the number of milliseconds since the system was started. However, the value is stored in a DWORD, which means that it wraps around to zero every 49.7 days. This article shows how to solve t…
Learn the basics of while and for loops in Python.  while loops are used for testing while, or until, a condition is met: The structure of a while loop is as follows:     while <condition>:         do something         repeate: The break statement m…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

737 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