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 that 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
To solve this above error, follow below steps:
- Remove the visual web part from the web part gallery in the SharePoint 2016 site: “
- 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.
- Again rebuild and deploy the Visual Web Part code in Visual Studio 2017.
- Once the code deploy will finish, Go to the SharePoint 2016 site and add the custom Web part to the Web Part page.
- 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:
- [Solved] Trying to use an SPWeb Object that has been closed or disposed and is no longer valid SharePoint 2013/3016 Server Object Model
- Add jQuery in a
visualweb part in SharePoint
Show all list in
dropdownlist using visual web part configuration properties in SharePoint 2010
- Create visual web part in SharePoint 2013/2016 using visual studio
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.
Hello Everyone!! I am Bhawana a SharePoint MVP and having about 10+ years of SharePoint experience as well as in .Net technologies. I have worked in all the versions of SharePoint from wss to Office 365. I have good exposure in Customization and Migration using Nintex, Metalogix tools. Now exploring more in SharePoint 2016 🙂 Hope here I can contribute and share my knowledge to the fullest. As I believe “There is no wealth like knowledge and no poverty like ignorance”