Ninject、Ninject.Logging、Ninject.Extensions.NLog2を使用するシンプルなコンソールアプリがあり、すべて最新のnugetパッケージでビルドされています。
私のアプリは次のことを行います
_kernel = new StandardKernel();
ILogger logger = _kernel.Get<ILogger>();
StandardKernel
そして、呼び出し時に内部からNullReference例外が発生しますGet<ILogger>()
System.NullReferenceException was unhandled by user code
HResult=-2147467261
Message=Object reference not set to an instance of an object.
Source=Ninject.Extensions.Logging
StackTrace:
at Ninject.Extensions.Logging.LoggerFactoryBase.GetLogger(IContext context) in c:\Projects\Ninject\ninject.extensions.logging\src\Ninject.Extensions.Logging\LoggerFactoryBase.cs:line 61
at Ninject.Extensions.Logging.LoggerModuleBase.<Load>b__0(IContext context) in c:\Projects\Ninject\ninject.extensions.logging\src\Ninject.Extensions.Logging\LoggerModuleBase.cs:line 26
at Ninject.Activation.Providers.CallbackProvider`1.CreateInstance(IContext context) in c:\Projects\Ninject\ninject\src\Ninject\Activation\Providers\CallbackProvider.cs:line 45
at Ninject.Activation.Provider`1.Create(IContext context) in c:\Projects\Ninject\ninject\src\Ninject\Activation\Provider.cs:line 38
at Ninject.Activation.Context.Resolve() in c:\Projects\Ninject\ninject\src\Ninject\Activation\Context.cs:line 157
at Ninject.KernelBase.<>c__DisplayClass10.<Resolve>b__c(IBinding binding) in c:\Projects\Ninject\ninject\src\Ninject\KernelBase.cs:line 386
at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
at System.Linq.Enumerable.<CastIterator>d__b1`1.MoveNext()
at System.Linq.Enumerable.Single[TSource](IEnumerable`1 source)
at Ninject.ResolutionExtensions.Get[T](IResolutionRoot root, IParameter[] parameters) in c:\Projects\Ninject\ninject\src\Ninject\Syntax\ResolutionExtensions.cs:line 37
ロギングを機能させるために必要な設定は他にありますか?