Developing apps for SharePoint on a remote system

apps for SharePoint

Learn how to develop apps for SharePoint by using a remote installation of SharePoint.

Last modified: April 29, 2014

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

With previous versions of the SharePoint tools in Visual Studio, developers had to install SharePoint Foundation or SharePoint Server locally before they could build SharePoint solutions in Visual Studio. This requirement increased the cost of development not only because more copies of SharePoint were needed but also because more capable systems were required to host them.

By using the Office Developer Tools for Visual Studio 2012 with Microsoft SharePoint 2013, however, you can create app for SharePoint solutions on a system by using a remote installation of SharePoint. You don't have to install SharePoint 2013 on your local system. This capability is known as remote development.

Important note Important

You can develop app for SharePoint solutions in Visual Studio 2012 if Microsoft SharePoint 2013 is installed on a remote server. However, you must install Microsoft SharePoint 2013 locally before you can develop other SharePoint solutions.

In a typical scenario for SharePoint development, every developer in a group had to install an operating system (generally a server operating system), Visual Studio, and a server version of SharePoint on that development machine. However, teams can develop apps for SharePoint remotely by installing SharePoint 2013 on a single server and then installing Windows, Visual Studio, and the Office Developer Tools for Visual Studio on each development machine. When you create an app for SharePoint solution, you simply reference the remote server that's running SharePoint instead of a local installation of SharePoint.

To remotely develop app for SharePoint solutions, you must install the following components.

  • A server operating system and a version of SharePoint 2013 on one server.

  • Developers must have Full Control permissions on the subsite of the server that's running SharePoint. For example, if a developer is creating an app for SharePoint on http://myserver/devweb, the developer must have Full Control permissions for devweb. The developer doesn't need site collection administrator permissions.

  • Each developer’s system must also have the following components installed on it.

    • Windows 7 or later version

    • Visual Studio 2012 or later version

    • Office Developer Tools for Visual Studio

You install the Office Developer Tools for Visual Studio by using the Microsoft Web Platform, which installs all of the required components.

After you install the required components, you can access the remote server that's running SharePoint in either of the following ways.

  • Specify the server name in the What SharePoint site do you want to use for debugging your App? list in the SharePoint Customization wizard when you are creating an app for SharePoint.

  • Specify the server name in the Site Url property of an app for SharePoint project.

When you run your app for SharePoint project, you are prompted to log on to the remote server that's running SharePoint. After you are successfully authenticated, you can continue to develop your app for SharePoint as you would with a local installation of SharePoint.

When you publish an app for SharePoint project that was developed remotely, the project’s Site URL property must be set to the URL of the remote server that's running SharePoint 2013.

To debug remote event receivers and app event receivers in an app for SharePoint, perform the following steps.

  1. If you're behind a firewall, you may need to install a proxy client (such as the Forefront Threat Management Gateway (TMG) Client), depending on your company's network topology.

  2. Register for a Microsoft Azure account if you haven't already, and then sign into that account.

    For information about how to register for an Azure account, see Microsoft Azure.

  3. Create an Azure Service Bus namespace, which you can use to debug remote events.

    For more information about the Azure Service Bus, see Messaging and Managing Service Bus Service Namespaces.

    Note Note

    Remote event debugging uses the Relay Service component of the Azure Service Bus, so you'll be charged for using the Service Bus. See Service Bus Pricing FAQ. You get free access to Azure each month that you subscribe to Visual Studio Professional with MSDN, Visual Studio Premium with MSDN, or Visual Studio Ultimate with MSDN. With this access, you can use the Service Bus relay for 1,500, 3,000, or 3,000 hours, depending on your MSDN subscription. See Get some amount of Microsoft Azure Services each month at no additional charge.

  4. In Azure, choose your service namespace, choose the Access Key link, and then copy the text in the Connection String box.

  5. On the properties page of your app for SharePoint project, choose the SharePoint tab, and then select the Enable debugging via Microsoft Azure Service Bus check box.

    You must enable this feature to debug remote events in cloud apps for SharePoint. This property applies to all of your SharePoint projects in Visual Studio. Visual Studio automatically turns off remote event debugging if you package your app for distribution on the Office store.

  6. In the Microsoft Azure Service Bus connection string box, paste the connection string that you copied.

  7. If you don't enable remote debugging and don't want to receive a notification whenever your project contains a remote event receiver or an app event receiver, clear the Notify me if Microsoft Azure Service Bus debugging is not configured check box.

After you enable remote event debugging and provide a valid connection string for the Azure Service Bus, you can debug remote events.

Note Note

If the remote event receiver doesn't hit a breakpoint immediately, the event might be asynchronous. Events that contain the word "being", such as "An item is being added" or "An item is being deleted", are synchronous and complete faster. Events that contain the word "was", such as "An item was added" or "An item was deleted", are asynchronous and take slightly longer to complete.

To understand how to debug remote events, you need some background information about how events in cloud apps for SharePoint work. A cloud app for SharePoint is a project that's provider-hosted. (SharePoint-hosted apps can't handle remote events.) When you develop a cloud app for SharePoint, you deploy it to the remote SharePoint site, where you debug the app. When you add remote event receivers and app event receivers to the cloud app, they handle events that occur in or to the app, such as list events, list item events, and app events. See Handling events in apps for SharePoint.

To create a cloud app for SharePoint, you must create not only a project for that app but also a web application project. When you debug cloud app projects, Visual Studio runs the web app locally on Internet Information Services (IIS) Express. When you add a remote event receiver or an app event receiver to your app for SharePoint project, Visual Studio adds a WCF service to the web application project. SharePoint calls that service whenever an event occurs in an app for SharePoint. In earlier versions of Office Developer Tools for Visual Studio, if your cloud app for SharePoint contained a remote event receiver, you couldn't debug it. SharePoint couldn't cross the network boundary between the app, which runs on the cloud, and the WCF service, which runs locally on IIS Express. However, Office Developer Tools for Visual Studio now enables a cloud app to use the Azure Service Bus to communicate with the WCF service. This approach avoids the network boundary issue so that you can debug remote event receivers in the cloud app.

Show:
© 2014 Microsoft