【发布时间】:2017-03-15 15:13:51
【问题描述】:
我在 MVC4 应用程序中遇到错误
Attempt by security transparent method 'Autofac.Integration.Mvc.RegistrationExtensions.RegisterControllers(Autofac.Cont ainerBuilder, System.Reflection.Assembly[])' to access security critical type 'Autofac.Builder.IRegistrationBuilder`3<System.Object,Autofac.Features.Scanning.ScanningActivatorData,Autofac.Builder.DynamicRegistrationStyle>' failed.
Assembly 'Autofac.Integration.Mvc, Version=3.0.0.0, Culture=neutral,
PublicKeyToken=17863af14b0044da' 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.
我尝试了以下链接中给出的不同解决方案,但它们都不适合我 Attempt by security transparent method to access security critical method failed
Attempt by security transparent method xxx to access security critical yy 和 https://forums.asp.net/t/1939805.aspx
请帮忙
【问题讨论】:
-
你有机会看看这个吗?github.com/autofac/Autofac/issues/459
-
您需要在此处添加更多内容,例如您的 NuGet packages.config,以便我们看到您引用的内容。
标签: c# asp.net-mvc asp.net-mvc-4 autofac