我正在使用企业图书馆 6.0。 当我使用电子邮件跟踪侦听器时,我收到一个ArgumentException
参数"地址"不能为空字符串。
我的配置:
<add name="Email Trace Listener"
type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.EmailTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.EmailTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
toAddress="testemail1@test.org;testemail2@test.org;"
subjectLineStarter="IMD.PP"
subjectLineEnder="Local"
fromAddress="testfrom@test.org"
smtpServer="smtpserver.test.org"
formatter="Text Formatter" />
原因是 toAddress 末尾的额外分号,当我删除该分号时,它开始工作:
<add name="Email Trace Listener" type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.EmailTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.EmailTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" toAddress="testemail1@test.org;testemail2@test.org" subjectLineStarter="IMD.PP" subjectLineEnder="Local" fromAddress="testfrom@test.org" smtpServer="smtpserver.test.org" formatter="Text Formatter" />