473,473 Members | 2,155 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Configuration File

I have an ASP.NET application that I am trying to run on my local server. I
have administrator privilege.

It contains:

private void btnThomButton_Click(object sender, System.EventArgs e)
{
EventLog eventLog = new EventLog("Application" );
eventLog.Source = "Application" ;
eventLog.WriteEntry( "Message" );
}

When this is executed the WriteEntry causes an exception ...

Description: The application attempted to perform an operation not allowed
by the security policy. To grant this application the required permission
please contact your system administrator or change the application's trust
level in the configuration file.

What and where is this configuration file?

--
-- Thom Little -- www.tlaNET.net -- Thom Little Associates, Ltd.
--

Nov 18 '05 #1
2 1173
By default the ASPNET user account does not have permission to create Event
Logs.
Generally the EventLog would be created at time of installation.
This avoids your runtime security limitation of the default ASPNET user
account.
Another approach is to use impersonation to have ASP.NET run under another
user account that has permissions to create an event log.
Here's more details:
http://support.microsoft.com/?id=329291
http://msdn.microsoft.com/library/de...ersonation.asp

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
"Thom Little" <th**@tlanet.net> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
I have an ASP.NET application that I am trying to run on my local server. I have administrator privilege.

It contains:

private void btnThomButton_Click(object sender, System.EventArgs e)
{
EventLog eventLog = new EventLog("Application" );
eventLog.Source = "Application" ;
eventLog.WriteEntry( "Message" );
}

When this is executed the WriteEntry causes an exception ...

Description: The application attempted to perform an operation not allowed
by the security policy. To grant this application the required permission
please contact your system administrator or change the application's trust
level in the configuration file.

What and where is this configuration file?

--
-- Thom Little -- www.tlaNET.net -- Thom Little Associates, Ltd.
--

Nov 18 '05 #2
Steve:

That is exactly the information that I needed.

Thank you.

.... Thom

--
-- Thom Little -- www.tlaNET.net -- Thom Little Associates, Ltd.
--

"Steve C. Orr [MVP, MCSD]" <St***@Orr.net> wrote in message
news:e5**************@TK2MSFTNGP10.phx.gbl...
By default the ASPNET user account does not have permission to create Event Logs.
Generally the EventLog would be created at time of installation.
This avoids your runtime security limitation of the default ASPNET user
account.
Another approach is to use impersonation to have ASP.NET run under another
user account that has permissions to create an event log.
Here's more details:
http://support.microsoft.com/?id=329291
http://msdn.microsoft.com/library/de...ersonation.asp
--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
"Thom Little" <th**@tlanet.net> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
I have an ASP.NET application that I am trying to run on my local server.
I
have administrator privilege.

It contains:

private void btnThomButton_Click(object sender, System.EventArgs e)
{
EventLog eventLog = new EventLog("Application" );
eventLog.Source = "Application" ;
eventLog.WriteEntry( "Message" );
}

When this is executed the WriteEntry causes an exception ...

Description: The application attempted to perform an operation not

allowed by the security policy. To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file.

What and where is this configuration file?

--
-- Thom Little -- www.tlaNET.net -- Thom Little Associates, Ltd.
--


Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Alexander Kienzle | last post by:
I'm new to Java programming. I'm developing a Servlet for tomcat which needs an external configuration file. With external I mean a file (in XML format) which is customizable and not contained in...
2
by: kathy | last post by:
What Application Configuration File is? And when/where/how to use it? Any documents on that? MSDN has somrthings scatter everywhere - hard to follow. thanks,
4
by: Jessard | last post by:
Hi Guys and Girls, I have a situation where I am wishing to deploy a .NET dll onto a number of servers. The classes in the DLL will be used by VBScripts. When one of the classes - Connection -...
3
by: Florida Coder | last post by:
I have the need to store some application specific configuration data to be used by a class library and or a windows service. I would like to do this in a fashion similar to the way we do with...
0
by: phillip | last post by:
This is interesting, I have attached my web.config file and the exception I have been logging. I created a library which provide data access to a database and a control system. The library is...
1
by: Ramanfromoz | last post by:
Hi, Developing a new we application. Everything okay on my local WIN XP PROFESSIONAL, IIS 5.0 running locally. The website is running smoothly. Now, the same code I am copying over to a...
10
by: Rider | last post by:
Hi, simple(?) question about asp.net configuration.. I've installed ASP.NET 2.0 QuickStart Sample successfully. But, When I'm first start application the follow message shown. ========= Server...
0
by: sean rogers | last post by:
hello im using the configuration block and have created the main config file for the application - the file that contains the paths to the other configuration sections i.e. - (my other...
6
by: Jeff Hegedus | last post by:
I have a dll that requires some configuration data. I put the configuration data in a custom configuration section in a config file that is loaded in the installation folder of the dll. If I...
3
by: Mike | last post by:
Hi I have problem as folow: Caught Exception: System.Configuration.ConfigurationErrorsException: An error occurred loading a configuration file: Request for the permission of type...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.