To learn how to create a Client Side Object Model (CSOM) project solution in SharePoint 2013 app in visual studio 2013, do the following:
A provider hosted app is one way to go. Autohosted is another.
You can select either of those options when you create a new app for SharePoint. With that you get a very simple template that already has some basic code calling back to SharePoint via CSOM.
There is a more advanced option as well. If you already have an existing Visual Studio solution with a SharePoint-hosted app and you’d like to continue using it:
- Add New Project
- Select the “Web” category
- Select any of the available web project types. e.g. MVC or Web Forms
- Select SharePoint App project
- Locate Web Project Property
- Select your new web project from the drop down
When you do that, VS will automatically reconfigure your app for SharePoint to an autohosted app and add TokenHelper.cs to the web project.