Question

I am looking to set full trust for a single web part, is this possible? manifest.xml maybe?

Was it helpful?

Solution

Have you tried registering the assembly in the GAC? This is the preferred approach to giving any assembly full trust on your machine:

gacutil.exe \i C:\Path\To\Dll.dll

Hope that helps. Let me know if I misunderstood your question.

OTHER TIPS

As far as I recall manifest.xml is correct, and you specify the CodeAccessSecurity.

This article has a detailed description about it http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2007/07/05/how-to-configure-code-access-security-for-a-web-part.aspx

when you deploy your solution then you deploy it with the -allowCasPolicies flag on

I'm not sure i'd want to put a webpart into the GAC

You can install a CAB packaged web part to the GAC using

STSADM -o addwppack -filename yourwebpart.cab -globalinstall

If you are using WSP packages you need to set attributes in the manifext.xml file

<Assembly Location="yourassembly.dll" DeploymentTarget="GlobalAssemblyCache">

and call

STSADM -o AddSolution -filename yourwebpart.wsp

STSADM -o DeploySolution -name yourwebpart.wsp -allcontenturls -immediate -force -allowGacDeployment

Of course you shouldn't really install to the GAC if you can help it, setting CAS is the preferred way.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top