Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 955507
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T00:23:28+00:00 2026-05-16T00:23:28+00:00

I saw that there’s many, many thread about this on the web, also in

  • 0

I saw that there’s many, many thread about this on the web, also in stackoverflow, but i didn’t find any way to resolve my problem. I’ve tried 3 things about now and it all didn’t works :

  1. I’ve simply tried to get the log4net.dll whos given from the log4net zip folder with all source code in the bin directory. Results : No compilation error, but my SmtpAppender just don’t send errors email.
  2. So, I’ve search from web to find that it can be related to the version that the log4net.dll were compile. Which is wierd but anyway, I ran into one error whos asking me to generate a strong key for the assembly and that’s what I’ve done and compile so I release this project and take the log4net.dll and add it to my projet’s refereces. Result : No compilation error but 1 error when it is trying to configure from the Global.asax line :

    protected void Application_Start(object sender, EventArgs e) {
        log4net.Config.XmlConfigurator.Configure();
    }
    

    Here’s the error : (See #Ref1)

  3. So, again, I’ve found out this thread from a certain Ahmed Fouad whos, according to me, were looking to works fine. Here’s the thread. I’ve done everything he says but I still run into the same error (#Ref1).

Do anyone succeeded to configure SmtpAppender into a C# VS.net Web Appplication using Framework 4.0 ?

Ref1

Inheritance security rules violated while overriding member: ‘log4net.Util.ReadOnlyPropertiesDictionary.GetObjectData(System.Runtime.Serialization.SerializationInfo, System.Runtime.Serialization.StreamingContext)’. Security accessibility of the overriding method must match the security accessibility of the method being overriden


Additional informations (Review #1)

I’ve just tried something else. I’ve open the complete .sln of the log4net application converted with VS.net 2010, added a web project looking exactly the same as my application but in this case, I’m able to debug Log4net library. Here’s where it fails :

// If we could not find an alias
if (rep == null)
{
    LogLog.Debug("DefaultRepositorySelector: Creating repository [" + repositoryName + "] using type [" + repositoryType + "]");

    // Call the no arg constructor for the repositoryType
    HERE -> rep = (ILoggerRepository)Activator.CreateInstance(repositoryType); <-- HERE

    [...]
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T00:23:29+00:00Added an answer on May 16, 2026 at 12:23 am

    Find it!! I’ve read this post Log4Net and .NET 4.0 RC and it simply just solve it!

    In my first post (the question), at step 3 of things i’ve tried, it says to replace something in AssemblyInfo.cs :

    He says : “In AssemblyInfo.cs, modified the part for Partial Security to be like this:”

      (#)if (!NETCF && !NET_4_0)
      //
      // If log4net is strongly named it still allows partially trusted callers
      //
      [assembly: System.Security.AllowPartiallyTrustedCallers]
      (#)endif
    

    It’s not good!! You must remove the “!NET_4_0” and replace the [assembly] by this line :

      [assembly: System.Security.SecurityRules(System.Security.SecurityRuleSet.Level1)]
    

    Both SMTPAppender and FileAppender now working fine for me!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using the MSChart Control in a Web Project. I saw that there are
I saw in a Dr Dobb's email report for 2008-12-29 that there's a new
I saw this same question for VIM and it has been something that I
I recently saw a bit of code that looked like this (with sock being
I saw that there is a virtual() function in PHP that will call a
I saw that there are two methods to cast an object in Scala: foo.asInstanceOf[Bar]
I saw that __VIEWSTATE field gets rendered even though I have set the EnableViewState=false
I read the part of the docs and saw that the ConfigParser returns a
I was reading the Math.random() javadoc and saw that random is only psuedorandom. Is
I'm giving my first steps on Python. I saw that we don't have switch

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.