Website throwing security exception

Discussion in 'General troubleshooting' started by azizkap21, Jul 15, 2012.

  1. Hi,

    I have developed a website using ASP.net and MVC3. I have used NInject for IoC. This web application is running fine on my local machine but when I uploaded on Winhost and trying to open it I am getting below error:


    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.SecurityPermission, 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.SecurityPermission, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.]
    System.AppDomain.get_Evidence() +24
    Ninject.Modules.AssemblyNameRetriever.CreateTemporaryAppDomain() in AssemblyNameRetriever.cs:68
    Ninject.Modules.AssemblyNameRetriever.GetAssemblyNames(IEnumerable`1 filenames, Predicate`1 filter) in AssemblyNameRetriever.cs:46
    Ninject.Modules.CompiledModuleLoaderPlugin.LoadModules(IEnumerable`1 filenames) in CompiledModuleLoaderPlugin.cs:81
    Ninject.Modules.ModuleLoader.LoadModules(IEnumerable`1 patterns) in ModuleLoader.cs:60
    Ninject.KernelBase.Load(IEnumerable`1 filePatterns) in KernelBase.cs:236
    Ninject.KernelBase..ctor(IComponentContainer components, INinjectSettings settings, INinjectModule[] modules) in KernelBase.cs:89
    Ninject.KernelBase..ctor(INinjectModule[] modules) in KernelBase.cs:57
    Ninject.StandardKernel..ctor(INinjectModule[] modules) in StandardKernel.cs:46
    OnlineShop.Web.UI.App_Start.NinjectWebCommon.CreateKernel() in NinjectWebCommon.cs:48
    Ninject.Web.Common.Bootstrapper.Initialize(Func`1 createKernelCallback) in Bootstrapper.cs:50
    OnlineShop.Web.UI.App_Start.NinjectWebCommon.Start() in NinjectWebCommon.cs:31
     
  2. Elshadriel

    Elshadriel Winhost Staff

    Last edited by a moderator: Oct 14, 2015

Share This Page