•  r3plica
  • 51.2% (Neutral)
  • YAF Forumling Topic Starter

I am trying to set up YAF forums on my site and I am having some issues.
At first I downloaded the SRC files and published them to my site. When I did this, I was getting the Security Exception:


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: That assembly does not allow partially trusted callers.

Source Error:

The source code that generated this unhandled exception can only be shown when compiled in debug mode. To enable this, please follow one of the below steps, then request the URL:

1. Add a "Debug=true" directive at the top of the file that generated the error. Example:

<%@ Page Language="C#" Debug="true" %>


2) Add the following section to the configuration file of your application:

<compilation debug="true"/>

Note that this second technique will cause all files within a given application to be compiled in debug mode. The first technique will cause only that particular file to be compiled in debug mode.

Important: Running applications in debug mode does incur a memory/performance overhead. You should make sure that an application has debugging disabled before deploying into production scenario.

Stack Trace:

[SecurityException: That assembly does not allow partially trusted callers.]
YAF.Core.Services.YafDateTime.FormatTime(DateTime dateTime) +0
YAF.Controls.ForumWelcome.ForumWelcome_PreRender(Object sender, EventArgs e) +80
System.Web.UI.Control.OnPreRender(EventArgs e) +8997922
System.Web.UI.Control.PreRenderRecursiveInternal() +103
System.Web.UI.Control.PreRenderRecursiveInternal() +175
System.Web.UI.Control.PreRenderRecursiveInternal() +175
System.Web.UI.Control.PreRenderRecursiveInternal() +175
System.Web.UI.Control.PreRenderRecursiveInternal() +175
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +8431
System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +253
System.Web.UI.Page.ProcessRequest() +78
System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) +21
System.Web.UI.Page.ProcessRequest(HttpContext context) +49
ASP.default_aspx.ProcessRequest(HttpContext context) +4
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +100
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.272

I tried alsorts to get it to work and I just couldn't. So in the end, I downloaded the BIN version and removed the other version from my site.
Once I had done this I removed the database (and all tables, sprocs, functions, views) from my site.
Then I uploaded the new version, expecting that the issue was something to with how I was publishing the SRC files.

Anyway, as you can see I still get the same problem.

The installation process goes through fine, but when it finishes, it redirects me to: http://forums.gj-wow.co.uk/  and the I get the Exception.

Any help would be greatly appreciated.
Found the Problem. You can solve this Problem by

adding the line...

[assembly: AllowPartiallyTrustedCallers]

to the AssemblyInfo.cs of the FarsiLibary Project and Recompile FarsiLibary Project

Or you use the latest Repository Code

  •  r3plica
  • 51.2% (Neutral)
  • YAF Forumling Topic Starter
Thanks alot, that seems to have fixed the issue 🙂

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

Project Twitter Updates

Copyright © YetAnotherForum.NET & Ingo Herbote. All rights reserved