Ich versuche, NuGet-Pakete zu verwenden, um Common.Logging für die Verwendung von NLog2 in einem ASP.Net-MVC-Projekt zu konfigurieren. Basierend auf den Informationen, die unter den URLs angegeben sind, glaube ich, dass meine Logger richtig konfiguriert sind, aber ich bekomme weiterhin Konfigurationsfehler.Wie kann ich Common.Logging erfolgreich konfigurieren?
Common.Logging Configuration Instructions
Ich habe folgende web.config gemäß den Anweisungen hinzugefügt:
<configuration>
<configSections>
<section name="nlog" type="NLog.Config.ConfigSectionHandler, NLog"/>
<sectionGroup name="common">
<section name="logging" type="Common.Logging.ConfigurationSectionHandler, Common.Logging" />
</sectionGroup>
</configSections>
<common>
<logging>
<factoryAdapter type="Common.Logging.NLog.NLogLoggerFactoryAdapter, Common.Logging.NLog20">
<arg key="configType" value="INLINE" />
</factoryAdapter>
</logging>
</common>
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<targets>
<target name="logfile" xsi:type="file" filename="e:\logfile.txt" layout="${date:format=yyyy/MM/dd HH:mm:ss} ${message}" />
</targets>
<rules>
<logger name="*" minlevel="Trace" writeTo="logfile" />
</rules>
</nlog>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Common.Logging" publicKeyToken="af08829b84f0328e" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
Soweit ich sagen kann, dies alles ist, ich soll muss ich tun, aber ich bekomme Konfigurationsfehler, wenn ich versuche, das Webprojekt auszuführen ...
Parser-Fehlermeldung: ein Fehler den Konfigurationsabschnitt Handler für common/Protokollierung aufgetreten Erstellen: Kann nicht Typ 'Common.Logging.NLog.NLogLoggerFactoryAdapter, Common.Logging.NLog20'
Kann jemand Angebot erstellen Vorschläge zu was fehlt oder irrt?
Hmm ich glaube nicht, dass existiert - Sie Protokollierung Montage Ausfall muss eingeschaltet haben (nicht wirklich sicher) –
Das ist nicht wirklich eine Antwort ist ziemlich abergläubisch, unten angegeben: kann nicht Typ ‚Common.Logging.NLog erstellen. NLogLoggerFactoryAdapter, Common.Logging.NLog2 ' – PUG