The type or namespace name ‘log4net’ could not be found (are you missing a using directive or an assembly reference?)

When creating an application with dotnet 4 (dotnet4) there is a caveat regarding log4net.  One has to change the Target Framework from the default .Net Framework 4 Client Profile to the full .Net Framework 4.

This is done through the project properties.

Honour those who should.

A slightly strange side note is that in my VS2010 log4net showed up in the intellisense to start with but disappeared later; until I did the Target-Framework patch.

The tutorial/quickstart I used is here.

30 Responses to “The type or namespace name ‘log4net’ could not be found (are you missing a using directive or an assembly reference?)”

  1. Rajesh says:


  2. Perry says:

    Thanks. This was my issue exactly.

  3. Developer Dude says:

    Thanks. Fixed my problem.

  4. Ashish Bhalgat says:

    Thanks man !
    I spent 1 hour and then look at your solution. It worked.

  5. Mani says:

    Worked for me! It was a simple fix

  6. Krishna says:

    It worked thanks.

  7. Ariel says:

    Worked for me too! Thx.

  8. king says:

    it works fine

  9. Johnny says:

    thank you!

  10. CA says:


  11. sgupta says:

    Thanks! This fixed this annoying problem. It started off fine but after rebuilding it started to break.

  12. Ken says:

    right on… thanks!

  13. Ranjani says:

    Thanks. it’s working for me

  14. Raghu says:

    worked for me too thanx..

  15. JerseyNo10 says:


  16. Dave D says:

    Thanks, wish I’d found this an hour ago ;-)

  17. Raja says:

    Thanks a lot. I have been breaking my head for sometime now.

  18. Darko says:

    I had the exact same problem. Thank you.

  19. Tom F says:

    Thanks for posting, this might have cost me a lot of time…

  20. Ragz says:

    Thanks for posting this. I had the same issue.

  21. Fah says:

    Thanks for the fix.

  22. Anonymous says:

    It works. Thank you!

  23. erick says:

    Works like magic. Thanks alot

  24. Ramkumar says:

    Good post…easily solved my problem..Thank you

  25. Saranya says:

    Thanks for the post.

  26. Sammy says:

    Thanks. Great Post!

  27. James L says:


  28. Jacob says:

    Thanks a lot!

  29. Sushmita says:

    Thank you, solved my issue.

Leave a Reply