温莎城堡:"LoggingFacility.UseNLog() is obsolete"
Castle Windsor: "LoggingFacility.UseNLog() is obsolete"
很久以前,我做了一个小项目,希望能了解温莎城堡。我把它搁置了很长一段时间(在真正学到那么多之前)。我现在再次打开它,更新了 NuGet 包,并开始收到警告 CS0618:
'LoggingFacility.UseNLog()' is obsolete: 'A logger factory
implementation type should be provided via LogUsing(), this will be
removed in the future.'
我已经基于此进行了谷歌搜索,但我仍然不清楚我应该做什么来替换现在已过时的调用,即:
container.AddFacility<LoggingFacility>(f => f.UseNLog());
如有任何帮助,我们将不胜感激。谢谢!
哦,我想我偶然发现了答案。还没有测试过,但至少,以下不会给出任何编译器警告:
container.AddFacility<LoggingFacility>(f => f.LogUsing<NLogFactory>());
很久以前,我做了一个小项目,希望能了解温莎城堡。我把它搁置了很长一段时间(在真正学到那么多之前)。我现在再次打开它,更新了 NuGet 包,并开始收到警告 CS0618:
'LoggingFacility.UseNLog()' is obsolete: 'A logger factory implementation type should be provided via LogUsing(), this will be removed in the future.'
我已经基于此进行了谷歌搜索,但我仍然不清楚我应该做什么来替换现在已过时的调用,即:
container.AddFacility<LoggingFacility>(f => f.UseNLog());
如有任何帮助,我们将不胜感激。谢谢!
哦,我想我偶然发现了答案。还没有测试过,但至少,以下不会给出任何编译器警告:
container.AddFacility<LoggingFacility>(f => f.LogUsing<NLogFactory>());