ASP.NET MVC2 + Ninject + NLog (+ shared hosting?) = NullReferenceException

后端 未结 4 1548
名媛妹妹
名媛妹妹 2020-12-24 03:28

I have an MVC2 app that\'s based on the Tekpub Starter Site, so it uses Ninject for dependency injection, NLog for logging, and a bunch of other libraries in various places.

4条回答
  •  感情败类
    2020-12-24 04:05

    Shared hosting often has restrictions on reflection etc.

    So my guess is that

    [NullReferenceException: Object reference not set to an instance of an object.] NLog.LogManager.GetCurrentClassLogger() +84

    is related to that - what happens if you get the logger using a meachanism where you pase in a Type that you get at compile time via typeof ?

提交回复
热议问题