Freigeben über


SharePoint Training Kit: Cannot Delete Site

The SharePoint Training Kit is a great resource for ramping up on SharePoint features and functionality.

During the provisioning, the STK is created as a web (either root or subweb of a site) using a custom template.  Underneath, it creates three additional subwebs:  Trainer, Learner, and Report.

If for someone reason you need to remove the training kit from SharePoint, you may run into this problem.  First, since you cannot delete the top level web while it contains subwebs, you must first delete the three subwebs.  However, you may receive this error when trying to do so:

Cannot delete the training web site becasue you are not authorized or other training site depends on this site. at
Microsoft.SharePoint.Library.SPRequestInternalClass.DeleteWeb(String bstrUrl)
at Microsoft.SharePoint.Library.SPRequest.DeleteWeb(String bstrUrl)

The deactivate event in the feature receiver is restricting the DeleteWeb call.  To get past this, remove the two assemblies that are installed in the GAC when you ran the install:

Micrososft.SharePointTrainingKit.dll
Microsoft.SharePointTraining.Features.dll

1.  Browse to %WINDIR%\assembly
2.  Find the assembly, Right click > Uninstall

Run  IISRESET

You should now be able to delete the three subwebs, and finally the top level web. 

Note:  To add the DLLs back into the GAC:

1.  Browse to the install location of the Training Kit  (typically  C:\Program Files\Microsoft Office SharePoint Server 2007 Training) 
2.  Copy the MossTraining.wsp  file and past in the same folder (name is not important)
3.  Change the copied *.wsp  file's extension to  *.cab
4.  Double click on the *.cab file to open it up in an explorer window
5.  Find the two assemblies mentioned above, right click > Copy
6.  Browse back up one level and paste them into your install folder
7.  Open a new explorer window and browse to %WINDIR%\assembly
8.  DRAG the assemblies into the assembly folder  (copy & paste will not work)

Run IISREST