I have a mvc4 web application. I decided to use ninject.mvc3. so I installed it from nuget. But it is throwing this exception:
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;
}
I tried to add '<trust level="Full"/>'
in web.config. Also I tried to add
'[assembly: System.Security.SecurityRules(System.Security.SecurityRuleSet.Level1)]'
in NinjectWebComman.cs. But again it didn't run.
What should I do?. Thanks.