3

私はmvc4 Webアプリケーションを持っています。ninject.mvc3 を使用することにしました。だから私はナゲットからそれをインストールしました。しかし、それはこの例外をスローしています:

Inheritance security rules violated by type: 'Ninject.Web.NinjectHttpModule'. Derived types must either match the security accessibility of the base type or be less accessible.

  private static IKernel CreateKernel()
        {
            var kernel = new StandardKernel(); //Throws exception this line
            kernel.Bind<Func<IKernel>>().ToMethod(ctx => () => new Bootstrapper().Kernel);
            kernel.Bind<IHttpModule>().To<HttpApplicationInitializationHttpModule>();
            return kernel;
        }

'<trust level="Full"/>'web.configに追加しようとし ました。また、追加しようとしました

'[assembly: System.Security.SecurityRules(System.Security.SecurityRuleSet.Level1)]' NinjectWebComman.cs で。しかし、再び実行されませんでした。

私は何をすべきか?。ありがとう。

4

0 に答える 0