Forum Discussion

Arjun_Suda_S's avatar
Arjun_Suda_S
Copper Contributor
Jul 24, 2019

Creating an addin for sharepoint that uses c#

Hi Everyone,

 

I would like tp create an addin for Sharepoint online which uses  c# code and libraries. I am following the tutorial mentioned in: https://docs.microsoft.com/en-us/sharepoint/dev/sp-add-ins/get-started-creating-sharepoint-hosted-sharepoint-add-ins

I have deployed the addin created from default template in Visual Studio 2019, and now I wish to include and execute a C# file for generating an access token from this framework. 

I am confused how to call this file from .aspx page and make it work on the sharepoint addin page. Please help.

1 Reply

  • paulpascha's avatar
    paulpascha
    Bronze Contributor
    You won't be able to use C# inside of a SharePoint-hosted add-in. SharePoint supports 2 types of add-ins: "SharePoint-hosted" and "Provider-hosted". You need to create a Provider-hosted add-in to be able to use C# and libraries.

    https://docs.microsoft.com/en-us/sharepoint/dev/sp-add-ins/get-started-creating-provider-hosted-sharepoint-add-ins

Resources