I need to migrate SharePoint-2016 visual web part(C#) to SharePoint online. But visual web part contains custom feature like common XML configuration tags, send mail to users, authenticate AD groups, etc. What is the best way to migrate.

After done some search, by using Provided hosted app custom codes(c#) can be used in SharePoint Online. Kindly suggest any links or examples.

1 Answer 1


Provider hosted app is basically your only option since there's no way of deploying server-side code to SharePoint online.

You will have to rewrite parts of code which are using SharePoint Server-side Object Model to one of the client APIs - CSOM, JSOM, SPFx, REST API. Everything else (there are exceptions, such as SharePoint controls in markup) should be reusable. Just host it as ASP.NET web forms page in IIS and you should be ready to go.

  • From your answer IIS refers to Azure? Sep 17, 2019 at 12:36
  • @AravindHackett It can be hosted in Azure as well, but I was referring to on premises Internet Information Services web server which comes with Windows Server operating systems. Sep 18, 2019 at 4:14

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.