Solved

Can't remove a feature

Posted on 2013-01-25
9
433 Views
Last Modified: 2013-02-05
I'm doing a tutorial on features. Somehow, I managed to add two features at the site collection level with the same exact display name in the features management window. I don't know how that can possibly happen, but I saw two features with the same name in features management.

I deactivated both features, then went to the features folder and saw one folder that matched the name of both features. I ran an uninstallfeature in stsadm and it succeeded.

Saw only one copy of the feature in features management instead of two. Ran uninstallfeature with the same name again hoping it would uninstall the remaining feature, but it said that feature is already uninstalled.

I removed the feature's folder under the features folder and now I'm still stuck with one remaining feature in the features management that I can actually still activate and deactivate. But I can't find the features folder that this has to be using. There is no folder left in features that matches it's name because I removed it. So how can I get rid of this?
0
Comment
Question by:BobHavertyComh
  • 5
  • 4
9 Comments
 
LVL 44

Expert Comment

by:Rainer Jeschor
ID: 38818922
Hi,
there will be scripting solutions as well, but perhaps you want to try:
http://spm.codeplex.com/

Use the appropriate version.

HTH
Rainer
0
 
LVL 9

Author Comment

by:BobHavertyComh
ID: 38818981
I already have that software, but I can't find anything that resembles the name of the feature. Am I looking in the wrong place within the tool?
0
 
LVL 44

Expert Comment

by:Rainer Jeschor
ID: 38819134
Hi,
yes, you would have to go through all features.

I hope you are on SharePoint 2010.
Here is a PowerShell script. Just open SharePoint Management Shell, adjust the output path and run the script.
It will list the GUID, title, the displayname and the root directory (sorted by Title).
Get-SPFeature | Sort @{Expression={$_.GetTitle(1033)}} -Descending:$false | ft @{Label='ID';Width=40;Expression={$_.Id}}, @{Label='Title';Width=80;Expression={$_.GetTitle(1033)}},@{Label='DisplayName';Width=80;Expression={$_.DisplayName}},@{Label='RootDirectory';Width=250;Expression={$_.RootDirectory}} | Out-File -Width 500 "C:\Temp\features.txt"

Open in new window


HTH
Rainer
0
Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

 
LVL 9

Author Comment

by:BobHavertyComh
ID: 38819236
OK, I saw the feature in the output file. Suddenly, I can no longer see the feature in the SP feature manager for activation/deactivation. That's good. Maybe it was merely an IE caching issue.

But I don't understand why this feature even shows up in the output when there is no corresponding folder for it in the features folder. I want to completely wipe this out so that it doesn't even show up on any output.

If it makes any difference, the only way that I can figure out that I could have created two features with the same name is because I gave them two different guids. This was a learning attempt at creating features, and the second copy was a retry of the same thing, most likely with a different guid entered, but everything else the same.
0
 
LVL 44

Accepted Solution

by:
Rainer Jeschor earned 500 total points
ID: 38819404
Hi,
that will go very very deep into how SharePoint handles its contents, but I think that SharePoint would not recognize / verify, if you delete the folder, as I assume that he stores the feature information also somewhere in the admin database.
I had even once the issue, that after just replacing a script file in a feature folder, it has been overwritten when the web application has been extended for another authentication.

To get rid of that orphaned feature, I would suggest to retract and remove the complete solution (if this is possible in your environment).

HTH
Rainer
0
 
LVL 9

Author Comment

by:BobHavertyComh
ID: 38819644
Hi Ranier, thanks. By solution, I'm assuming you are not talking about my VS solution. By solution, do you mean the site collection where this feature was deployed? If so, I think I would rather live with the orphan as it doesn't seem to be bothering anything, it just bothers me because the site collection now has an unwanted scar.

As far as your script problem, that might make sense if you edited a core feature, as extending the web app would probably work as sort of an upgrade, overwriting your customizations with their defaults.
0
 
LVL 44

Expert Comment

by:Rainer Jeschor
ID: 38820012
Hi,
in my sense
solution == WSP package
(which is in fact most of the times also a VS solution).

And no, it has been a completely custom feature (world map web part with a lot of Javascript) with 2 big Javascript files - where one has been adjusted. The behavior has been like SharePoint extracting the content of the WSP again during the extension of the second web app (so one content database for both, one app with windows for internal user, one with custom login modules for "external").
0
 
LVL 9

Author Comment

by:BobHavertyComh
ID: 38822210
I don't believe that I ever deployed a solution using VS or anything else, I manually deployed a feature by creating feature.xml and elements.xml, copying them to their feature folder under SP root and then running installfeature in stsadm. I know that VS will do all of this stuff for you automatically, but the course I'm watching thinks it's a good idea to do it manually so that you really understand what going on underneath the hood. I really don't have a solution per say and all of this could have been done in notepad. .The feature folder that contained these files is already gone, so I apologize but I still don't understand what you mean because it seems to me that there is no solution to delete. I'm still a novice trying to learn this stuff so i hope you can be patient with me..
0
 
LVL 9

Author Closing Comment

by:BobHavertyComh
ID: 38857721
The accepted solution is correct in a VS solution package situation, but i was performing this manually rather than through VS. I should have run remove -spFeatureFromContentDb, but I saw another article that suggested to carefully remove the offending entries from the features table in the content db if all else failed. Carefully removed the entries manually in SQL Studio, and it seems to have luckily worked so maybe remove -spFeatureFromContentDb luckily does only what I did manually and runs no other operations.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you create your solutions on SharePoint sooner or later you will come upon a request to set  permissions of the item depending on some of the item's meta-data - the author, people assigned as approvers, divisions, categories etc. The most natu…
I used to be SharePoint evangelist in our company, so my Outlook always full of questions about how to do this, or where I can find that. One day I found such an email with the following question: "how to attach 3-State workflow (one of the workflow…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

735 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question