Export (0) Print
Expand All

How to: Set up an on-premises development environment for apps for SharePoint

apps for SharePoint

Learn how to set up a development environment that is specifically suited to developing apps for SharePoint with an on-premises installation of SharePoint 2013.

First, decide whether to develop on a local computer where SharePoint 2013 is installed or to use an Office 365 Developer Site. If you want to distribute apps for SharePoint through an app catalog, such as apps for SharePoint that have full control permissions (which you cannot deploy to an Office 365 site), you’ll want to work with a full installation of SharePoint 2013 on a local computer. We provide the steps to set up a local installation of SharePoint 2013 and begin developing apps for SharePoint in this article.

An Office 365 Developer Site is preconfigured for app isolation and OAuth, so this option saves you the most time, and it enables you to develop on any computer and operating system on which you can install Visual Studio 2012. See How to: Set up an environment for developing apps for SharePoint on Office 365 for instructions on how to create this sort of development environment. See Get started developing apps for SharePoint if you’re not sure what sort of environment you’ll need or what kinds of apps for SharePoint you’ll want to create.

The requirements for a development environment are less stringent and costly than the requirements for a production environment, and the guidelines described here do not support a production environment installation. See Overview of SharePoint 2013 installation and configuration, Hardware and software requirements for SharePoint 2013, and Configure an environment for apps for SharePoint for the instructions to set up a production environment installation of SharePoint 2013.

In any development environment, you should use a computer with an x64-capable CPU, and at least 16 GB of RAM to install and run SharePoint 2013; 24 GB of RAM is preferable.

Depending on your specific requirements and budget, you can choose from the following options:

Note Note

Installation of SharePoint 2013 is supported only on Windows Server 2008 R2 Service Pack 1 x64 or Windows Server 2012. If you want to develop apps for SharePoint for SharePoint 2013 on Windows 7 or Windows 8, you can sign up for an Office 365 Developer Site and develop apps remotely. See How to: Set up an environment for developing apps for SharePoint on Office 365 for the instructions to create this kind of development environment.

SharePoint 2013 requires your operating system to have certain prerequisites installed before installation begins. For this reason, SharePoint 2013 includes a PrerequisiteInstaller.exe tool that installs all of the prerequisites for you. Run this tool before running the Setup.exe tool. After you install the prerequisites you can install SharePoint 2013.

  1. Run the Setup.exe tool included with your installation files.

  2. Accept the Microsoft Software License Terms.

  3. On the Choose the installation you want page, choose Stand-alone.

    Figure 1. Installation type choice

    SharePoint 2013 Installation Server Type
  4. If any errors occur in the installation, review the log file. To find the log file, open a Command Prompt window, and then type the following commands at the command prompt. A link to the log file also appears when the installation is complete.

    cd %temp%
    dir /od *.log
    
  5. After the installation is complete, you’re prompted to start the SharePoint Products and Technologies Configuration Wizard.

    Note Note

    The SharePoint Products and Technologies Configuration Wizard may fail if you’re using a computer that is joined to a domain but that is not connected to a domain controller. If you see this failure, connect to a domain controller either directly or through a Virtual Private Network (VPN) connection, or sign in with a local account that has administrative privileges on the computer.

  6. After the configuration wizard is complete, you see the Template Selection page of the new SharePoint 2013 site. On this page, choose the Developer Site template. You can only deploy apps for SharePoint from Visual Studio 2012 to a Developer Site.

    Figure 2. Choose the site template page

    Site template page

In this step, you configure services in SharePoint 2013 for server-to-server app use. These steps ensure that you will be able to create high trust provider-hosted apps with your installation. See How to: Create high-trust apps for SharePoint 2013 (advanced topic) for more information about creating this kind of app.

  1. Ensure that the app management service and user profile application are configured. The steps are as follows:

    1. In Central Administration, under Application Management, select Manage service applications.

    2. On the Service Applications page, ensure that the following services are started:

      • User Profile Service Application

      • App Management Service

    3. Under Application Management, select Manage services on server.

    4. On the Services on Server page, ensure that the following services are started:

      • User Profile Service

  2. Ensure that at least one profile is created in the User Profile Service Application. The steps are as follows:

    1. In Central Administration, under Application Management, select Manage service applications.

    2. Next, select User Profile Service Application.

    3. On the Manage Profile Service: User Profile Service Application page, under People, select Manage User Profiles.

    4. On the Manage User Profiles page, select New Profiles.

    5. On the Add User Profile page, type your account name and email address.

    6. Select Save and Close.

      Note Note

      If you get a message saying that the profile you are trying to create already exists, select Cancel and Go Back.

    7. Back on the Manage User Profiles page, you should see Total number of profiles: 1.

When you install Visual Studio 2012 and Office Developer Tools for Visual Studio 2012, you get all of templates and a new set of tools for developing apps for SharePoint on your local developer machine.

See Installing Visual Studio for instructions on installing Visual Studio 2012.

After you install Visual Studio 2012, download and install the Office Developer Tools for Visual Studio 2012 and the SharePoint Client Components, which contain tools and assemblies that you need to do app for SharePoint development. You can install these resources by going to the Downloads page of the Apps for Office and SharePoint Developer Center and choosing the link for the web-based platform installer (WebPI) that installs the tools and assemblies that you need to develop apps for SharePoint.

Verbose logging in Visual Studio 2012

Follow these steps if you want to turn on verbose logging:

  1. Open the registry, and navigate to HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\11.0\SharePointTools.

  2. Add a DWORD key named EnableDiagnostics.

  3. Give the key the value 1.

The registry path will change in future versions of Visual Studio.

If you want to create and deploy SharePoint-hosted apps on your SharePoint 2013 installation, you must create an isolated domain on the developer workstation where your apps for SharePoint will run. Your SharePoint 2013 installation needs a general wildcard host header domain where it can provision SharePoint-hosted apps.

This domain should be a URL namespace that you reserve as a namespace for organizing apps. For example, if you work at a company named Contoso, and you expose an extranet web application at the customapp.contoso.com domain, you can use a similar naming scheme for the app for SharePoint domain: apps.contoso.com. If you reserve this domain as your isolated app domain, when a SharePoint-hosted app is provisioned, it has a URL that looks like this: http[s]://tenantName-abcd1234.apps.contoso.com. The string, abcd1234 is a unique identifier that is arbitrarily assigned to each app instance. This example uses an Internet-style domain name for the app domain, but that doesn't mean that you have to expose your apps for SharePoint to the Internet. For production hosting scenarios, you would still have to create a DNS routing strategy within your intranet and optionally configure your firewall. See Install and Manage Apps for SharePoint for more information about how to create and configure a production environment for apps for SharePoint.

For development purposes, you can modify your hosts file as you need to route your development computer to a test instance of an app for SharePoint. Visual Studio 2012 modifies your hosts file automatically when you build and deploy the app. You shouldn't have to do more network configuration beyond host file modification after you create your isolated app domain.

Perform the steps in the following procedure to create an isolated app domain.

Note Note

You must perform all of the steps in the following procedure while logged in as the farm administrator, and you must run the command prompt and the SharePoint Management Shell as an administrator.

Create an isolated app domain on your development computer

  1. Ensure that the spadmin and sptimer services are running by opening a command prompt and typing the following commands.

    net start spadminv4
    net start sptimerv4
    
  2. Create your isolated app domain by running the SharePoint Management Shell as an administrator and typing the following command.

    Set-SPAppDomain "your app domain"
    
  3. Ensure that the SPSubscriptionSettingsService and AppManagementServiceInstance services are running by typing the following command in the SharePoint Management Shell.

    Get-SPServiceInstance | where{$_.GetType().Name -eq "AppManagementServiceInstance" -or $_.GetType().Name -eq "SPSubscriptionSettingsServiceInstance"} | Start-SPServiceInstance
    
  4. Verify that the SPSubscriptionSettingsService and AppManagementServiceInstance services are running by typing the following command in the SharePoint Management Shell. The output will indicate whether each service is online.

    Get-SPServiceInstance | where{$_.GetType().Name -eq "AppManagementServiceInstance" -or $_.GetType().Name -eq "SPSubscriptionSettingsServiceInstance"}
    
  5. You must specify an account under which the SPSubscriptionService and AppManagementServiceInstance service instances will run. This account must be an SPManagedAccount. You can create an SPManagedAccount by typing the following command in the SharePoint Management Shell. (You’ll be prompted for the account domain\user and password.)

    $account = New-SPManagedAccount
    
  6. Specify an account, application pool, and database settings for the SPSubscriptionService and AppManagementServiceInstance services by typing the following code in the SharePoint Management Shell. If you created a SPManagedAccount in the preceding step, use that account name here.

    $account = Get-SPManagedAccount "domain\user" 
    $appPoolSubSvc = New-SPServiceApplicationPool -Name SettingsServiceAppPool -Account $account
    $appPoolAppSvc = New-SPServiceApplicationPool -Name AppServiceAppPool -Account $account
    $appSubSvc = New-SPSubscriptionSettingsServiceApplication –ApplicationPool $appPoolSubSvc –Name SettingsServiceApp –DatabaseName SettingsServiceDB 
    $proxySubSvc = New-SPSubscriptionSettingsServiceApplicationProxy –ServiceApplication $appSubSvc
    $appAppSvc = New-SPAppManagementServiceApplication -ApplicationPool $appPoolAppSvc -Name AppServiceApp -DatabaseName AppServiceDB
    $proxyAppSvc = New-SPAppManagementServiceApplicationProxy -ServiceApplication $appAppSvc
    
    
  7. Specify your tenant name by typing the following code in the SharePoint Management Shell.

    Set-SPAppSiteSubscriptionName -Name "app" -Confirm:$false
    

After you create your isolated app domain, perform the steps in the following procedure to add that domain to your bypass list in Internet Explorer. This ensures that you can navigate to this domain after you deploy a SharePoint-hosted app. You can skip this procedure if your environment does not use a proxy server.

Add your isolated app domain to your bypass list in Internet Explorer

  1. In Internet Explorer, go to Tools.

  2. Choose Internet options.

  3. On the Connections tab, choose the LAN Settings button.

  4. Clear the Automatically detect settings check box.

  5. Select the Use a proxy server for your LAN check box.

  6. Choose the Advanced button, and then add *.YourAppDomain.com to the Exceptions list.

  7. Choose the OK button.

  8. Choose the OK button to close the Local Area Network (LAN) Settings dialog box.

  9. Choose the OK button to close the Internet Options dialog box.

See Deploying and installing apps for SharePoint: methods and options for information about your options for deploying your apps.

See How to: Create high-trust apps for SharePoint 2013 (advanced topic) for instructions on how to get started developing apps for SharePoint on your installation.

Tip Tip

After you deploy a SharePoint-hosted app to your installation, you may be prompted to log in with your credentials when you try to launch it. You will need to disable the loopback check to get rid of these prompts. See You receive error 401.1 when you browse a Web site that uses Integrated Authentication and is hosted on IIS 5.1 or a later version for instructions on how to disable the loopback check.

Community Additions

ADD
Show:
© 2014 Microsoft