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

4.4k views Asked by At

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

Am I missing a namespace???

3

There are 3 answers

0
Muhammad Akhtar On BEST ANSWER

You have to add log4net.dll to your project and the using log4net.Config; namespace

0
Rig On

There is the possibility that you have not added the dll. This would require right clicking your project and adding the reference DLL. There is one other step that wasn't mentioned in the previous answers that I found relevant.

There is the possibility that you are not using the correct runtime. I found that log4net requires a full profile. For instance the client profile for .NET 4 will generate this error but if you use the full profile you will not experience this.

2
Paweł Smejda On

Your missing dll. Right click on your project and Add Reference... point to correct dll.