Vorheriges Thema: Copying files

Nächstes Thema: Enabling Session State on Microsoft Windows SharePoint

Modifying the Configuration Files

Prior to adding the web parts to SPS, you must modify the configuration files to suit your requirements by registering the Web Part as safe.

To register a web part as safe:

  1. Using Notepad or any other text editor, open the web.config file located in C:\Inetpub\wwwroot.
  2. Under the <SafeControls> section, add the following line:
    <SafeControl Assembly="InsightWebParts, Version=1.0.0.0, Culture=neutral, PublicKeyToken=06840085de116645" Namespace="Insight.WebParts" TypeName="*" Safe="True" />
    
  3. Verify that PublicKeyToken is correct by copying the InsightWebParts.dll file to the C:\Windows\Assembly folder (which is the Global Assembly Cache (GAC) folder) then right click and select Properties. The PublicKeyToken value should be 06840085de116645. Remove the file from the GAC.
  4. Under the <SecurityPolicy> section add the following line:
    <trustLevel name="WSS_Minimal_Custom" policyFile="C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\60\config\wss_minimaltrust_custom.config" />
    
  5. Under the </httpModules> section add the following line:
    <trustLevel name="WSS_Minimal_Custom" originUrl="" />
    
  6. Save and close the file.
  7. Go to C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\60\config.
  8. Copy the wss_minimaltrust.config file and rename to wss_minimaltrust_custom.config
  9. Using Notepad or any other text editor, open the wss_minimaltrust_custom.config file.
  10. Under the </CodeGroup> section add the following lines:
    <CodeGroup class="UnionCodeGroup" version="1" PermissionSetName="FullTrust">
    <IMembershipCondition version="1" class="StrongNameMembershipCondition" Name="InsightWebParts" PublicKeyBlob="00240000048000009400000006020000002400005253413100040000010001000907069C1276E74B2BAD4DBE97B0B9CA8D72F17E9A9A98482BC2AF4DCD3A018E45FDB585665852722B8A69B90FD1247EE475D658379E24A3EFCDEF2AFCBE11BF3FC6174C8D5E79C8D83666F249FEB376B19145CE28A1AD4165BCCF23FF27C3461F8791E5D74C7CDF6341121E6BDA74EA68347455E14E8DBCD5824146713805AE"/>
    </CodeGroup>
    
  11. Save and close the file.
  12. In Control Panel, double-click on Administrative Tools and on Computer Management.
  13. Under Services and Applications, click on Internet Information Services.
  14. Right-click on Web Sites and select Properties.
  15. Select the Home Directory tab and denote the Application pool.
  16. Click Cancel.
  17. Select Application Pools.
  18. Right-click on the application pool you denoted in step 15 and select Recycle.
  19. Go to Start then Run and type iisreset.
  20. Click OK.