Return-Path: Delivered-To: apmail-logging-log4net-user-archive@www.apache.org Received: (qmail 62816 invoked from network); 29 Jun 2006 06:50:55 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 29 Jun 2006 06:50:55 -0000 Received: (qmail 40477 invoked by uid 500); 29 Jun 2006 06:50:54 -0000 Delivered-To: apmail-logging-log4net-user-archive@logging.apache.org Received: (qmail 40177 invoked by uid 500); 29 Jun 2006 06:50:53 -0000 Mailing-List: contact log4net-user-help@logging.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: "Log4NET User" List-Id: Delivered-To: mailing list log4net-user@logging.apache.org Received: (qmail 40166 invoked by uid 99); 29 Jun 2006 06:50:53 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 28 Jun 2006 23:50:53 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=HTML_MESSAGE X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [169.132.25.53] (HELO mail.corp.idt.net) (169.132.25.53) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 28 Jun 2006 23:50:51 -0700 Received: from [10.153.50.109] (HELO maxglobdmiller) by mail.corp.idt.net (CommuniGate Pro SMTP 4.2) with ESMTP id 158800723 for log4net-user@logging.apache.org; Thu, 29 Jun 2006 02:50:29 -0400 From: "Daniel Miller" To: Subject: ASP .NET 2.0 Security error - Config problems - Any ideas? Date: Thu, 29 Jun 2006 09:50:28 +0300 Message-ID: <003601c69b48$4f5c7dd0$6d32990a@ME.IDTCORP.NET> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0037_01C69B61.74A9B5D0" X-Mailer: Microsoft Office Outlook 11 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2869 Thread-Index: Acaap7CS3Ga5c2wYSKCRR849Z9MRbgAoI4PQ X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N This is a multi-part message in MIME format. ------=_NextPart_000_0037_01C69B61.74A9B5D0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Hi there I'm using log4net with an ASP .NET 2.0 application. On my local machine all works well, but when deployed to an ISP, there are no logs. After much debugging, I discovered that log4net was failing on a "Security Error" (see error message below) - i.e., the server's trust level is Medium and blocks log4net from reading the config data. (When I used a separate log4net.config file this error was swallowed; it only showed up when I moved the config data to web.config). After much searching online, still no hope in sight (the trust level cannot be overridden for this server) and some claim there is no solution. (See http://www.tisgoud.nl/blog/CommentView,guid,79cd746e-556a-4417-a1fe-fb429bd3 7f80.aspx) Any ideas? Suggestions? I've tried loading configuration data from Global.asax (using XmlConfigurator.Configure(),XmlConfigurator. ConfigureAndWatch(.), and the same for DOMConfigurator) and also using AssemblyInfo.cs ([assembly: log4net.Config.XmlConfigurator(ConfigFile="log4net.config",Watch=true )]), you name it. Thanks in advance. Daniel --- Error message: Security 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. Exception Details: System.Security.SecurityException: Request for the permission of type 'System.Configuration.ConfigurationPermission, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' failed. Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. Stack Trace: [SecurityException: Request for the permission of type 'System.Configuration.ConfigurationPermission, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' failed.] System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet) +0 System.Security.CodeAccessPermission.Demand() +59 System.Configuration.BaseConfigurationRecord.CheckPermissionAllowed(String configKey, Boolean requirePermission, Boolean isTrustedWithoutAptca) +65 ---------------------------------------------------------------------------- ---- Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42 ------=_NextPart_000_0037_01C69B61.74A9B5D0 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Hi = there

 

I'm using log4net with an ASP .NET 2.0 application. On my local machine all = works well, but when deployed to an ISP, there are no = logs.

 

After much debugging, I discovered that log4net was failing on a = "Security Error" (see error message below) – i.e., the server's trust = level is Medium and blocks log4net from reading the config data. (When I used a = separate log4net.config file this error was swallowed; it only showed up when I = moved the config data to web.config).

 

After much searching online, still no hope in sight (the trust level cannot be overridden for this server) and some claim there is no = solution.

(See http://www.tisgoud.nl/blog/CommentView,guid,79cd746= e-556a-4417-a1fe-fb429bd37f80.aspx)

 

Any ideas? Suggestions?

 

I've tried loading configuration data from Global.asax (using = XmlConfigurator.Configure(),XmlConfigurator. = ConfigureAndWatch(…), and the same for DOMConfigurator) and also using AssemblyInfo.cs ([assembly: log4net.Config.XmlConfigurator(ConfigFile=3D"log4net.config",Wa= tch=3Dtrue )]), you name it.

 

Thanks in advance.

 

Daniel

 

---

Error message:

 

Security 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.

 

Exception Details: System.Security.SecurityException: Request for the permission = of type 'System.Configuration.ConfigurationPermission, System.Configuration, Version=3D2.0.0.0, Culture=3Dneutral, PublicKeyToken=3Db03f5f7f11d50a3a' = failed.

 

Source Error:

 

An unhandled exception was generated during the execution of the current = web request. Information regarding the origin and location of the exception = can be identified using the exception stack trace below.  =

 

Stack Trace:

 

 

[SecurityException: = Request for the permission of type 'System.Configuration.ConfigurationPermission, System.Configuration, Version=3D2.0.0.0, Culture=3Dneutral, PublicKeyToken=3Db03f5f7f11d50a3a' failed.]

   = System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet) = +0

   System.Security.CodeAccessPermission.Demand() +59

   System.Configuration.BaseConfigurationRecord.CheckPermissionAllowed(Strin= g configKey, Boolean requirePermission, Boolean isTrustedWithoutAptca) = +65

 

 

 

 

--------------------------------------------------------= ------------------------

Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42

------=_NextPart_000_0037_01C69B61.74A9B5D0--