Error: “The operation could not be completed because the item was removed from the gallery” while adding a Custom Web part to a web part page in SharePoint 2016

In this SharePoint tutorial, we will discuss about the solution of an error as “The operation could not be completed because the item was removed from the gallery“.

Recently, I created a visual web part using Visual Studio 2017 for SharePoint 2016 and deployed to the SharePoint 2016 site. When I tried to add the visual web part to a SharePoint 2016 web part page, I got an error which says “The operation could not be completed because the item was removed from the gallery“.

Then the error message looks like below screenshot:

The operation could not be completed because the item was removed from the gallery
The operation could not be completed because the item was removed from the gallery

The operation could not be completed because the item was removed from the gallery

To solve this above error, follow below steps:

  1. Remove the visual web part from the web part gallery in the SharePoint 2016 site: “http://{SiteURL}/_catalogs/wp/Forms/AllItems.aspx
  2. Disable and then re-enable the feature containing the web part (at the web or the site collection level) to add the web part back to the gallery. To disable and re-enable the feature, Go to “Site Settings“-> “Site Collection Features“(Under Site Collection Administration)-> Deactivate and then Activate your specific Feature web part as shown in below.
The operation could not be completed because the item was removed from the gallery
The operation could not be completed because the item was removed from the gallery
  1. Again rebuild and deploy the Visual Web Part code in Visual Studio 2017.
  2. Once the code deploy will finish, Go to the SharePoint 2016 site and add the custom Web part to the Web Part page.
  3. While you will “Save” the Page, the web part will appear in the web part page.

You may like following SharePoint visual web part tutorials:

Hence in this SharePoint tutorial, we discussed the solution of an error as “The operation could not be completed because the item was removed from the gallery” in SharePoint 2016.

>