Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Assembly failing to load with security warnings #4
Started a brand new MVC3 web app project
Used NuGet to install
Created a new controller factory and new NinjectModule
Got this error when running the application.
Attempt by security transparent method 'Ninject.Extensions.Logging.NLog2.Infrastructure.NLogLogger..ctor(System.Type)' to access security critical method 'NLog.LogManager.GetLogger(System.String)' failed.
Assembly 'Ninject.Extensions.Logging.NLog2, Version=126.96.36.199, Culture=neutral, PublicKeyToken=c7192dc5380945e7' is marked with the AllowPartiallyTrustedCallersAttribute, and uses the level 2 security transparency model. Level 2 transparency causes all methods in AllowPartiallyTrustedCallers assemblies to become security transparent by default, which may be the cause of this exception.
Am I missing something?
I'm having the same issue.
It happens both in an MVC3 web application and in a WPF desktop application.
I cloned all the source and removed the 'AllowPartiallyTrustedCallers' attributes in all of the Ninject AssemblyInfo.cs files, recompiled, and all worked fine.
Guess I'll have to read up on the new .NET 4.0 security policies.