1

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=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed. 

1 Answer 1

0

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.

http://techsolutions-at-desk.blogspot.com/2011/08/how-to-create-new-custom-trust-level.html

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

2
  • 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. Commented 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 Commented Sep 6, 2014 at 0:37

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.