SharePoint 2010 administrator-approved form template couldn’t be removed

You can find only some sparse information on the web about the error I encountered recently:

This form template was deployed as part of the feature XXX. This form template should be removed only by uninstalling that feature.

I just deployed an updated solution with the same template in it, being installed as a module in the virtual file system. Just when installing the feature, this error popped up. Going to Central Administration and trying to fix it there didn’t work either. I fired up Powershell and tried some more commands to little avail.

The problem is that installing the feature is not possible because the form already exists. Uninstalling the feature doesn’t work either because the feature is not installed. Thanks to Powershell, we can use the -force parameter (stsadm also had this before). The following two statements fixed the problem instantly:

install-spfeature "FeatureFolderPath" -Force

This forcefully installs the feature, ignoring any errors that occur.

uninstall-spfeature "FeatureFolderPath" -Force

This command then removes the template, after which you can deploy your solution again. I’m guessing the -force parameter is not necessary here.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s