Wednesday, August 10, 2016

Difference between sp.js and sp.runtime.js

The difference between sp.js and sp.runtime.js is


  • SP.js includes the SharePoint object modal references, such as web, lists, client context (which is used for representing the context of SharePoint Objects and operations), etc. It provides the types and members similar to the server object model namespace Microsoft.SharePoint to work with top-level sites, sub-sites and their lists and libraries.

  • SP.Runtime.js includes the details between client and server communication. It contains the runtime object of JavaScript and encapsulate all classes of client object model and the server interaction.


When you use JSOM, import the following libraries in the specified order.

  1. ASP.NET Ajax library
  2. sp.runtime.js
  3. sp.js 

Thursday, July 7, 2016

SharePoint 2016 step by step installation

Following are the steps to install and configure SharePoint 2016 single Server Farm


Prerequisite/Environment

  • Windows Server 2012 R2

  • SQL Server 2012 Enterprise
  • SharePoint 2016 Prerequisites are installed.



  1. Start SharePoint 2016 RTM installation.


Start SharePoint 2016 RTM installation.


  1. Once the installation is complete, run the configuration wizard
SharePoint 2016 Run Configuration Wizard
  1. Select ‘Create a new Server’
SharePoint 2016 Configuration Wizard - connect to a server farm


  1. Provide the Database server details and click next. In this instance of single server farm, provide the current server and DB details. Since installing SharePoint 2016 in standalone machine is not supported, we need to add the current server to domain in order to configure single server farm environment. Refer to my blog post on Configuring Active Directory Domain Services for SharePoint 2016 Environment


SharePoint 2016 Configuration Wizard - Database Settings


  1. Provide Passphrase
SharePoint 2016 Configuration Wizard - Security Settings


  1. Specify server role. Select the role for the server you’re installing in the server farm. If the instance is a single server farm, then select Single Server Farm.


SharePoint 2016 Configuration Wizard - Server Role Settings


  1. Specify the central administration port number and select the authentication provide for the web application. In this instance we are selecting NTLM authentication.
SharePoint 2016 Configuration Wizard - Central Administration Settings


  1. Select Next to complete the configuration.
SharePoint 2016 Configuration Wizard


SharePoint 2016 Configuration Wizard

SharePoint 2016 Central Administration Site

Configuration Active Directory Domain Services for SharePoint 2016 Single Server Environment

Environment: Windows Server 2012 R2, SharePoint 2016 RTM Prerequisite: Install ADLDS (https://technet.microsoft.com/en-in/library/jj574166.aspx)

Following are the steps to configure AD DS for a SharePoint 2016 Single Server Farm installation.
Start Server Manager > Select AD DS and click on more… to complete the required configuration for AD DS in the server


Configure AD DS
Click on the post deployment configuration action
Configure AD DS


Select “Add a new forest”, provide the domain name and click Next button
AD DS domain name
Provide the Directory Services Restore Mode password and click Next
Domain Controller Options
Ignore the warning message and click next


DNS Options


AD DS Domain Name
Specify the AD DS database and log location path.
AD DS Paths


Verify the details provide and click next
AD DS Review Settings


When the following error message (“Verification of prerequisites for Domain Controller promotion failed”) occurs during perquisites check, then reset the password for Administrator Account and run the prerequisite again


AD DS Prerequisites Check

AD DS Prerequisites Check
Click Install after successful prerequisite checks.


AD DS Prerequisites Check
AD DS Installation
Restart the server after successful installation.
AD DS Installation - Restart Server
Login with the credentials for new domain.
AD DS Installation - Verify Authentication


Add Users to new AD

Select Active Directory Users and Computers from Server Manager > Tools menu
AD DS - Add New Users
Add new user details
AD DS - Add New Users
Verify authentication after creating users. Now you can use this domain to configure SharePoint 2016 in a single server environment.

Thursday, June 23, 2016

SharePoint 2016 Products Configuration Wizard failed throwing ‘One or more types failed to load’

Environment: SharePoint 2016 Enterprise RTM, Windows Server 2012 R2
Scenario: Install SharePoint 2016 Enterprise RTM and configure
Issue: The SharePoint Products Configuration Wizard failed throwing ‘One or more types failed to load’
SharePoint Products Configuration Wizard failed
Troubleshooting:
  1. Looked into the configuration log file and noticed the following error message
Could not load file or assembly 'Microsoft.Data.OData, Version=5.6.0.0, Culture=neutral’
Could not load file or assembly 'Microsoft.Data.OData, Version=5.6.0.0, Culture=neutral’
  1. Download and Install the WCF Data Services Client for OData package and NuGet package Manager


  1. Use NuGet package manager to install the OData package


  1. Upgrade if you already have NuGet in your machine using following command


Nuget.exe update –self (This automatically get the update from web using your internet)
update NuGet
  1. The package can be installed from Visual Studio by navigating to Tools > NuGet Package Manager > Package Manager Console
NuGet Package Manager


  1. Make sure that you open a sample web project and execute the following command to install the package.
Install-package Microsoft.Data.OData
Install Package

  1. Run the configuration wizard again successfully

Tuesday, June 21, 2016

SharePoint 2016 Configuration Wizard failed with error ‘CacheHostInfo is null’.

Environment: SharePoint 2016 Enterprise RTM, Windows Server 2012 R2
Scenario: Install SharePoint RTM and run configuration wizard
Issue: The installation completed successfully however the SharePoint Products Configuration Wizard failed by throwing cacheHostInfo is null' error.
Configuration Wizard failed
Troubleshooting:
  1. Tried to repair distributed cache on the server by executing the following line of PowerShell script
Get-SPServiceInstance
$s = Get-SPServiceInstance <<Distributed Cache GUID>>
$s.delete()
Add-SPDistributedCacheServiceInstance
For some reasons, the script throws following error on line Add-SPDistributedCacheServiceInstance
Add-SPDistributedCacheServiceInstance : Could not load file or assembly 'Microsoft. ApplicationServer.Caching.Configuration, Version=1.0.0.0, culture=neutral, PublicKeyToken=31bf3856ad364e35'or one of its dependencies. The system cannot find the file specified.
Add Distributed Cache Service Instance
  1. Started AppFabric Caching Service and added the SPDistributedCacheServiceInstance successfully.

Add Distributed Cache Service Instance

  1. As running the configuration wizard again failed, downloaded and Installed Cumulative Update 7 (KB3092423) for Microsoft AppFabric 1.1 for Windows Server

  1. Restart the computer after applying this cumulative update package.

  1. After successfully installing the CU package. Execute the following PowerShell script to remove the caching service instance.
$SPFarm = Get-SPFarm
$cacheClusterName = "SPDistributedCacheCluster_" + $SPFarm.Id.ToString()
$cacheClusterManager = [Microsoft.SharePoint.DistributedCaching.Utilities.SPDistributedCacheClusterInfoManager]::Local
$cacheClusterInfo = $cacheClusterManager.GetSPDistributedCacheClusterInfo($cacheClusterName);
$instanceName ="SPDistributedCacheService Name=AppFabricCachingService"
$serviceInstance = Get-SPServiceInstance | ? {($_.Service.Tostring()) -eq $instanceName -and ($_.Server.Name) -eq $env:computername}
$serviceInstance.Delete()

Remove the caching service instance.

  1. Run the Configuration Wizard again and the configuration is successful.

Configuration successful

References: 

Wednesday, June 8, 2016

Error occurred in deployment step 'Recycle IIS Application Pool': Remote SharePoint site connections are not supported.Parameter name: project


Using SharePoint 2013, Visual Studio 2012

Scenario: Deploy a farm solution from Visual Studio


Issue: Error occurred in deployment step 'Recycle IIS Application Pool': Remote SharePoint site connections are not supported.Parameter name: project


Cause: The Site URL was invalid and the Visual studio failed to deploy the solution 


Project Properties

Fix: Go to Project properties and update the correct SharePoint site URL and try to deploy the solution again.

Wednesday, May 18, 2016

Public website with SharePoint Online

You can create and host a public website to use with SharePoint Online. This public web site can be accessed anonymously by users.
To create a public web site, select Sites from Office 365 app launcher icon and select Website under Recommended Sites section
SharePoint online Public Website
The web site will be opened in offline mode which will be available only by the office 365 users. To make it online for anonymous users, click MAKE WEBSITE ONLINE and click Make online button.
Make Public Website Online
You site will be made online after successfully making the site online.
Make Public Website Online

Note: For security reasons, you will not be able to enable anonymous access to other SharePoint online sites.