0

When I deploy my web part locally everything is fine. The web part is registered as safe, and is completely usable.

When I deploy the wsp to another server the web part comes back with the following error although everything appears to be deployed correctly (and the SafeControls appear within the web.config). :

Web Part Error: A Web Part or Web Form Control on this Page cannot be displayed or imported. The type XXXXX could not be found or it is not registered as safe.

It is almost the exact same issue as this question on stackoverflow. The only difference being that when I look at my web.config on the server I am deploying to I DO see the SafeControls.

Any thoughts on things that I could try to fix the issue? Server settings, how I package or deploy, etc.Blockquote

3
  • Are you deploying to the GAC or bin? Commented Nov 3, 2010 at 20:11
  • what does the web part do? Is there anything particular to the environment in the web part properties (like a URL) that would make it behave differently? Commented Nov 3, 2010 at 21:28
  • Deploying to GAC. Webpart looks at the Reusable Content list for a particular item. No direct calls to an absolute URL or anything like that.
    – mcnarya
    Commented Nov 4, 2010 at 13:26

2 Answers 2

0

Are you sure that the full name in the Safe Controls entry is exactly the same as the one of the Web Part? I'd suggest you verify that using Reflector to be sure that both values are correct.

1
  • Last time I checked it appeared to be correct. I will check again with reflector when I am able to.
    – mcnarya
    Commented Nov 4, 2010 at 13:26
0

I was able to solve my issues by manually removing the solution from the GAC. Then I just tried to add the solution again and everything works well.

I had added the web part in question after the initial upload of the solution (sorry about leaving that part out of the description). Before doing this I was trying to retract and delete from the Central Admin then retry the addition. Apparently this didn't actually delete the solution from the GAC.

The site was using the old version of the solution which did indeed not include a SafeControl for the new web part. Once the old version was removed the addition of the new version went without a hitch and all is well.

Thanks to all for their suggestions.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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