Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I have successfully managed to make sharepoint web application claims-aware and connect it to my custom STS. Then I wanted to view claims user has after logging in. I got Claims Web Part from Claims Based Identity & Access Guide code samples (here). I opened the ClaimsWebPart solution, configured server URL, deployed and activated the feature. When I try to this web part, I'm getting this: A Web Part or Web Form Control on this Page cannot be displayed or imported. The type is not registered as safe.

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

I ran into the same problem and you need to add the control to the SafeControls section of the web.config. You can do this in VS.Net 2010 by clicking on the "Manifest" button after opening the projects "Package.package" object. It's located on the lower left hand side, then you select the "Edit Options" where you can edit the Solution information. Example shown below:

<Solution xmlns="http://schemas.microsoft.com/sharepoint/" SolutionId="{THE_GUID}" SharePointProductVersion="14.0">
  <Assemblies>
    <Assembly Location="My.Webpart.Solution.dll" DeploymentTarget="GlobalAssemblyCache">
      <SafeControls>
        <SafeControl Assembly="My.Webpart.Solution, Version=1.0.0.0, Culture=neutral, PublicKeyToken={TOKEN}" Namespace="My.Webpart.Solution.TheWebPartObject" TypeName="TheWebPartObject" Safe="True" />
      </SafeControls>
    </Assembly>
  </Assemblies>
  <FeatureManifests>
    <FeatureManifest Location="TheWebPartObjectFolder\Feature.xml" />
  </FeatureManifests>
</Solution>
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.