Security Exception Error MVC 3

Discussion in 'Site Programming, Development and Design' started by maniphan, Jul 19, 2011.

  1. I deployed MVC 3 project but when I try to browse the site this is the error i got.

    I tried to change .NET Trust Levels from IIS to minimal but still having same issue.

    Please help!

    Thanks!


    Server Error in '/Xbox360' Application.
    Security Exception
    Description: The application attempted to perform an operation not allowed by the security policy. To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file.

    Exception Details: System.Security.SecurityException: Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

    Source Error:

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

    Stack Trace:

    [SecurityException: Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.]
    System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet) +0
    System.Security.CodeAccessSecurityEngine.Check(CodeAccessPermission cap, StackCrawlMark& stackMark) +31
    System.Security.CodeAccessPermission.Demand() +46
    System.AppDomainSetup.VerifyDir(String dir, Boolean normalize) +93
    System.AppDomain.get_BaseDirectory() +58
    Ninject.Modules.ModuleLoader.GetBaseDirectories() +33
    Ninject.Modules.ModuleLoader.NormalizePaths(String path) +56
    Ninject.Modules.ModuleLoader.GetFilesMatchingPattern(String pattern) +54
    Ninject.Modules.ModuleLoader.<LoadModules>b__0(String pattern) +5
    System.Linq.<SelectManyIterator>d__14`2.MoveNext() +238
    System.Linq.Lookup`2.Create(IEnumerable`1 source, Func`2 keySelector, Func`2 elementSelector, IEqualityComparer`1 comparer) +157
    System.Linq.GroupedEnumerable`3.GetEnumerator() +61
    Ninject.Modules.ModuleLoader.LoadModules(IEnumerable`1 patterns) +256
    Ninject.KernelBase.Load(IEnumerable`1 filePatterns) +40
    Ninject.KernelBase..ctor(IComponentContainer components, INinjectSettings settings, INinjectModule[] modules) +309
    Ninject.KernelBase..ctor(INinjectModule[] modules) +92
    Ninject.StandardKernel..ctor(INinjectModule[] modules) +5
    Xbox360GameVoterApllication.MvcApplication.RegisterDependencyResolver() +68
    Xbox360GameVoterApllication.MvcApplication.Application_Start() +32
     
  2. Elshadriel

    Elshadriel Winhost Staff

    Last edited by a moderator: Oct 14, 2015
  3. Can you post the IO related code?
     
  4. solved!

    I just have to add the <trust level="Full" /> to configuration.

    Thank you!
     

Share This Page