• Gofer01
  • 100% (Exalted)
  • YAF Commander Topic Starter
13 years ago


Server Error in '/' 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.Web.AspNetHostingPermission, System, Version=, 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.Web.AspNetHostingPermission, System, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.]
System.Reflection.Assembly._GetExportedTypes() +0
System.Web.Compilation.BuildResultMainCodeAssembly.FindAppInitializeMethod() +41
System.Web.Compilation.CodeDirectoryCompiler.GetCodeDirectoryAssembly(VirtualPath virtualDir, CodeDirectoryType dirType, String assemblyName, StringSet excludedSubdirectories, Boolean isDirectoryAllowed) +11196986
System.Web.Compilation.BuildManager.CompileCodeDirectory(VirtualPath virtualDir, CodeDirectoryType dirType, String assemblyName, StringSet excludedSubdirectories) +185
System.Web.Compilation.BuildManager.CompileCodeDirectories() +654
System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() +658

Version Information: Microsoft .NET Framework Version:2.0.50727.4952; ASP.NET Version:2.0.50727.4927


13 years ago
Did you get this corrected? I am having the same issue.
13 years ago
Please check your app config file.

Is this

EMPTY ? If so, put a password and Install again.

And let us know, because most do not follow up...

  • kwrl
  • 51.8% (Neutral)
  • YAF Forumling
12 years ago
I get exactly the same error. I tried everything I found in this forum but without success.

My server is an 2008 R2 with .net Framework 4 installed.
I downloaded the latest bin-Version (1.9.5 FINAL) unzipped it and copied the whole directory yetanotherforum.net (including the directory) under my wwwroot.
The recommended web.config file was renamed to 'web.config'; I created a db and named it yafnet.
Then I converted wwwroot/yetanotherforum.net to an application (trust level is full)
I set the password as posted by cagliostro in the app.config and updated the db.config (because I'm using SQL 2008 Express with the named instance 'SQLExpress'; integrated Security; I also tried SQL Server authentication without success).

Did I forgot something?

Thx in advance

  • bbobb
  • 100% (Exalted)
  • YAF Developer
12 years ago
It's better to use later versions, 1.9.5 was partially incompatibe with 4.
  • kwrl
  • 51.8% (Neutral)
  • YAF Forumling
12 years ago
Hi bbobb,

thank you for this information but even the beta (downloaded from Codeplex) generates the same error message.

My instict says, it's just a small setting missing. Any advice appreciated!

  • Jaben
  • 100% (Exalted)
  • YAF Developer
12 years ago
Are these running on shared hosting? Not sure why anyone would receive invalid permissions. And bbobb, YAF v1.9.5 works fine on .NET v4.
  • kwrl
  • 51.8% (Neutral)
  • YAF Forumling
12 years ago
Hi Jaben,

no, I have a complete virtual HyperV Server with root access; I can change every setting or permission I want.
But not sure what to change! :-(

2008 R2 has very high sercurity settings. I'm a developer not a admin .. probably that's the problem! 😉
  • szabogi
  • 50.6% (Neutral)
  • YAF Forumling
11 years ago
I struggled with this error as well and it is indeed a quick fix to a very small setting.

In IIS7 (on Windows 2008 Server):

1. Expand your application pools and locate the pool that is assigned to your YAF application.

2. Select the pool and choose Advanced Settings on the Actions panel OR by right clicking on it and choosing from the right click menu.

3. Under Process Model, look for the property named Load User Profile. This will be set to false. Change it to TRUE.

4. Click OK to commit the change.

YAF Logo Copyright © YetAnotherForum.NET & Ingo Herbote. All rights reserved
About Us

The YAF.NET is an open source .NET forum project. YAF.NET is supported by an team of international developers who are build community by building community software.

Powered by Resharper Donate with PayPal button