我有自定义跟踪侦听器,它记录到一个字符串(我将绑定到一个wpf文本框),我试图在我的viewmodelLocator中找到它,它(或我定义的所有其他侦听器)似乎不是在System.Diagnostics.Trace.Listeners)
App.config片段
<?xml version="1.0" encoding="utf-8" ?> <configuration> <system.diagnostics> <switches> <add name="RomanExampleWPFAppSwitch" value="Verbose" /> </switches> <sources> <source name="RomanExampleWPFApp" switchName="RomanExampleWPFAppSwitch"> <listeners> <remove name="Default" /> <add name="RollingLog" type="Microsoft.VisualBasic.Logging.FileLogTraceListener,Microsoft.VisualBasic,Version=10.0.0.0,Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a" initializeData="RollingLogWriter" append="true" autoFlush="true" baseFileName="RomanExampleWPFAppLog" location="LocalUserApplicationDirectory" logFileCreationSchedule="Daily" reserveDiskSpace="1073741824" traceOutputOptions="DateTime,LogicalOperationStack" /> <add name="StringLog" type="RomanExampleWPFApp.Other.StringLogTraceListener,RomanExampleWPFApp" /> <add name="consoleListener" type="System.Diagnostics.ConsoleTraceListener" /> </listeners> </source> </sources> </system.diagnostics> </configuration>