I want to render some code dynamically so is it possible to write any C# code in SharePoint hosted app environment? And if not, then what are some alternative approach to achieve such goal?


A SharePoint-hosted App (aka SharePoint-hosted Add-in) cannot embed C# code. It's made of JavaScript only code.
The other kind of Apps (Provider-hosted App) may use C# code, but that code will run on a third-party server (and could use C# client API for SharePoint, as well as the identity of the initial user, if the App is used in Office 365 and thus leverages oAuth mechanisms).

  • So is there is any alternate possible solution? – Mrunal Shidurkar Mar 24 '16 at 6:49
  • 4
    No. use provider hosted app and write c# code without SERVER OBJECT MODEL. Another approach is abandon the app model , go with traditional on-premises solution with fully leveraging SSOM. – userAZLogicApps Mar 24 '16 at 7:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.