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 just tried to delete a template form a sharepoint site and recieved the message

This form template cannot be deleted or modified because it is required for an activated feature. To remove this form template, you must deactivate the following feature: FeatureDefinition/53de7a1e-f557-1d77-347b-4fed24629904.

I'm fairly new to sharepoint and have almost no experience working with it, but i cant seem to find a way to find a feature from the GUID, how can i find out which feature needs disabling?

thanks

share|improve this question
add comment

1 Answer 1

up vote 2 down vote accepted

You can do this programmatically, from a Console app.

Features can be web scoped, site scoped, web application scoped or farm scoped. They all are stored in corresponding objects, in Features property, which is a SPFeatureCollection instance.

SPFeatureCollection methods and code samples are explained in following MSDN article: - http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spfeaturecollection(office.12).aspx

Based on their code, you can create your own function to enumerate features in site or web, or to search through features.

Or, to deactivate the feature programmatically without enumerating, you can use SPFeatureCollection.Remove method, this way:

bool removed = false;
Guid guid = new Guid("53de7a1e-f557-1d77-347b-4fed24629904");
using (SPSite site = new SPSite("http://site/url"))
{
    using (SPWeb web = site.OpenWeb())
    {
        try
        {
            web.Features.Remove(guid);
            removed = true;
        }
        catch { }
        try
        {
            site.Features.Remove(guid);
            removed = true;
        }
        catch { }

        Console.WriteLine(removed ? "Feature deactivated successfully." : "Feature was not found.");
    }
}

P.S. For SharePoint 2010, I would prefer PowerShell approach, of course...

share|improve this answer
    
Thanks, i had no idea it was that easy –  Manatherin Aug 4 '11 at 10:00
    
If you had SharePoint 2010, it could be much easier :) For example, SharePoint Explorer from Stefan Stanev can do search by a feature GUID: stefan-stanev-sharepoint-blog.blogspot.com/2010/05/… (I think this link could be useful for feature readers) –  Andrey Markeev Aug 4 '11 at 10:04
add comment

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.