I have a SharePoint web part (essentially just a "Hello World" app) that I just created and am having a problem deploying it. I have signed the .dll, created the .dwp, and registered it as a safe control in web.config. I am able to add it to the Web Part Gallery and add the details for it; however, when I attempt to add it to a page, I get the following error:
A Web Part or Web Form Control on this Page cannot be displayed or imported. The type could not be found or it is not registered as safe.
Following is my .dwp file:
<?xml version="1.0"?>
<WebPart xmlns="http://schemas.microsoft.com/WebPart/v2">
<Assembly>SimpleWebPart, Version=1.0.0.0, Culture=neutral, PublicKeyToken=################</Assembly>
<TypeName>MyWebParts.SimpleWebPart</TypeName>
<Title>My Simple Web Part</Title>
<Description>A simple Web Part</Description>
</WebPart>
and the entry I added to web.config:
<SafeControl Assembly="SimpleWebPart, Version=1.0.0.0, Culture=neutral, PublicKeyToken=################" Namespace="MyWebParts" TypeName="*" Safe="True" />
I also tried using wildcards for the namespace, which didn't help. I have even tried setting the web.config trust level to "Full" (which I would never do in production, but tried to attempt to narrow down the problem) and still had no luck. Any ideas? Thanks.
Are you deploying your webpart using a SharePoint Solution (.wsp file)? Check out WSPBuilder if you aren't. We also use SharePoint Installer Between the two, a lot of the problems (whether stemming from human error or otherwise) in deployments, like your problem have been resolved in our environment.