Creating a development environment for Sharepoint 2013 part II

In part I of this post, I installed Sharepoint 2013 on Windows 2012 and configured everything to begin developing app and other artefacts for Sharepoint 2013. In this post I will continue the installation and configuration of the environment.

Installing Visual Studio 2012

Visual Studio 2012 RC Ultimate (and other versions) is available for download here Visual Studio 2012 and you’ll also need Office Developer Tools for Visual Studio 2012.

Choose the method that suits you best (download or install) and begin installing Visual Studio 2012:

image_thumb1

During my installation there was package that Setup wasn’t able to find : vs_premiumcoreres.msi. Luckily the setup gives you the possibility to go and download the missing packages.

image_thumb3

The first time I tried it couldn’t download it but the second time it was able to download the missing package.

Once installation is complete you’ll need to install Office Developer Tools for Visual Studio 2012.

Create and App domain

The following steps need to be performed as a Farm administrator

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 Preview installation needs a general wildcard host header domain where it can provision SharePoint-hosted apps.

This domain should be an URL namespace which will serve as namespace for your apps like apps.contoso.com

So when you deploy a Sharepoint 2013 app the address will look like http://TenantName-<GUID&gt;.apps.contoso.com where there is an arbitrary GUID assigned to each app instance.

In development you can freely modify your host file to route your request to the instance of Sharepoint where the app is hosted. VisualStudio 2012 actually modify your host file when you build and deploy the app.

In a production environment you will have to implement a DNS routing strategy and adapt firewall rules.

  • Start a The Sharepoint 2013 Management Shell  (run as administrator) and make sure the SPTimer service and the SPAdmin service are running:
  • net start spadminv4
  • net start sptimerv4
  • Created your isolated app domain by registering it on sharepoint
  • Set-SPAppDomain “apps.ofl.local”
  • In order for the server to be able to understand the address above you want to add an entry in the DNS for apps.ofl.local or manually add it to the host file of the server. I changed mine to : 127.0.0.1 apps.ofl.local 

    When starting Sharepoint 2013 Management Shell you get a fatal error then start a regular Power Shell window and manually add : “Add-PSSnapin Microsoft.Sharepoint.Powershell”. This should do the trick.

    If you get warnings like

    could not create a CmdletConfiguration for CmdletName Set-SPWebTemplate, CmldetClass  , CmdletHelpFile C:Program FilesCommon FilesMicrosoft SharedWeb Server Extensions15CONFIGPowerShellHelpMicrosoft.SharePoint.PowerShell.dll-help.xml.
    Cannot process argument because the value of argument “implementingType” is null. Change the value of argument “implementingType” to a non-null value

    Don’t worry it’s an issue that occurs because this cmdlets have been removed from the shell but not from the shell manifest yet. I’m certain this will be fix before RTM.

  • Once you’ve registered your app domain you need to Start and make sure that SPSubscriptionSettingsService and AppManagementServiceInstance  are running. This is achieved with this commandos:
  • Get-SPServiceInstance | where-object{$_.TypeName -eq “App Management Service” -or $_.TypeName -eq “Microsoft Sharepoint Foundation Subscription Settings Service”} | Start-SPServiceInstance
  • and to control they are existing and running:
  • Get-SPServiceInstance | where-object{$_.TypeName -eq “App Management Service” -or $_.TypeName -eq “Microsoft Sharepoint Foundation Subscription Settings Service”}  

    image

     

    If you’d let the wizard in part I take care of Sharepoint configuration for you then the App Management Service should be started but not the Sharepoint Foundation Subscription Service

    Once it’s done you need to specify an application pool, an account and a database name  for the services.

    $accountAppPool = Get-SPManagedAccount “oflsp_apppool”

    $appPoolSubSvc = New-SPServiceApplicationPool -Name SettingsServiceAppPool -Account $accountAppPool
    $appPoolAppSvc = New-SPServiceApplicationPool -Name AppServiceAppPool -Account $accountAppPool

    $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

    Then you should end with something like this in Central admin:

    image

    and

    image

    In the current release of Sharepoint 2013 I don’t believe there is a UI in central admin to create the Subscription Service Application

    Then you need to add the name of your tenant to Sharepoint. The tenant being the first part of the URL to your App domain. In my case I’ll like “apps” to be the tenant name.

     

    Set-SPAppSiteSubscriptionName –Name “apps” –Confirm:$false

     

    If you get an error stating that “there are no adresses available for this application” this is probably because you forgot to add your App domain URL!

     

    Now you’re good to go and start developing your first Sharepoint App. In my next post I will discuss the development of Sharepoint Apps. Stay tuned !

    Happy Sharepointing!!

    More Reading:

    Set up an on-premises development environment for apps for SharePoint

Advertisements

2 comments

  1. I am getting this error “there are no adresses available for this application”

    You said

    If you get an error stating that “there are no adresses available for this application” this is probably because you forgot to add your App domain URL!

    What is App Domain URL? Where I can define it?

    1. Hi,

      the App domain URL should be in your host file.
      In order for the server to be able to understand the address above you want to add an entry in the DNS for apps.ofl.local or manually add it to the host file of the server.
      Mine is : 127.0.0.1 apps.ofl.local

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: