> -----Original Message----- > From: Mark Richman [mailto:[EMAIL PROTECTED] > Sent: 25 April 2005 20:15 > To: [email protected] > Subject: log4net on .NET 2.0 Beta 2 > > Are there any issues running log4net on .NET 2.0 Beta 2?
Not that I am aware of, but I don't think there has been a lot of testing under .NET 2.0 Beta 2. > I'm > using log4net-1.2.0-beta8, and I'm trying to find the root > cause of this error on one server. I have an .asmx that > invokes methods of a class library I wrote, which uses > log4net's EventLogAppender. Invoking methods of the .asmx via > web browser produces this error: It looks like your application has not been granted EventLogPermission, or perhaps it is being blocked by something further up the call stack. I don't see why this should be a .NET 2.0 related issue, except that MS may have changed some of the permissions required to do things. What permissions is your web app being granted? Are you impersonating an external user (would that even make a difference to CAS)? Does you class library specify any permission sets via attributes? There is a good discussion of CAS with regard to ASP.NET in the following MS article: http://msdn.microsoft.com/library/en-us/dnnetsec/html/THCMCh09.asp The article does go into some of the sandboxing workarounds that may be employed to elevate permissions. Log4net does not do anything like this, however if necessary the EventLogAppender could be compiled into a separate assembly which can assert the required permissions. > System.Security.SecurityException: Request for the permission > of type 'System.Diagnostics.EventLogPermission, System, > Version=2.0.0.0, Culture=neutral, > PublicKeyToken=b77a5c561934e089' failed. > at > System.Security.CodeAccessSecurityEngine.Check(PermissionToken > permToken, CodeAccessPermission demand, StackCrawlMark& > stackMark, Int32 checkFrames, Int32 unrestrictedOverride) > at > System.Security.CodeAccessSecurityEngine.Check(CodeAccessPermi > ssion cap, StackCrawlMark& stackMark) > at System.Security.CodeAccessPermission.Demand() > at System.Diagnostics.EventLog.SourceExists(String source, > String machineName) > at System.Diagnostics.EventLog.SourceExists(String source) > at <<My Class Library Here>> I should point out at this point that log4net does not appear anywhere in this call stack so it is not easy to divine what is happening. Cheers, Nicko
