Link to home
Create AccountLog in
Avatar of ksd123
ksd123

asked on

Web Part Error-Sharepoint 2007

Hi,

I have a feature  in Sharpoint 2007 and it was working fine without any issue. I changed the code of the feature for the new requirement.Before moving new dll into GAC ,I took the backup of old dll from GAC and registered new dll into GAC.And I am getting follow error at the top of the page. Since I am getting error I restored(moved old dll to GAC) and did IIS reset, event then the below error is displaying at the top of the page.How can I get rid of above error?

Web Part 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.
Hide Error Details

[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.]
  at Microsoft.SharePoint.ApplicationRuntime.SafeControls.GetTypeFromGuid(Guid guid)
  at Microsoft.SharePoint.WebPartPages.SPWebPartManager.CreateWebPartsFromRowSetData(Boolean onlyInitializeClosedWebParts)
Avatar of ImaCircularSaw
ImaCircularSaw
Flag of United Kingdom of Great Britain and Northern Ireland image

I think you need to register the DLL/webpart as safe in the web.config file:

This should explain what needs doing:  http://grounding.co.za/blogs/brett/archive/2008/05/23/sharepoint-register-an-assembly-as-a-safe-control-in-the-web-config-file.aspx
Avatar of Rainer Jeschor
Hi,
did you run a new deployment? Did you change the version of the DLL?
How did you register the DLL in the GAC?

Please verify that the exact version information can be found in the web.config of the SharePoint application in the section "SafeControls".

HTH
Rainer
Avatar of ksd123
ksd123

ASKER

Hi ,

Sorry for the delay.For my requirement I have added two events (ItemUpdating,ItemAdding) to xml file and updated the code in the both the events (ItemUpdating,ItemAdding) in cs file and then build the solution.

Deployment

I took backup of GAC dll using C:/Windows/assembly/GAC_MSIL and  just dragged updated dll to GAC  and moved updated xml file to  %SystemDrive%\Program Files\Common Files\Microsoft Shared\web server extensions\12 ......

Is this the correct way to register DLL in the GAC? Am I missing anything for deployment?
ASKER CERTIFIED SOLUTION
Avatar of ksd123
ksd123

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of ksd123

ASKER

To resolve the issue we rebooted the server and now the error message is not showing up at the top of the page.