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've got a custom webpart that's working great on different MOSS-servers. Now I tried to use this webpart on a 2nd sitecollection (B) on a server. It's already running on sitecollection A. What I did: The wsp-file is present on the server, so I just used: %STSADM% -o deploysolution -n xyz.wsp -local -url http://localhost:12345 in the servers console. I activated the webpart's feature and so on. When I try to add it to a site I get so following message:

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.

I also tried to change the webconfig of the 2nd site collection to trustlevel:Full, but nothin changed. Rebooting IIS and the server itself didn't help, too.

Can anybody help me?

Thanks in advance

Stefan

share|improve this question
add comment

4 Answers

is the second Site Collection within another Web Application than the first one? If yes check if the DLL behind the Web Part is in the GAC or was a BIN-Deployment. If second check if the DLL is in the right place of the second Web Application as well.

share|improve this answer
    
Each SiteCollection is using it's own WebApplication as the same user. The dll is in both bin-directories. –  user1832 Jan 14 '11 at 16:05
add comment

Have you checked the SafeControls section of the web.config in your second web application? There should be a SafeControl entry for your web part's namespace.

Deploying the wsp 'should' do this automatically, but just in case...

share|improve this answer
    
Yes, I checked these entries and can't find any differences to those in the other SiteCollection. –  user1832 Jan 17 '11 at 9:04
add comment

I got additional information.

I checked both webconfigs and the only difference is the "machine-key". The machine key must be different....Am I right?

Another try was undeploying the webpart and redeploying only to SiteCollection B. When trying to add the webpart to the site I get: "Unable to add selected webpart(s). XY: Cannot import the XY web part.

share|improve this answer
add comment
up vote 0 down vote accepted

I finally managed the Problem..........

The webpart-page was not correctly checked-in in sharepoint designer. That's why the page was not working well.

After checking out and in the webpartpage again. Everything worked fine!

share|improve this answer
add comment

Your Answer

 
discard

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