0

I have a question, basically when i run Test-SPContentDatabase I get an error "MissingFeature" with an ID.

I used the Feature Admin, this one doesn't give any faulty features or whatever, i checked all the features and i cannot find the feature with this ID.

Then i queried a database for the feature, the database on which i ran this test:

select * from [Features] where (FeatureId ="xxxxx")

But it doesn't give any results, where else do i find a reference and can establish this feature, and which feature this is?

Any idea?

2
  • how do we know whats the missing feature without the feature id? ;)
    – Ali Jafer
    Commented Apr 25, 2014 at 12:37
  • oh no, no, i do know the feature id, abefc73c-f823-4b14-9711-74bc7dea213d
    – Shkipper
    Commented Apr 25, 2014 at 12:51

1 Answer 1

0

someone created a very simple app for you to use, run it on the server and enter the guid then click the button...

http://featurenamefromid.codeplex.com/

enter image description here

your not going to find it on the database as that is where its missing! it would be on sharepoint. The app will tell you the name....

if you look at the code its very simple!

        SPFarm oFarm = SPFarm.Local;
        var cInfo = new CultureInfo(1033);
        foreach (var oFeatureDev in oFarm.FeatureDefinitions)
        {
            if (oFeatureDev.Id.ToString().ToUpper().Contains(TextBoxFeatureId.Text.ToUpper()))
            listBoxFeatureNames.Items.Add(oFeatureDev.GetTitle(cInfo));

        }

to delete the feature, do:

farm.FeatureDefinitions[listBox1.Items[0].ToString()].Delete();

if you want to make the current app fancy than replace his code with the code below. You just need to add another button and give it the control name of btnDelete

in designer create a new button and call it delete, than give it an id of btnDelete

now double click the button and replace all code within the class with this:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Microsoft.SharePoint.Administration;
using System.Globalization;

namespace FindFeatureFromId
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        SPFarm oFarm;

        private void Find_Click(object sender, EventArgs e)
        {

            oFarm = SPFarm.Local;
            var cInfo = new CultureInfo(1033);
            foreach (var oFeatureDev in oFarm.FeatureDefinitions)
            {
                if (oFeatureDev.Id.ToString().ToUpper().Contains(TextBoxFeatureId.Text.ToUpper()))
                listBoxFeatureNames.Items.Add(oFeatureDev.GetTitle(cInfo));

            }
        }

        private void btnDelete_Click(object sender, EventArgs e)
        {
                var confirmResult =  MessageBox.Show("Do you want to delete this item?",
                        "Confirm Deletion", 
                        MessageBoxButtons.YesNo);
                if (confirmResult == DialogResult.Yes)
                {
                    oFarm.FeatureDefinitions[listBoxFeatureNames.Items[0].ToString()].Delete();
                    oFarm.Update();
                    MessageBox.Show("Item Deleted");
                    listBoxFeatureNames.Items.Remove(listBoxFeatureNames.Items[0]);
                }
        }

    }
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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