Project structure and properties of apps for SharePoint in Visual Studio

apps for SharePoint

When you create an app for SharePoint project in Visual Studio, a SharePoint project is added to a new solution together with all of the project items, files, and properties that the project type requires.

Last modified: April 29, 2014

Applies to: apps for SharePoint | Office 365 | SharePoint Foundation 2013 | SharePoint Server 2013

In this article
Structure of app for SharePoint projects
Properties of app for SharePoint projects
Additional resources

You can create two types of app for SharePoint projects in Visual Studio: provider-hosted and SharePoint-hosted. Provider-hosted apps for SharePoint are cloud-based, but SharePoint-hosted apps for SharePoint are based on a local server that's running SharePoint. All app for SharePoint projects include properties in the Properties window and a SharePoint page in the Project Properties dialog box. Depending on the type of app for SharePoint project that you create, additional files, project items, and properties become available.

Provider-hosted apps for SharePoint

A provider-hosted app for SharePoint solution contains two projects: an app project and a web application project. The app project contains the following files.

The web application project, which hosts the app for SharePoint, includes the following folders and files.

  • A Properties folder, which contains the properties for the web application project.

  • A References folder, which contains all of the assembly references that are used in the web application project.

  • A Pages folder, which contains web pages for the web application.

  • A Default.aspx file in the Pages folder. That file acts as the default home page for the web application. The Default.aspx page contains a code file, which performs tasks such as handling page events, and a designer file, which defines the layout of the page.

  • A TokenHelper code file, which enables your app for SharePoint to securely access SharePoint resources by using access tokens. For more information, see Authorization and authentication for apps in SharePoint 2013.

  • A Web.config file, which contains configuration information for the web application. This file includes information such as the ClientId and ClientSecret values that are used to communicate securely through OAuth with the app for SharePoint.

    For more information, see Important aspects of the app for SharePoint architecture and development landscape and How to: Create a basic provider-hosted app for SharePoint.

SharePoint-hosted apps for SharePoint

SharePoint-hosted app for SharePoint projects are hosted on a local server that's running SharePoint instead of the cloud, so no web application is provided. You package and deploy SharePoint-hosted app for SharePoint projects similarly to traditional SharePoint solutions. SharePoint-hosted projects include the following components.

  • A Features folder, which contains a .feature configuration file, which is used to deploy features to the server that's running SharePoint.

  • A Package folder, which contains a Package.package file, which is used to deploy the solution to the server that's running SharePoint.

  • An Images folder, which contains any image files that are used in the app for SharePoint project, such as icons or screenshots.

  • A Pages folder, which contains .aspx or .html pages that are used in the app for SharePoint project.

  • A Scripts folder, which contains any JavaScript code files that are used in the app for SharePoint project.

  • A Content folder, which contains any .css style sheets that are used in the app for SharePoint project.

  • An AppManifest.xml file, which defines the various elements of the app for SharePoint project. For more information, see Explore the app manifest and the package of an app for SharePoint.

For more information, see How to: Create a basic SharePoint-hosted app.

Each app for SharePoint has a set of associated properties: one set for the app project and (if it's a cloud-hosted app for SharePoint) another set for the host web application.

App properties

An app for SharePoint project has the following properties.

  • The App section properties include the Web Project property, which associates a web application project with the app for SharePoint project. This section also includes the SQL Data Script and SQL Package properties, where you can associate those files with the app for SharePoint project, if applicable.

  • The App for SharePoint Events section includes properties for handling events that occur in or to an app for SharePoint. For more information, see Handling events in apps for SharePoint.

  • The Misc section includes properties for the name of the project and its folder.

  • The SharePoint section includes the Active Deployment Configuration property, which you use to specify the series of steps that are performed during deployment; the Server Connection property, which you use to specify whether the project connects to the server that's running SharePoint; and the Site URL property, which you use to specify the URL where the app for SharePoint is located.

Web application properties

A web application project has the following properties.

  • The Development Server section includes the SSL Enabled and SSL URL properties, which specify whether secure socket layer (SSL) is enabled on the web application server’s site, and if so, the URL that's associated with that site. This section also includes the Windows Authentication property, which you use to specify whether Windows authentication is used on the site. For more information, see Tips and FAQ: OAuth and remote apps for SharePoint.

  • The Misc section includes properties for the name of the web application project and its folder location.

Show:
© 2014 Microsoft