16.01.2013 Views

Microsoft Sharepoint Products and Technologies Resource Kit eBook

Microsoft Sharepoint Products and Technologies Resource Kit eBook

Microsoft Sharepoint Products and Technologies Resource Kit eBook

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

1010 Part IX: Maintaining a Server in Windows SharePoint Services<br />

membership condition for the new code group is based on strong-named membership.<br />

Therefore, the element contains a PublicKeyBlob<br />

attribute. The next step discusses how to obtain the public key blob.<br />

<br />

<br />

9. To retrieve the public key blob for an assembly, use the Secutil.exe tool as<br />

follows: secutil.exe -hex -s MyAssemblyName.dll<br />

10. The Secutil tool extracts strong name information or the public key for an<br />

X.509 certificate from an assembly <strong>and</strong> converts this information into a format<br />

that can be incorporated into code. Please notice that the Secutil tool returns a<br />

string in the form of ““0X…”.…”. You should not include the 0X notation marker<br />

when copying the public key blob to the policy file.<br />

11. Save <strong>and</strong> close your .config file.<br />

12. Open the Web.config file for your Windows SharePoint Services virtual server,<br />

<strong>and</strong> add the following element:<br />

<br />

13. Go to the element in the Web.config file, <strong>and</strong> adjust it so that it refers<br />

to your custom trust level.<br />

<br />

14. Save <strong>and</strong> close the Web.config file, <strong>and</strong> run iisreset.<br />

Caution Failing to run iisreset can result in the display of the following error<br />

message: “Assembly AssemblyName security permission grant set is incompatible<br />

between app domains.” In ASP.NET programs, strong-named assemblies<br />

are loaded in a neutral domain. These assemblies are not unloaded<br />

until the process is stopped.<br />

Therefore, if the security policy for a strong-named assembly is<br />

altered, the common language runtime will cause an error message to<br />

appear when it detects that differing grant sets have been applied to the<br />

same assembly. This behavior typically occurs in scenarios where the trust<br />

level for a strong-named assembly has been changed.<br />

Another way to resolve this is to manually recycle the site’s associated<br />

application pool in the Internet Services Manager for IIS. To do this, in IIS<br />

Manager, exp<strong>and</strong> the local computer, exp<strong>and</strong> Application Pools, right-click<br />

the application pool, <strong>and</strong> then click Recycle.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!