Go SharePoint App Development (2)-building a development environment

Source: Internet
Author: User

This article belongs to the SharePoint Apps Development series article, and this series of articles includes:

    • SharePoint app Development (1)-What is a SharePoint app?
    • SharePoint app Development (2)-Building a development environment (this article)

Before you develop a SharePoint app, developers need to have a SharePoint development environment. Regardless of the type of application being developed, developers need to prepare the appropriate development environment on the development machine. For example, if you are developing an ASP. NET Web application, you will probably need IIS (or IIS Express) and a SQL Server database server in addition to Visual Studio on the development machine. Similarly, for SharePoint engineers, there is a need to prepare an environment on the development machine that can be used to develop SharePoint applications. Just preparing a SharePoint development environment is usually a lot more complex than preparing an ASP. (although SharePoint is largely based on ASP.)

If you've ever prepared a SharePoint 2007/2010 development environment, you should know that SharePoint 2007/2010 does not support remote development. In other words, SharePoint 2007/2010 cannot have programmers open Visual Studio to create SharePoint solution on a local development machine that does not have SharePoint server installed. Then deploy to a server that is remotely installed on SharePoint Server, and then run and Debug. SharePoint 2007/2010 requires that the SharePoint system itself must be installed in the engineer's local development environment, and Visual Studio can only deploy the developed solution directly to the local SharePoint system for debugging. This makes it possible for developers of SharePoint 2007/2010 to choose either to use Windows Server as the operating system on their own development machine or to use some kind of virtual machine technology (Hyper-V, VMware) to build the development environment.

When SharePoint 2010 was released in the current year, one of the major improvements in development support was the support being installed on the Vista/windows 7 client operating system. This way, if the developer's development machine is using the Windows 7 operating system, you can install SharePoint 2010 directly (you need to modify the installation profile) instead of replacing the operating system with Windows Server or using a virtual machine.

SharePoint 2013 has some notable changes in building the development environment. If developers are developing SharePoint solution, they still need to have a local SharePoint 2013 environment on the development machine, and SharePoint 2013 no longer supports installation to Windows 7 or Windows 8 on the client operating system. But this series of articles is not about SharePoint solution development, but rather the SharePoint app development, so the situation is different. Simply put, if a developer is developing a SharePoint App, there are two choices to build the development environment:

    • Use the cloud environment provided by Office 365
    • Build a SharePoint 2013 environment locally

Building a development environment with Office 365

If you don't want to spend a lot of time and effort (or if you don't have the appropriate hardware resources) to build a full SharePoint 2013 environment locally, you can use one of the remote development environments that Office 365 provides. This Office 365 development environment is free and allows you to develop SharePoint apps in Visual Studio 2012 on your on-premises development machine, and then publish your app to the cloud Office 365 Developer site.

First, click here to complete the registration process for Office 365 Developer Preview. (When writing this article, Office 365 Developer Preview does not support registration in the China region, so you may need to complete the registration with a U.S. address.) )

During the registration process, you will enter the domain name you want (a domain name ending in onmicrosoft.com, such as kaneboy.OnMicrosoft.com), and an ID that is suffixed with the domain name you choose (such as [email protected] ). Later you will need to use this user ID to log in to Office 365 Preview.

Once you have completed the registration process, you will be able to open an Office 365 Preview Admin Center interface. If you have just signed up for Office 365 Developer Preview and have entered this interface for the first time, the "current health" displayed on the page may show that the different services are still initializing, and you just have to wait for each service initialization to complete.

Click Admin at the top right of the page, and then select SharePoint from the menu.

On the SharePoint Admin Center interface that opens, all of the SharePoint sites are displayed. There is a website with a URL of "http://Your ID.sharepoint.com", which is the SharePoint Developer site provided by Office 365 preview. Open it.

Now you have a SharePoint Developer Site, which is located in the cloud, provided by Office 365. You can use this developer site to complete the publishing and debugging of SharePoint apps.

Hint: Exactly what is developer Site?

When you develop SharePoint apps, Visual Studio 2012, while debugging your app, must publish the app to a special type of SharePoint 2013 site, which is developer site. In SharePoint 2013, there is a built-in site template: The developer site, which uses the SharePoint site created by this template, which is developer site, that you can use to publish and debug SharePoint apps. The system administrator can build as many developer Site as needed. In addition to developer site, Visual Studio cannot publish apps directly to any other type of SharePoint site.

When we create a new SharePoint app project in Visual Studio, the Project Wizard prompts us to provide a developer Site. Developer site is required for app development.

Because Office 365 provides us with a Developer site in the cloud, developers don't need to build a full SharePoint 2013 environment locally, but instead use this Office 365 Developer site, For app development.

Create a SharePoint 2013 development environment locally

In addition to using Office 365 Developer site, developers can choose to build a complete SharePoint 2013 development environment on a local development machine. Building a local development environment is a lot more cumbersome than using Office 365 directly, and requires more hardware resources. But there are some benefits to this choice:

    • You don't need to rely on connecting to an Internet network connection to Office 365
    • If you're developing SharePoint solution in addition to the SharePoint app, you'll still need a local development environment

Creating a SharePoint 2013 local development environment is essentially installing a SharePoint 2013 environment on your local computer. If your work environment is using Windows Server R2 SP1 or Windows Server 2012, you can install SharePoint in your work environment directly (Windows Server R2 SP1 and WI Ndows Server 2012 is the only one that supports the installation of two operating systems for SharePoint 2013. But if your work environment is using a client operating system, such as Windows 7 or Windows 8, it is more appropriate to use virtual machine technology to create a SharePoint 2013 development environment within a virtual machine. The author's notebook installs Windows 8, and one of the benefits of Windows 8 is that it has a built-in Hyper-V component, so I don't need to install other third-party virtual machine software (such as VMware).

Of course, the use of virtual machine technology, the performance of your development machine has certain requirements. It is best to have 16GB of memory on the development machine so that at least 10GB of it can be allocated to the virtual machine. While you can run a SharePoint 2013 virtual machine on a machine with less memory, it's likely to run fast enough to make you mad. In addition, because running virtual machines has certain requirements for disk I/O performance, it is recommended that you place the disk image files of the virtual machine on the machine's non-system hard disk. For example, you can install the operating system and other software on the first hard drive, and then place the virtual machine disk image file on the second hard drive. Using a dedicated SSD hard drive to place virtual machine disk image files is the best choice (but it also means the highest cost).

Because using virtual machine technology to create a SharePoint 2013 development environment is a more common practice, in the following sections, you will learn how to create a complete development environment from the operating system. But before we get started, we need to make sure that the entire SharePoint 2013 development environment contains a total of several virtual machines. Basically, you can actually install everything you need on a separate virtual machine, which will include:

    • Windows Server R2 SP1 (or Windows Server 2012) operating systems
    • Active Directory domain Controller components
    • SQL Server 2012 Database server
    • SharePoint Server 2013
    • Office 2013
    • SharePoint Designer 2013
    • Visio 2013
    • Visual Studio 2012
    • Workflow Manager
    • Office Developer Tools for Visual Studio 2012

In addition to the software above, if your development environment must require Office Web Apps Server 2013, you need a second virtual machine because Office Web Apps Server 2013 cannot and SharePoint server 2013 installed on the same server.

(1) Installing Windows Server R2 SP1 operating system

The basic steps are as follows:

    • Install Windows Server R2.
    • Install the Service Pack 1 Patch pack.
    • Modify the Windows machine name of the virtual machine to the appropriate name, such as "SP2013".
    • In Server Manager for Windows Server, install the features "desktop Experience" and "Windows PowerShell integrated Scripting Environment (ISE)".
    • Specify a fixed IP address (such as 192.168.100.1) for the network card of the virtual machine, and designate the DNS server as its own IP.
    • To make it easier to install subsequent software later, add a second NIC to the virtual machine so that the second NIC can connect to the Internet.
    • Disable the loopback check in Windows Server. The way is to download this disable loopback check the repair package and then run it, or browse this page, and then manually modify the registry according to the method in "Method 1: Disable loopback check."

(2) Installing the Active Directory domain controller

The basic steps are as follows:

    • In Server Manager for Windows Server, add the role Active directory Domain Services.
    • Run the Active Directory Domain Services Setup Wizard, in the wizard, you will be prompted for a domain name, just enter a desired name, such as "contoso.com".

(3) Installing SQL Server 2012

Follow the standard steps to complete SQL Server 2012. When you select the SQL Server feature that you want to install, you need to confirm that the Database Engine service and its full-text retrieval service are selected at least.

(4) Installing SharePoint Server 2013

Start the installation program for SharePoint Server 2013 (double-click the Default.hta of the installation file root), and then tap Install prerequisite software.

With the SharePoint 2013 Product Preparation Tool, let it automatically download all the required components and install the necessary roles and features on Windows Server (you may be prompted for a restart in the middle). After the product Preparation tool has finished running, confirm that all required components have been successfully installed and configured in the prompt interface.

Restart Windows Server. Manually download and install the following 3 patch packs:

    • KB2554876: After opening this page, send the download link to your mailbox.
    • KB2708075: Open this page and download it directly.
    • KB2759112: Click here to download directly. (If Windows Server 2012, for download KB2765317, click here to download directly.) )

Restart Windows Server again, and then run SharePoint Server 2013 Setup again, and then click Install SharePoint Server 2013. Follow the wizard prompts to install all files, and then run the SharePoint 2013 Product Configuration Wizard.

In the Product Configuration Wizard, select Establish a new farm, and then specify the name of the database server (that is, native) and the ad domain account that is used to connect to the database server. If required, you can manually specify a specific port for the Central Administration site. Complete the run of the Product Configuration Wizard. When you are finished, the browser opens automatically and opens the Central Administration site.

The first time you open the Central Administration site, you are prompted to run the Farm Configuration Wizard.

After starting the wizard, enter a service account or use an existing managed account in the first wizard interface. Below the interface, a number of services are displayed, uncheck "Application Management Services"and click Next to have the Server Farm Wizard install other selected services.

When the wizard installs the service, the page prompts you to wait a little while, but you may wait a long time here to discover that the page still displays the same wait information. If this happens, after confirming that you have waited at least half an hour, you can close the browser and then reopen the SharePoint 2013 Admin Center from the Start menu. All the services should have been installed.

Open DNS Manager in Windows Server Central Administration, under forward lookup zones, expand the Domain name Master node, and then add a pan domain name resolution that points to the local IP address. The added method is to enter the asterisk (*) directly in the Host text box. Added *.contoso.com after the pan domain name resolution, so the contoso.com end of the domain name (such as intranet.contoso.com, apps.contoso.com, app-1.apps.contoso.com), will be resolved to the local IP address.

The purpose of adding *.contoso.com to this generic domain name resolution is because we want to use the domain name "apps.contoso.com" as the application domain hosted by the app. The next step is to configure app hosting.

Click the Start menu –> All Programs –> Microsoft SharePoint Products, and then open the SharePoint 2013 Management Shell with administrator privileges. Perform the following PowerShell cmdlets:

Set the application domain to "apps.contoso.com"

$appHostDomain = "Apps.contoso.com"
Set-spappdomain $appHostDomain

Start the Application Management service and the Microsoft SharePoint foudation Subscription Settings Service
$appMgmtSvcInstance = Get-spserviceinstance | Where-object {$_. GetType (). Name-eq "Appmanagementserviceinstance"}
if ($appMgmtSvcInstance. Status-ne "Online") {start-spserviceinstance-identity $appMgmtSvcInstance}
$appSubSettingSvcInstance = Get-spserviceinstance | Where-object {$_. GetType (). Name-eq "Spsubscriptionsettingsserviceinstance"}
if ($appSubSettingSvcInstance. Status-ne "Online") {start-spserviceinstance-identity $appSubSettingSvcInstance}

Create the Settings service application and application Management Service applications
$appPoolServiceApps = get-spserviceapplicationpool-identity "SharePoint Web Services Default"
$APPSUBSVC = New-spsubscriptionsettingsserviceapplication-applicationpool $appPoolServiceApps-name "Settings Service Application "-databasename settingsservicedb
$PROXYSUBSVC = New-spsubscriptionsettingsserviceapplicationproxy-serviceapplication $APPSUBSVC
$APPAPPSVC = New-spappmanagementserviceapplication-applicationpool $appPoolServiceApps-name "Application Management Service"- DatabaseName Appservicedb
$PROXYAPPSVC = New-spappmanagementserviceapplicationproxy-serviceapplication $APPAPPSVC

Setting the application prefix
Set-spappsitesubscriptionname-name "App"-confirm: $false

After the run is complete, on the SharePoint 2013 Central Administration Web site, open the "System settings-Management Server Services" page, you should be able to see that the following two services are already in the startup state.

Then open the application management-Manage Service Applications page and you should be able to see the following two service applications on the page.

Finally open the application-Configure Application URL page, and the application domain and application prefixes on the page should look like the following.

Finally, in the newly installed SharePoint 2013 system, create a new developer site (you remember the role of developer site, right?). )。 Create a new site collection in central Administration, and then select the developer site template.

(5) Installing the Office client program

Install Office 2013, SharePoint Designer 2013, and Visio 2013 in the virtual machine. Where SharePoint Designer 2013 is free to download.

(6) Installing Visual Studio 2012

Install Visual Studio 2012 in the virtual machine. When I wrote this article, Visual Studio Update1 has been released.

(7) Installing Workflow Manager

Download Workflow Manager 1.0 from this page, and then double-click the downloaded WorkflowManager.exe. In fact, this is a Web platform Installer (Web Platform Installer, abbreviated WEBPI) installation package that will start the Web Platform installer on the machine 4.0 (if WEBPI 4.0 is not installed on the machine, it will be downloaded and installed automatically), To download and install all required components.

When you install Workflow Manager 1.0, WEBPI automatically installs the following dependent components:

    • Workflow Client 1.0
    • Service Bus 1.0
    • Microsoft Windows Fabric

The Workflow Manager configuration is started after WEBPI 4.0 completes the installation. In the Configuration Wizard, select Configure Workflow Manager by default, and the Configuration wizard will then create a workflow Farm.

In the new Workflow farm interface, enter the name of the SQL Server server and enter a service account. The format of the service account must be "account @ Full domain name", such as "[email protected]". In the text box of the service account, the full domain name is not displayed by default after the @ symbol (for example, it only shows "@contoso"), and you must complete it as a full domain name. Check the box below to allow connections over HTTP. Enter any key to generate the certificate.

Continue with the other steps to complete the Workflow Manager Configuration Wizard.

Next you will also need to connect the SharePoint system to the workflow Farm. Open the Windows Start menu, under the Workflow Manager 1.0 folder, there is a Workflow Manager PowerShell, run it, and then execute the "get-wffarm" directive. After the instruction is run, the information for the workflow farm is listed, where we want to use the Httpport information, and its default value should be 12291.

Then open the SharePoint 2013 Management Shell and execute "register-spworkflowservice-spsite" http://sp2013 "-workflowhosturi" http:// sp2013:12291 "-allowoauthhttp" directive. The SPSite parameter of the directive is to be specified as the path to an existing SharePoint 2013 site collection, and the Workflowhosturi parameter is specified as the endpoint path of the workflow farm in your environment, where 12291 ports come from the previous " Get-wffarm"command to obtain the port information.

The Workflow Manager is now installed and configured to complete.

(8) Installing Office Developer Tools for Visual Studio 2012

Office Developer Tools for Visual Studio 2012 includes support for SharePoint app development, and without this plugin, there will be no SharePoint app in Visual Studio 2012 of the project template. When I wrote this article, the fact that office Developer Tools for Visual Studio 2012 had not yet released the official version, the latest version is preview 2. But the preview 2 version of developer Tools is for both the visual Studio 2012 release and the SharePoint 2013 release, but the developer tools tool itself does not have RTM. You can click here to download developer Tools Preview 2. Note that the installation of Developer tools is also done through WEBPI 4.0来. The Web Pi also installs the following components that Office Developer tools depend on:

    • Windows Identity Foundation SDK
    • SharePoint Client Component
    • Workflow Manager Tools for VS2012
    • Microsoft Exchange Web Services
    • Microsoft LightSwitch HTML Client for VS2012
    • VSTO Runtime
    • VSTO Runtime Language Pack

Finally, after we have completed this step, we have completed the creation of the SharePoint 2013 Local development environment. In the future, we can use this virtual machine for the development of SharePoint apps.

If you need the functionality of Office Web apps, you'll also need to create a second virtual machine where Windows Server joins the Active Directory domain created by the first virtual machine, and then install and configure Office Web apps Server 2013. For a way to install Office Web Apps Server 2013 and connect it to a SharePoint farm, you can refer to this blog written by Turre. Although this blog is for the Office Web Apps version of Preview, the basic steps and the official version are the same.

Finally, this article is about the SharePoint app developer, not the SharePoint 2013 system administrator. That said, the above description of the steps to install SharePoint 2013 is only used to build the development environment, which does not mean that these steps are correct in the production environment.

Reprint Address: http://www.cnblogs.com/kaneboy/archive/2012/12/04/2800652.html

Go SharePoint App Development (2)-building a development environment

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.