Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jsf-2/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# “获取异常”;参数';地址';不能是空字符串";使用企业库电子邮件跟踪侦听器时_C# - Fatal编程技术网

C# “获取异常”;参数';地址';不能是空字符串";使用企业库电子邮件跟踪侦听器时

C# “获取异常”;参数';地址';不能是空字符串";使用企业库电子邮件跟踪侦听器时,c#,C#,我正在使用企业图书馆6.0。当我使用电子邮件跟踪侦听器时,我会得到一个ArgumentException 参数“address”不能为空字符串 我的配置: <add name="Email Trace Listener" type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.EmailTraceListener, Microsoft.Practices.EnterpriseLibrary.Loggi

我正在使用企业图书馆6.0。当我使用电子邮件跟踪侦听器时,我会得到一个
ArgumentException

参数“address”不能为空字符串

我的配置:

<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末尾有一个额外的分号,当我删除该分号时,它开始工作:


我知道我在回答我自己的问题,但我花了很多时间寻找这个问题的答案,却找不到任何答案。所以在我解决了这个问题后,我想我应该把它贴在这里,希望能为其他人节省一些时间。