I'm trying to just build a super simple web part for on-prem, I go into VS 2017 and I select SharePoint 2016 - Visual Web Part, I don't modify any of the code and then I just compile and deploy and attempt to test.

However, I get this error when I try to add it to a page:


I've done some googling, not really sure what the solution is here, most of the resources on the web seem inconsistent.

Any ideas of what needs to be done? I've seen some references to "SafeControls" needing to be added but again, info is inconsistent about this.


2 Answers 2


There is a similar thread that may help you here

Try to retract the solution and deploy again, or recreate the webpart and make sure if you are on sandbox don't create Visual Web Part (Farm Solution Only) that won't work.

  • I've seen that before already, it's not the solution as it's literally the simplest web part ever. I'm wondering if there's some order of steps that should be taken when creating a new web part that people just aren't talking about that are in a book or something everyone is supposed to know? Also, when I create a new project for Visual Web Part - 2016, I select sandboxed solution. Commented Oct 23, 2017 at 10:15

I am assuming you are doing bin deployment. In that case:

  • upload webpart in sites webpart gallery.

  • put a safe control entry in Web.config file.

  • Place the dll in bin folder.

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.