views:

1350

answers:

6

So, I inherited a VS project that has a bunch of web parts in it. The project had a key file with a password that no one knows what the password is. So, i created a new key file which obviously changes the PublicKeyToken...

I thought deploying the new assembly to the GAC and replacing the old PublicKeyToken with the new one on the SafeControl references in the web.config would do the trick. However, when I go to the site none of the web controls work. They all say "Web Part Error..."

Here's an example of the old web.config safecontrol reference...

Here's the new one...

I got the new token by right-clicking and viewing the properties of the assembly from the "c:\windows\assembly" gac...

What am I doing wrong..?

+1  A: 

The safecontrol references don't show up, but as a first sanity check: you did remember to restart IIS (necessary when deploying to the GAC)?

Paul-Jan
A: 

It sounds like you made the correct changes, so maybe it's something else.
Have you checked the event logs and the sharepoint logs for errors?

Bravax
well... this is the error that is displayed on the page when I show the error details of each web part...C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\LOGS\
Jason
[UnsafeControlException: 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.]
Jason
not really seeing a whole lot in the IIS log. Anything I should be looking for..?
Jason
sorry... SharePoint log...
Jason
I would check your spelling on your safe control in your web.config matches your webpart name.
Bravax
A: 

Download and use the VSeWSS 1.3 extensions. It will do all of this automatically for you, including the deployment :-)

https://connect.microsoft.com/Downloads/Downloads.aspx?SiteID=428&wa=wsignin1.0

IrishChieftain
A: 

There are a couple of things you should check....

Unless you have a compelling reason, webparts should not deployed to the GAC, instead they should be in the bin folder of your webapp. This is where stsadm will put them for you. You should make sure that you don't have assemblies for your webpart in the bin folder if yo deploy to the GAC, sharepoint will get confused on which version to use--the GAC or the bin.

You should make sure it is registered as safecontrol in your webapp config file You should make sure to do an IISReset when you deploy ANYTHING to the GAC.

Muad'Dib
A: 

It is common problem in WSS that the template information is duplicated and embedded in the data in the database. One example of this is the definitions in the onet.xml file which is duplicated into each web instance. Another is when webparts are added to the page by the user. To change the strong name usually means you have to recreate every site where the web part has been used.

Øyvind Skaar
A: 

Change the strong name of an assembly means it changes for the system, in this case, SharePoint. So, the previous webpart are part of the assembly with the snk with unknown password. You have to reconfigure every page that contains an old webpart and put the new webpart.

jaloplo