by Stian

The type or namespace name 'log4net' could not be found

If you have added a reference to log4net correctly and added your usings, you may get a compile error “The type or namespace name ‘log4net’ could not be found (are you missing a using directive or an assembly reference?)”.

This is most likely due to the Target framework being set to .NET Framework X Client Profile. Change this to .NET Framwork 4 (full version) and your application will compile again!


If you want to read more about how to set up Log4Net, read my colleagues blog post Configure log4net from code

Tags: ,
  • softstars

    Thank you..really informative!!

  • Alejandro

    Thanks for your post, it was very usefull.

  • racksen

    I break my head for almost half a day to fix this one. Thanks

  • bengu

    Greetings, it really works

  • mohamad

    Thank you veeeeeeeeeeeeeeeeeeeerrry very much
    you really good
    I wasted my time in half a day !!!!!!!!!! :'(

  • Ami

    Wow works great. Thank you very much

  • Ranjani

    Thanks. it’s working for me

  • Biruk

    Great Job , It works…

  • David

    I’m so glad for your post. I lost around 6 hours with same error, thanks…