RSS
 

Posts Tagged ‘Windows SharePoint Services 3.0’

Deleting SPList from SharePoint is not always working

13 Oct

Problem

When you are working with features and you’re removing your list instance in code. Sometimes, it can happen that the list is still present in SharePoint.

A list, survey, discussion board, or document library cannot have the same name as another list, survey, discussion board, or document library in this Web site. Use your browser’s Back button, and type a new name.

You can’t really reproduce this error as it happens “sometimes” (we love this sharepoint behaviour, don’t we ;) – there will be a reason for this tough).
In my case, I’ve had a feature that created a Document Library in the elements.xml file.


  

Deleting it afterwards in Code with a ListItemRemove Object.

 foreach (SPElementDefinition elementFile in elementFiles)
            {
                if (elementFile.ElementType == "ListInstance")
                {
                    string defaultResourceFile = properties.Feature.Definition.DefaultResourceFile;
                    string listTitle = SPUtility.GetLocalizedString(elementFile.XmlDefinition.Attributes["Title"].Value, defaultResourceFile, Convert.ToUInt32(ci.LCID));

                    SPList list = web.Lists[listTitle];
                    list.Delete();
                }
            }

The list has been deleted from SharePoint because you can’t see it anymore (View All Site Content link in the QuickLaunch Menu):

  • Browsing the List URL (WebDocs – as named in the elements.xml) gave a 404 error.
  • Creating a new List with the same name in code behind throws the famous “already exists” error.
  • Creating a new List in SharePoint works but the internal representation (eg. the URL) has been affixed by a number. (eg. WebDocs1 instead of WebDocs).

Google did not know the answer, people were encountering the problem but there wasn’t a solution anywhere. So let’s see what worked for me:

Solution

While debugging some other code, I saw my list in the SharePoint Web Object as a Folder. After deletion I was able to create a new list with the same name.

So basically, the SPList has been removed from the system but the SPFolder object is still there. So let’s remove the folder also if it still exists after removing the List instance.

using (SPSite objSite = new SPSite(SPContext.Current.Site.ID))
            {
                // get reference to the web application or web site
                using (SPWeb objWeb = objSite.OpenWeb())
                {
                    try
                    {
                        objWeb.Folders["InternalNameOfSPList"].Delete(); // Expression has been evaluated and has no value
                        // if you have a an exception of type 'System.ArgumentException' base {System.SystemException}: {"Value does not fall within the expected range."} it means that it was already deleted from the Folders. So we don't do anything.
                    }
                    catch (ArgumentException ex)
                    {
                        if (ex.Message != "Value does not fall within the expected range.")
                        {
                            throw new Exception();
                        }
                    }
                }
            }

I’m glad this solved my problem!!

 

Removing MICROSOFT##SSEE Service

28 Aug

Problem Description

When you perform a Basic Installation of WSS 3.0, SharePoint won’t use SQL Server by default. Instead it will create your database to the Windows Internal Database Service. If you want to use SQL Server, you’ll have to remove WSS and remove the Windows Internal Database Service (MICROSOFT##SSEE OR Windows Embedded Database) (as you don’t need it anymore).

The main reason why you want to do this is because you want to have WSS running on different machines (one for WSS and one for SQL Server).

Removing WSS 3.0 isn’t difficult but I ran into problems when I tried to remove the MICROSOFT##SSEE Instance.

Backup your Database

Make a copy of your folder that is located on the following path:

C:\Windows\SYSMSI\SSEE\MSSQL.2005\MSSQL\Data

MICROSOFT##SSEE Databases

MICROSOFT##SSEE Databases

Remove the instance

You can remove the instance using following commands:

(on 32-bit platforms)
msiexec /x {CEB5780F-1A70-44A9-850F-DE6C4F6AA8FB} callerid=ocsetup.exe
(on 64-bit platforms)
msiexec /x {BDD79957-5801-4A2D-B09E-852E7FA64D01} callerid=ocsetup.exe

- (on 32-bit platforms)

msiexec /x {CEB5780F-1A70-44A9-850F-DE6C4F6AA8FB} callerid=ocsetup.exe

- (on 64-bit platforms)

msiexec /x {BDD79957-5801-4A2D-B09E-852E7FA64D01} callerid=ocsetup.exe

Uninstall Error

If it has been removed, you’re lucky because I got the following error:

Windows Internal Database Uninstall Error

Windows Internal Database Uninstall Error

Product: Windows Internal Database — Error 29528. The setup has encountered an unexpected error while Setting

Internal Properties. The error is: Fatal error during installation.

Force the Uninstall

There is a fix for this, but it’s not very clean.

1. open Registry Editor (Run regedit)

2. Browse to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server

3. rename the folder to Microsoft SQL Server

4. rename your Microsoft SQL Server programs folder to Microsoft SQL Server_

5. run the uninstall of Windows Internal Database

6. remove the new created map HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server

7. rename the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server_ to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server

8. rename your program files folder Microsoft SQL Server_ to Microsoft SQL Server

I know it’s not the right way to do it, but it will fix your problem. You’ll notice that the service isn’t on your system, there may be some references left in your registery that you need to remove manually.

 

SharePoint Folder Structure (12 Hive)

13 Jul

Just posting because I’m always forgetting the path after some weeks… :)

The path to the heart of Windows SharePoint Services 3.0:
C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\LOGS

Some More Information:

\ADMISAPI

The directory contain the web service used used by the SharePoint Central Administration and appears as a virtual directory.

\BIN

The directory contains all the core binary files, utilities that are used by Windows SharePoint Services. Your command line tools such as STSADM.EXE reside in this folder

\BIN\LCIDD

A directory will be created for each language will be created that contains language specific binary files.

\CONFIG

This directory contains a set of configuration, binary and resource files used by SharePoint. Some files are the default values which will be copied to web site instances.

\Data

SharePoint uses this directory structure for the indexing services where content will be indexed.

\HCCab\LCID

This directory has a set of cab files containing manifest and content information used by the SharePoint help sytem

\Help

The folder contains a compiled html help file (.chm) used by the configuration wizard.

\ISAPI

This directory contains all the standard Web Services for SharePoint and some additional DLL’s, resources and configuration files that the web services use. Every web application provisioned in SharePoint will have a virtual directory strong>/_vti/_bin that points to this directory, thus giving each web application it’s own set of web services.

\ISAPI\HELP

This directory contains all the help files used by SharePoint. The folder also contains LCID sub directories for each language installed thus globalising the help system.

\LOGS

This is the directory that you will visiting frequently whilst doing development and administration as it contains the log files of what SharePoint did and what errors occurred.

\Resources

This directory contains the core.resx file used for creating language packs for SharePoint. If you are going to be localising your SharePoint sites with different languages and cultures, this is the folder to do it in.

\TEMPLATE

This directory structure contains the core web site functionality in SharePoint, that is the features, templates, configurations, resources of a web site. What is important to note about this directory structure is that the Virtual Path Provider hides and masks this directory structure, thus it appears under each web site, list in a completely different structure.

Source