Behind the scene : Configure App Domain for on-premise SharePoint 2013 development environment

This post is article-2 from the 30 Articles App series for SharePoint.

In this post, I will discuss about how to create app domain for your on-premise server.

Those who have experienced NAPA on Office 365 Developer preview must have realized that they had the app domain created there from the URLs of the Apps.

OK so now as suppose if you own your own on-premise SharePoint farm and you would like to create and deploy Apps for your organization or you may be a developer creating an App for public Market; You will need to set up an App domain to make this happen!!

Pr-requisite to check for this task:

  1. You have installed SharePoint 2013 preview correctly
  2. Your PC/laptop or VM ( whichever is your on-premise server for you ) should have at least 12GB ram or 8GB +SSD will work as well. There is already enough discussion is going on about the memory requirement for development environment; these are my opinions, this is a beta and there might be more surprises to come so choose wisely.
  3. Verify that the ‘SharePoint Administration and ‘SharePoint Timer services are running.

Just want to tell you if you try to deploy your App through Visual studio without setting up your App domain then you should get below error..!! So do not worry we will get there 🙂

20120804-020557.jpg

if you run into some trouble in part-1 , you better check the available memory first!!

OK then let’s begin !!

Part : 1 – Creating an isolated App Domain

Run following commands on SharePoint management Power Shell:

  1. At this point you should have SharePoint timer services running and a managed farm account created already!
  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” ex. Set-SPAppDomain “AanuWizard App Domain”
  3. Check that SPSubscriptionSettingsService and AppManagementServiceInstance services are running by powershell or central Admin site.
  4. Now run following commands on powershell

$account = Get-SPManagedAccount "contoso\sp_farm" 

$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

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

20120804-020604.jpg

part:2 – Create a DNS domain name

You must create a new domain name in Domain Name Services (DNS) to host the apps. To help improve security, the new domain name should not be a sub domain of the domain that hosts the SharePoint sites.

When an app is provisioned, it needs a unique DNS domain name (for example, in my case :http://app-ef2c916a38e2fe.aanuwizardapps.com). You need a wildcard Canonical Name (CNAME) entry for your DNS domain to support these unique names.

1) Open DNS from Administrative Tools

2) Create ‘ New Zone’ by right clicking the “Forward Lookup Zones”

3) you need to create a wildcard alias record for the DNS domain name that allows for individual apps to create unique domain names within your app domain.

20120804-020632.jpg

Choose FQDN for your target host as your server domain -> same as parent; in my case it is “CONTOSO.COM”

20120804-020622.jpg

Once finished it should look like below.

20120804-020642.jpg

4) Change the URL settings as per your preference in Central Administration -> Apps -> Configure App URLs.

20120804-020612.jpg

Create a Developer Site (As you can only deploy your Apps to Developer site)

Now you are through to deploy the Apps on your development server!!

References for this article :

http://msdn.microsoft.com/en-us/library/office/apps/fp179923%28v=office.15%29

http://technet.microsoft.com/en-us/library/fp161236%28v=office.15%29.aspx

Why IIS AppPools show V4.0 for SharePoint 2013 running with .net framework V4.5

From the very first time when I was installing SharePoint 2013 Preview; I looked through the list of pre-requisites and knew that it must be using .net framework V4.5.

20120718-004016.jpg

My next check was the config file and it looked ok as well. To dig into this I had opened IIS and founded that the app pool is showing V4.0.

20120728-023912.jpg

There starts a point of confusion why IIS think that SharePoint is using V4.0 and not V4.5.

.NET versions are always been confusing. I had that feeling it was only in-place update for V4.5

The .NET Framework can version in two ways.

(1) Major Version – also called side by side installs

Two different major versions can live together on the same machine.

(2) Minor Version – also called “in-place upgrades”

Minor version means the CLR remains the same but new libraries , bug-fixes and/or some other improvements are added to main CLR.

Sadly .NET 4.5 is not a major version and so does not add different side-by-side CLR.

It will eventually use the same .net framework V4.0CLR and include some additional libraries and Bug fixes/some improvements as well. But it does not add new CLR. I believe new CLR should be the upcoming version.

Application build in which Framework Actually use which CLR Version IIS App Pool uses which CLR version
.net framework 2.0/3.0/3.5 CLR V2.0 V2.0
.net framework 4.0/4.5 CLR V4.0 V4.0

IIS  app pools know about CLR versions, not Framework and compiler versions, those are set by the application.

And that’s why even though SharePoint 2013 uses .net framework 4.5 the IIS detects the correct CLR version and creates App pool with CLRV4.0.

References for this Article :

http://blogs.msdn.com/b/dotnet/archive/2011/09/26/compatibility-of-net-framework-4-5.aspx

Attention : A bug in Outlook 2013 preview while syncing with SharePoint 2013 preview Calendar

I was looking at what are new and trying few things with Office and SharePoint preview.

Here is something I would like to draw an attention for MS guys working on Preview stuff.

OK so what I have done;  I had opened my SharePoint 2013 preview calendar in to Outlook 2013 preview calendar. Things are Ok like dates-subject etc. But the description of appointments are messed up on sync with  some Chinese characters as shown in the images below.

Creating a new appointment in outlook preview :

20120725-145249.jpg

After Sync How does it look in SharePoint 2013 preview:

20120725-145311.jpg

20120725-145304.jpg

In Outlook – after Sync :

20120725-145258.jpg

If you update an entry from Outlook or create a new one and then follow the Sync, you should be able to reproduce this bug.

Here is how to reproduce this bug:

  1. Update/Create calendar entry in Outlook 2013 preview
  2. Sync calendar with SharePoint
  3. Open item in SharePoint
  4. In SharePoint calendar : The description gets corrupted with some chinese characters
  5. Go to outlook check the item – it does look ok
  6. Sync again in outlook
  7. Open the item again and see it gets corrupted in outlook also.