1

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. 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.

Community
  • 1
  • 1
mcnarya
  • 841
  • 2
  • 11
  • 19
  • 2
    How are you deploying your webpart? Are you using PowerShell, stsadm or some other method? Have you deployed other custom webparts to this server without issue? – Peter Jacoby Nov 03 '10 at 20:53
  • These are the steps I took: Add-SPSolution c:\backup\controls.wsp Deploy solution using stsadm: stsadm.exe -o deploysolution -name "Controls.wsp" -local -allowga cdeployment -allcontenturls -allowcaspolicies –force IISRESET. – mcnarya Nov 04 '10 at 13:22
  • Have I deployed other custom webparts to this server? This is the first one being deployed to this server. The server is in a new environment that was just brought up. – mcnarya Nov 04 '10 at 13:24
  • No, there is no space. My mistake in the comment – mcnarya Nov 04 '10 at 13:33

1 Answers1

1

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.

mcnarya
  • 841
  • 2
  • 11
  • 19