Próbuję użyć pakietów NuGet do skonfigurowania Common.Logging, aby używać NLog2 w projekcie ASP.Net MVC. Na podstawie informacji podanych poniżej adresy URL, uważam, że moje rejestratory są poprawnie skonfigurowane, ale nadal dostaję błędy konfiguracji.Jak mogę pomyślnie skonfigurować Common.Logging?
Common.Logging Configuration Instructions
Dodałem następujące do web.config Zgodnie z instrukcją:
<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>
O ile mogę powiedzieć, to jest wszystko, co powinno Muszę to zrobić, ale dostaję błędy konfiguracji, gdy próbuję uruchomić projekt internetowy ...
Komunikat o błędzie analizatora składni: Wystąpił błąd podczas tworzenia programu obsługi sekcji konfiguracji dla wspólnych/logowania: Nie można utworzyć typ „Common.Logging.NLog.NLogLoggerFactoryAdapter, Common.Logging.NLog20”
Czy ktoś oferta sugestie na temat tego, czego brakuje lub w błędzie?
Hmm Nie sądzę, że istnieje - musisz mieć włączoną awarię rejestrowania (nie bardzo pewnie) –
To nie jest odpowiedź raczej przesądna, poniżej podano: Nie można utworzyć typu "Common.Logging.NLog. NLogLoggerFactoryAdapter, Common.Logging.NLog2 ' – PUG