I have a .Net web application(3.5 Framework) which i converted it to WSP package and deployed the front-end aspx pages to _Layout of SharePoint webapplication and the third party Dll's(Like System.Oracle.Client) to the GAC folder of SharePoint Server. The deployment went well and i dint see any issues. But when i try to open my application it gives me the below error.After some research i came to that i will need to raise the trust level in the web.config file from "WSS_Custom_Medium" to "Full".

My application is working well when i made this change. But in my research i also came to know that i dont need to change the trust level if i am deploying my strong named dll's to GAC folder on the server.

Now i will have to add the custom permissions to our custom trust file to only allow oracle client as keeping Full trust will open security threats.

Can someone please suggest me a way on how to do this?

Request for the permission of type 'System.Data.OracleClient.OraclePermission, System.Data.OracleClient, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

1 Answer 1


Yes, it is highly recommend to use the custom policy because Full trust expose applications to unnecessary security risks.

In order to create a new trust, follow the steps below.

  • Create a custom Policy file wss_custom.config by copying the out-of-box policy file(copy t located in 14 hive under bin/config folder)
  • Add the Entry into web application web.config file(point to the new policy)
  • Modify the “wss_custom.config” policy file so the Dlls in bin directory of the sharepoint web application have CAS SharepointPermission.

Please see complete details over here.


also read this blog: http://blog.tylerholmes.com/2008/10/don-set-your-sharepoint-app-to-full.html

  • Thanks for the quick response Waqas. Can you please let me know if we can update the CAS policy through Manifest.xml of WSP package. Currently i am using WSP builder but when i changed the deployment to GAC location it did not generate any policies in teh manifiest.xml. Please let me know if there is a way to update the CAS policy without manual intervention.
    – user545359
    Sep 5, 2014 at 23:20
  • I am not developer so I don't know...but what I mentioned, is the way...i implemented when my developers want to change the trust policy to full...we consult msft for this n they approve it..to change via web.config
    – Waqas Sarwar MVP
    Sep 6, 2014 at 0:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.