0

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

naspinski
  • 34,020
  • 36
  • 111
  • 167

3 Answers3

3

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

thmsn
  • 1,976
  • 1
  • 18
  • 25
1

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.

Ed Altorfer
  • 4,373
  • 1
  • 24
  • 27
  • I am deploying my custom made webparts with a CAB file and 'stsadm -o addwppack', will this be in the GAC? How can I check? – naspinski Oct 16 '08 at 05:25
  • naspinski - probably better to edit your question to clarify the CAB package, people may not see your comment here – Ryan Oct 16 '08 at 07:05
1

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.

Ryan
  • 23,871
  • 24
  • 86
  • 132