When you deploy a Web Part to SharePoint, you must first make it as a safe control to use within SharePoint in the web.config file. If the safe control entry exists, the object will be loaded otherwise they will throw an error.
How to add the safe control from Visual Studio…