Activation error occured while trying to get instance of type LogWriter

后端 未结 7 2169
你的背包
你的背包 2020-12-17 14:47

I am trying to using the Logging Application block of Enterprise Library 5.0 to log simple message to the Windows event log on Win XP SP3 system using:

Logge         


        
7条回答
  •  醉话见心
    2020-12-17 14:54

    Reading the other answers to this question, and from my own experiences, in general it seems this error occurs when your application cannot read some required configuration for the Logging application block from a config file.

    To add to the scenarios mentioned in previous answers, I've come across this error a couple of times:

    1) In a unit test project, where I forgot to add an app.config file at all;

    2) In a config file where I deleted a particular listener from the loggingConfiguration section but forgot to remove the name of the listener from the categorySource that referenced it.

提交回复
热议问题