.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

SharePoint app crashes due to System.Security.Policy.PolicyException.

Posted By:      Posted Date: September 23, 2010    Points: 0   Category :SharePoint

We have a two W.F.E servers. The server is hosting our intranet we app. The app is crashing at 2 in the night. It does not happen frequently, but does happen twice a week. Below is the description of the error message.

Server Error in '/' Application. -------------------------------------------------------------------------------- Execution permission cannot be acquired. Description: An unhandled exception occurred during the execution of the current web request.

Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Security.Policy.PolicyException: Execution permission cannot be acquired.

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: [PolicyException: Execution permission cannot be acquired.] System.Security.SecurityManager.ResolvePolicy(Evidence evidence, PermissionSet reqdPset, PermissionSet optPset, PermissionSet denyPset, PermissionSet& denied, Boolean checkExecutionPermission) +10239176 System.Security.SecurityManager.ResolvePolicy(Evidence evidence, PermissionSet reqdPset, PermissionSet optPset, PermissionSet denyPset, PermissionSet& d

View Complete Post

More Related Resource Links

System.Security.SecurityException while accessing Sharepoint Webservices


Hi ,

We are consuming WSS3.0 webservices in our web application which is deployed in the same Sharepoint - 80 Front end web server.

--Sharepoint - 80 --> TestWebApp (using same shrepoint application pool, which uses farm administrator credentials)

-- IIS7 settings, Windows authentication and Asp.Net impersonation enabled for both sharepoint-80 and TestWebApp

When we try to access _vti_bin/Lists.asmx webservice from TestWebApp, we are getting the following message:

[SecurityException: Request for the permission of type 'System.Net.WebPermission, System, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.]
   System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet) +0
   System.Security.CodeAccessPermission.Demand() +54
   System.Net.HttpWebRequest..ctor(Uri uri, ServicePoint servicePoint) +204
   System.Net.HttpRequestCreator.Create(Uri Uri) +38
   System.Net.WebRequest.Create(Uri requestUri, Boolean useUriBase) +256
   System.Web.Services.Protocols.WebClientProtocol.GetWebRequest(Uri uri) +43
   System.Web.Services.Protocols.HttpWebClientProtocol.GetWebRequest(Uri uri) +20

SharePoint Tutorial - Security

Security in SharePoint is comprised of users, groups and roles.

Users, Groups and Roles

A user account comes from the authentication system. For example, if Active Directory is used to authenticate then the user accounts will come from it.

There are two types of groups SharePoint uses: domain groups and SharePoint groups.



hello i have the following problem

i have upload my content to hosting server but i get the following error

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 typ

System.Security.SecurityException: Request for the permission of type 'System.Web.AspNetHostingPerm


Good Day all,

Having an issue with an outside user accessing my IIS7 box. I do not have this problem when running the website from my host machine. I found this post: Http://forums.asp.net/t/1371394.aspx. I assure you that this is not a solution because I am not storing any of my files on a network share. 

What do you think my approach should be. 

I already have read rights to IIS user to my BIN folder. 

Thanks for the help. 

SharePoint Security: Trim SharePoint Search Results for Better Security


SharePoint search may return too much information, causing data security problems. Learn how to use the custom security trimmer to ensure users see only the documents they have permission to view.

Ashley Elenjickal, Pooja Harjani

MSDN Magazine July 2010

Office Space: Security Programming in SharePoint 2007


This month Ted Pattison presents an overview of programming security and permissions for Windows SharePoint Services 3.0.

Ted Pattison

MSDN Magazine February 2008

Crash Course: Analyze Crashes to Find Security Vulnerabilities in Your Apps


Here the authors analyze program crashes to help you understand if you have the potential for read or write violations in your applications, and how they can lead to security vulnerabilities.

A. Abouchaev, D. Hasse, S. Lambert, and G. Wroblewski

MSDN Magazine November 2007

WSE Security: Protect Your Web Services Through The Extensible Policy Framework In WSE 3.0


This article describes the WSE policy framework, which allows you to describe constraints and requirements a Web service must enforce. Discussions include security scenarios in WSE 3.0 and extending the framework with custom constraints and requirements.

Tomasz Janczuk

MSDN Magazine February 2006

Windows Server 2003: Discover Improved System Info, New Kernel, Debugging, Security, and UI APIs


There's a lot to say about Windows Server 2003. First of all, it's the first operating system with built-in .NET Framework support, and it's the first 64-bit OS from Microsoft. But wait, there's more! There are lots of new features and APIs in this version as well. For instance, Windows Server 2003 features Hot Add Memory and a number of other arcane new tidbits. There are new APIs for handling threads, directories, and files, and new features like the low fragmentation heap for managing memory and system information. There's vectored exception handling and new UI APIs as well.OS internals expert Matt Pietrek takes a look at the additions he finds most interesting and useful so you'll have a good place to start when you dive into Windows Server 2003.

Matt Pietrek

MSDN Magazine June 2003

Security in .NET: The Security Infrastructure of the CLR Provides Evidence, Policy, Permissions, and


The common language runtime of the .NET Framework has its own secure execution model that isn't bound by the limitations of the operating system it's running on. In addition, unlike the old principal-based security, the CLR enforces security policy based on where code is coming from rather than who the user is. This model, called code access security, makes sense in today's environment because so much code is installed over the Internet and even a trusted user doesn't know when that code is safe.In this article, Don Box explains how code access security works in the CLR. He discusses the kinds of evidence required by policy, how permissions are granted, and how policy is enforced by the runtime.

Don Box

MSDN Magazine September 2002

Usage of Client Access Policy and crossdomain xml for sharepoint 2010>?


Hi Folks,

1.What is Clientaccesspolicy.xml in sharepoint ?

2.What is Crossdomain.xml ?

What is usage of wcf service deploy in sharepoint 2010?

Kindly give me some valuable comments ?


Thank you


Immanuel c


SharePoint 2010: Security Resource Center (Developers)

Are you new to SharePoint security, or do you want to learn the latest about claims-based identity? Find information about areas of security, including authentication, role providers, and claims.

Administrator and Developer Guide to Code Access Security in SharePoint Server 2007

Explore configuration options, get best practices for managing CAS in SharePoint environments, and walk through a complex CAS scenario.

Video: Security and Deployment: Office Applications in SharePoint

Many times deployments are much more than a single Office Add-in. When additional items like Lists, Content Types, Workflows, etc. need to be deployed as well, you need a package that can be deployed by an administrator. This video discusses deploying complete applications to SharePoint. (Length: 9:30)

Video: Introduction to Claims-based Security in SharePoint 2010

Learn how claims-based identity provides a common way for applications to acquire identity information from users inside their organization, in other organizations, and on the Internet. (Length: 23:46)

Video: SharePoint 2010 File System

This video describes the SharePoint 2010 file system and integration with Visual Studio 2010. (Length: 3:23)

Using the Acceleration Toolkit for Microsoft Forefront Security for SharePoint

Learn how to supply full-fidelity FSSP enablement to a SharePoint environment, regardless of deployment phase with this acceleration toolkit.
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend