views:

90

answers:

0

The strange thing is that, my teammates and I are faced with APTCA SecurityException randomly when running our ASP.NET MVC website against ASP.NET Development Server (local development). Machine-level web.config shows that trustLevel is, by default, "Full". There is no override in application-level web.config. The exception happens randomly. For my teammates' case, they can restart the application to get it work. For my case, I have to restart Windows and hope it will work (50/50) after the restart.

How could such Medium-Trust-ish problem happen to us? Is there a way to convince CLR to trust our web application at the local?

Thank you for reading (and possibly help).

[SecurityException: That assembly does not allow partially trusted callers.]

System.Security.CodeAccessSecurityEngine.ThrowSecurityException(Assembly asm, PermissionSet granted, PermissionSet refused, RuntimeMethodHandle rmh, SecurityAction action, Object demand, IPermission permThatFailed) +150
   System.Reflection.MethodBase.PerformSecurityCheck(Object obj, RuntimeMethodHandle method, IntPtr parent, UInt32 invocationFlags) +0
   System.RuntimeType.CreateInstanceImpl(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean fillCache) +272
   System.Activator.CreateInstance(Type type, Boolean nonPublic) +67
   System.Activator.CreateInstance(Type type) +6
   Castle.Windsor.Installer.DefaultComponentInstaller.InstantiateFacility(Type facilityType) +192