Raghu's SharePoint Corner

My blog has moved!

You will be automatically redirected to the new address. If that does not occur, visit
http://www.sharepointcolumn.com
and update your bookmarks.

November 15, 2012

Error: Installation of Microsoft Identity Extensions Requires .Net Version 3.5 or 4.0

Scenario: Offline/Online (With/without internet connection on server) SharePoint 2013 Foundation Farm setup on Windows Server 2012. Please note this error was shown after enabling .Net Framework Version 3.5 or 4.0 on the server. All the prerequisites were manually installed on the server.

Note: From Software & Hardware requirements for SharePoint 2013 given Prerequisites for SharePoint 2013 I can see that the identity extensions are available only for Windows Server 2008 R2 and not for windows server 2012. 

The below error might pop up when you perform the installation of SharePoint 2013 Foundation Farm setup on Windows Server 2012.
Once you click Ok, the SharePoint 2013 the prerequisite shows up the below error screen 

At first instance after seeing this error you might conclude that we need to install .Net Framework 3.5 or 4.0 on the server to continue with the setup. You might be aware that .Net Framework 4.0 will be installed on the Windows Server 2012 during the setup of windows server 2012. If you want to install .net framework 3.5 on the server you need to enable this feature using Server Manager, from Add roles and Features, you can also install from command line you can refer here (http://www.danielclasson.com/install-net-framework-35-server-2012/).

The following error was logged in the review log files of the prerequisite setup
2012-11-14 21:17:12 - Request for install time of Application Server Role, Web Server (IIS) Role
2012-11-14 21:17:13 - Request for install time of Application Server Role, Web Server (IIS) Role
2012-11-14 21:17:14 - Request for install time of Application Server Role, Web Server (IIS) Role
2012-11-14 21:17:14 - Install process returned (0)
2012-11-14 21:17:14 - [In HRESULT format] (0)
2012-11-14 21:17:14 - Beginning download of Microsoft Identity Extensions
2012-11-14 21:17:14 - http://go.microsoft.com/fwlink/?LinkID=252368
2012-11-14 21:17:14 - Size of download of "Microsoft Identity Extensions" in bytes is "2663"
2012-11-14 21:17:14 - Download of "Microsoft Identity Extensions" completed successfully
2012-11-14 21:17:14 - Installing Microsoft Identity Extensions
2012-11-14 21:17:14 - "C:\Windows\system32\msiexec.exe" /i "C:\Users\SPA37F~1.ADM\AppData\Local\Temp\IDF6B7.tmp.msi" /quiet /norestart
2012-11-14 21:17:14 - Install process returned (0X654=1620)
2012-11-14 21:17:14 - [In HRESULT format] (0X80070654=-2147023276)
2012-11-14 21:17:14 - Last return code (0X654=1620)
2012-11-14 21:17:14 - Reading the following DWORD value/name...
2012-11-14 21:17:14 - Flags
2012-11-14 21:17:14 - from the following registry location...
2012-11-14 21:17:14 - SOFTWARE\Microsoft\Updates\UpdateExeVolatile
2012-11-14 21:17:14 - Reading the following string value/name...
2012-11-14 21:17:14 - PendingFileRenameOperations
2012-11-14 21:17:14 - from the following registry location...
2012-11-14 21:17:14 - SYSTEM\CurrentControlSet\Control\Session Manager
2012-11-14 21:17:14 - Reading the following registry location...
2012-11-14 21:17:14 - SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\RebootRequired
2012-11-14 21:17:14 - Error: The tool was unable to install Microsoft Identity Extensions.
2012-11-14 21:17:14 - Last return code (0X654=1620)
2012-11-14 21:17:14 - Options for further diagnostics: 1. Look up the return code value 2. Download the prerequisite manually and verify size downloaded by the prerequisite installer. 3. Install the prerequisite manually from the given location without any command line options.
2012-11-14 21:17:14 - Cannot retry

Solution:  After reviewing the log files I figured out the following things

1.       The msiexec.exe file specified here 2012-11-14 21:17:14 - "C:\Windows\system32\msiexec.exe" is missing on the windows server system 32 folder, not sure how this happened. To fix this error run the following command on the windows run window msiexec /regserver

2.       Installing Microsoft Identity Extensions from command prompt.In order to perform this use the below command
C:\Windows\System32>msiexec.exe /i "C:\SharePoint2013ServerFiles\prerequisiteins
tallerfiles\MicrosoftIdentityExtensions-64.msi" /quiet /norestart
Note: In the above command C:\SharePoint2013ServerFiles\prerequisiteinstallerfiles is the path where I had downloaded all the prerequisites for SP2013
This will install Microsoft Identity Extensions and creates registry entries , which will help the SharePoint 2013 Prerequisite installer to complete the setup
If anyone has found a better way to do this please feel free to a leave a comment.

August 23, 2012

Offline installation of Microsoft Office Developer Tools for Visual Studio 2012 RTM


Hang on if you don’t have the Installer yet you can find it here (http://msdn.microsoft.com/en-us/office/apps/fp123627.aspx) and download the appropriate one.

If you are planning to start SharePoint 2013 development using Visual Studio 2010 then you might have to wait till Microsoft Releases the Extension

This blog post would help developers who are yet to start SharePoint 2013 Development. The objective would be to provide steps to perform the offline (no internet connectivity) installation of Microsoft Office Developer Tools for Visual Studio 2012 RTM.
If you try to run the Microsoft Office Developer Tool (or web platform installer which you can find it here) in the above scenario, probably you will end up in seeing the below screen.



After going through the log files here are the necessary link to download individual component

Microsoft SharePoint Developer Tools for Visual Studio 2012 - Preview:
http://download.microsoft.com/download/F/3/6/F36774B2-4090-4352-8D73-55A54F6C4E18/ENU/officetools_bundle.exe


Windows Identity Extensions:
http://download.microsoft.com/download/0/1/D/01D06854-CA0C-46F1-ADBA-EBF86010DCC6/r2/MicrosoftIdentityExtensions-64.msi


Workflow Tools 1.0 Beta for Visual Studio 2012:
http://download.microsoft.com/download/9/6/2/9622508B-EE2D-452F-945A-343AA514C140/WorkflowTools_x64.msi


Workflow Client 1.0 Beta:
http://download.microsoft.com/download/9/6/2/9622508B-EE2D-452F-945A-343AA514C140/WorkflowClient_x64.msi


Windows Identity Foundation SDK:
http://download.microsoft.com/download/7/0/1/70118832-3749-4C75-B860-456FC0712870/WindowsIdentityFoundation-SDK-4.0.msi


SharePoint Client Components:
http://download.microsoft.com/download/D/E/0/DE02CCED-5209-49FC-9F1B-0F86D3269D4C/sharepointclientcomponents_x86.msi


Start installing all of them one by one and you should be able to kick start your SharePoint 2013 development using Visual Studio 2012 and Microsoft Office Developer Tools for SharePoint 2013

Note: This post is respect to SharePoint Server 2013 Preview Release

July 26, 2012

SharePoint Server 2013 Preview – Development Environment Installation and Performance Experience

As everyone knows Microsoft released SP2013 Preview (Beta) last week and most of the SharePoint developers are curious to install it and few might have already started exploring. I am sure there is enough blog post around to guide you through the installation. The main intention of the blog post would be to elaborate more on the system configuration and performance from developer perspective

As we know the minimum hardware configuration is pretty high for setting up development environment, developers are worried if they can install and work with a lower configuration. I would say it’s possible but you need to be patient enough to see the “Working on It” screen for some time.

To start with I have the following hardware and software configuration

Hardware

Type
Laptop
Hard disk
500 GB
RAM
4GB DDR 3
Process
Core i7 , 1.6 Ghz

You might be assuming this is a pretty good hardware configuration, but that’s not the case with SharePoint 2013. It eats up almost 3.8 GB of Ram when you start using it and this where you start seeing “Working on it” screen for longer duration when you start creating a site collection. It took almost 5-8 minutes to create my first site collection on the default port.

If you are planning for better usage please don’t run the SharePoint Farm Configuration Wizard for all the services, as this would end up in seeing “Working on it” for almost 20 – 30 minutes.

Here is the snapshot of Physical Memory usage and Process performance




Developers who are facing issues in installing SP2013, it would save your time if you read through the Software Requirement thoroughly before you start installation. Following are the steps which I followed during my first hazel free installation of SharePoint 2013.

  • Install Windows Server 2008 R2 Standard/Enterprise, Add Roles for Active Directory Domain Services, DNS, and IIS etc.
  • Install Windows Server 2008 R2 Service Pack 1
  • Install service Pack for IIS
  • Configure Domain controller, and provide a domain name, so that you can create multiple active directory users.
  • Install Dot Net Framework 4.5 RC
  • Install SQL Server 2008 R2
  • Install SQL Server 2008 R2 Service Pack 1 for SQL Server 2008 R2 ,SQL Management Studio (Optional)
  • Run the SP Server 2013 Preview setups, and Install the prerequisites, Make sure all the prerequisites are installed successfully.
  • Runt the SP2013 Server Preview setup
  • Finally run the SharePoint configuration wizard.



I have decided to work with  the system for next 1 week, if the performance further degrades then will go ahead for upgrading my RAM from 4GB to 8GB (max configuration my laptop can support L)

Note: The above system performance will be different for different hardware configuration

July 16, 2012

SharePoint 2013 public beta has been released


The wait for SharePoint 2013 beta is over.

Microsoft released the public beta for SharePoint 2013. Download here: or
http://www.microsoft.com/en-us/download/details.aspx?id=30345

Here's a bunch of other SharePoint 2013 content 
http://www.microsoft.com/en-us/download/search.aspx?q=SharePoint%202013&p=1&r=40&t=32

Critical Path Training is providing training on SharePoint 2013, you can get more details here
http://www.criticalpathtraining.com/Pages/SharePoint+2013+Training.aspx

Lets start exploring 2013 and its new feature!!

May 21, 2012

CAML Designer the Next Generation CAML Query Builder for SharePoint 2010

CAML Query builder is the favorite tool of SharePoint Developers. The much awaited CAML Query Builder for SharePoint 2010 is released and its termed as CAML Designer. Karine Bosch’s co-developed this tool with Andy Van.
The newer version of tool is developed using WPF and support only SharePoint 2010. For more details of the tool you can visit here.
Snap Shot

May 8, 2012

SharePoint2010 MAC FBA Authentication Issue

Recently we ran into an issue where Custom Forms Based Authentication was failing on MAC machine. The FBA was configured properly without any issues and is working like charm with Windows OS. Did few searches on Google and found that few of them have faced the issues but in a different scenario and following were the work around or fixes were suggested.

  •       Most of them have either wrongly configured Form Based Authentication and on proper configuration   it started to work.
  •      For few the Claims to Windows Token had stopped, and on restart of the services FBA started working.
  •      Few also suggested the performing an IISRESET on the server solved their issues.
  •     In some case the APP Pool Credentials for Security token services was wrong.


All the above 4 fixes where not valid in my scenario since FBA was working perfectly fine with windows OS.

In order to get to the root cause I had to go through the traditional approach of visiting event viewer and SharePoint logs. On analyzing the event viewer log it was found that the Secure Token Service was not getting generated for the users who were trying to log into the SharePoint 2010 site using FBA from Safari browser on MAC machine.

In order to get more exception details in the event viewer, add the following <serviceDebug includeExceptionDetailInFaults="True" httpHelpPageEnabled="True"/>   tag in web.config of Security Token Webservices which resides at the following location “C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\WebServices\SecurityToken”

On restarting the services details of the exception was logged as follows.

Event: 8306, SharePoint Foundation
Task Category: Claims Authentication
Exception Details: An exception occurred when trying to issue security token: Object reference not set to an instance of an object.

On seeing this exception we re-visited the Custom Forms Login page which we had created for FBA.  On debug we noticed that the below link threw the above exception
SPClaimsUtility.AuthenticateFormsUser(Context.Request.UrlReferrer,txtusername.Text, txtpassword.Text);

It was certain that the issues was with Context.Request.UrlReferrer passed to the SPClaimsUtility.AuthenticateFormsUser method. In order to get this working we modified the way we were passing URL parameter to the below approach.

string siteUrl = SPContext.Current.Site.Url;
string extraneturl = siteUrl.ToString();
Uri extrametUri = new Uri(extraneturl);
bool status = SPClaimsUtility.AuthenticateFormsUser(extrametUri, txtusername.Text, txtpassword.Text); and FBA started working on MAC.

Hope this post would help anyone facing similar issue. Please feel free to drop any comment or any other alternate approach.

October 26, 2011

Create List item in Folders using Client Object Model

There are scenarios where you would like to add list item to a folder/sub folder in a custom SharePoint list and many of you would like to achieve this using ECMA script/ JavaScript Client Object Model. Before we start with the code, i am assuming that you have enables Folder Content Types in a custom list and have also created a Folder in a list before the below snippet is executed.


function CreateListItemInFolder()
{

// Create client context
 var myContext = new SP.ClientContext.get_current();
 // Get current web (comparable to SPWeb)
 var myWeb = myContext.get_web();
 // Get list by title (comparable to SPList)
   var myList = myWeb.get_lists().getByTitle('Docs');
   // Create new object for list item creation

 //Create List Item Infor and set the Folder Path for the item to be created.      
      var myListItemCreationInfo = new SP.ListItemCreationInformation();
      myListItemCreationInfo.set_folderUrl("http://servername/sites/PP/Blog/Lists/Docs/Folder1");
 var newLinkItem= myList.addItem(myListItemCreationInfo);

     // Set properties for new list item
 newLinkItem.set_item('Title', "Title");
 // Update the new item
 newLinkItem.update();

myContext.executeQueryAsync(Function.createDelegate(this, onSuccessAddQL),Function.createDelegate(this, onFailureAddQL));

}
function onSuccessAddQL(sender, args)
{
alert("Item Added Successfully In the Folder");
SP.UI.ModalDialog.commonModalDialogClose(SP.UI.DialogResult.cancel,'Closing Quick Links Dialog');
}
function onFailureAddQL(sender, args)
{
alert("Item Adding Failed to the Folder");
}

happy coding..

October 3, 2011

Creating Root Site Collection Using Custom Blog Site Template in Office 365

There are scenarios were you would like to use Blog Template (any default site ) or custom site template as the default site template for the Root Site Collection instead of the regular Team Site In Office 365. By default when you subscribe a new Office 365 Subscription you will have team site as default root site collection.

The steps below will guide you to create the root site collection with a custom blog site template. I have created a site using Blog template and created custom list in the site. After you have the necessity structure for the Blog site in place, save the Site as Site Template and download the Blog Template from the Solution gallery to your local PC.

1. Delete the default root site collection of your subscription, by navigating to the admin portal of Office 365. Your Admin portal looks like the screenshot given below.


2. Now click on the new tab and select New-> Private Site Collection, You will get a new New Site Collection PopUp Screen, specify the title of the site, In the Template Selection, click on the Custom tab and select “Select Template Later”, specify the administrator account and Click OK. The screen should look like below

3. Wait for the site to be created, Once the site is created, Navigate to the site, you will see a Template Selection page were you can select the default template as blog for your root site


4. To use custom blog site template, Click on the Solution Gallery, it will take you to the Solution Gallery, upload the custom Blog Site template WSP and activate. After activating the WSP navigate back to the Template Selection Page and you will be able to see a Custom Tab as shown below, select the BlogSite Template and click Ok

                                    

5. Once the site is created it will navigate you the Set Up Groups for the site Page as shown below and click Ok.

In this way you can use any custom site template or change the default site template for your Office 365 SharePoint Online.


August 10, 2011

Collapsible Quicklaunch Menu for SharePoint2010 Using Jquery


Recently I have been getting comments on my post Collapsible QuickLaunch SharePoint Menu For MOSS 2007/WSS 3.0 Using Jquery saying this is not working on SharePoint 2010 or is there any solution to get it working in SharePoint 2010. So here is the post that would describe how to achieve this in SharePoint 2010.

The way quick launch is rendered in SharePoint 2010 is different from MOSS 2007/WSS. SharePoint 2010 uses DIV/UL/LI for rendering menu tags compared to TR/TD in the previous versions. The image below shows how the menu is typically rendered in SharePoint 2010.


After doing some research I came to an approach of using Jquery to achieve this. Here is the article which is the base of this approach, so that you can use it to customize further if required. After implementing this how the collapsible quick launch looked.


But there was an issue with post back operation on click of each item on the navigation menu which resulted in losing the menu click item as expanded. To fix this issue I used cookies to maintain the expanded state of a menu item after post back which was posted as comment by Krillehbg on my previous post. The below snapshot show how it looks when you click Lists menu item.


Currently I will be posting the script which you can place it in master page later at some point of time I will make this as feature or someone could work on this to make it as feature.

  1. Open the site in SharePoint Designer in which you want to make the QuickLaunch Collapsible.
  2. Open the Master Page which resides in the catalog folder.
  3. Copy and paste the given snippet above the end of head tag in the master page 

        <script type="text/javascript">
        $(document).ready(function () {


    $("body").addClass("enhanced");
    $(".root li:first").addClass("selected");
    $(".root li").not(":first").find("ul").hide();


    $(".root li.static").click(function () {        
        var menuClicked = createCookie("Menu_Clicked", $('a > span > span ', this).html(), 1);
        if ($(this).parent().find("ul").is(":hidden")) {
            $(".root ul:visible").slideUp("fast");
            $(".root li").removeClass("selected");
            $(this).parent().addClass("selected");
            $(this).find("ul").slideDown("fast");


        }
    });


    var menuClickedOld = readCookie("Menu_Clicked");
        $(".root li.static").each(function () {
        if ($('a > span > span ', this).html() == menuClickedOld) {
            if ($(this).parent().find("ul").is(":hidden")) {
                $(".root ul:visible").slideUp("fast");
                $(".root li").removeClass("selected");
                $(this).parent().addClass("selected");
                $(this).find("ul").slideDown("fast");


            }
            return;
        }
    });
});


function createCookie(name, value, days) { if (days) { var date = new Date(); date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000)); var expires = "; expires=" + date.toGMTString(); } else var expires = ""; document.cookie = name + "=" + value + expires + "; path=/"; } function readCookie(name) { var nameEQ = name + "="; var ca = document.cookie.split(';'); for (var i = 0; i < ca.length; i++) { var c = ca[i]; while (c.charAt(0) == ' ') c = c.substring(1, c.length); if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length); } return null; } function eraseCookie(name) { createCookie(name, "", -1); } function createCookie(name, value, days) {
    if (days) {
        var date = new Date();
        date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
        var expires = "; expires=" + date.toGMTString();
    }
    else var expires = "";
    document.cookie = name + "=" + value + expires + "; path=/";
}




function readCookie(name) {
    var nameEQ = name + "=";
    var ca = document.cookie.split(';');
    for (var i = 0; i < ca.length; i++) {
        var c = ca[i];
        while (c.charAt(0) == ' ') c = c.substring(1, c.length);
        if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length);
    }
    return null;
}


function eraseCookie(name) {
    createCookie(name, "", -1);
}
        </script>


Happy Reading :). Please feel free to leave comments

August 5, 2011

JQUERY RSSReader WebPart for Office365


It’s been long time I have posted any technical posts. This post would describe an alternate for RSS Reader Web part in Office 365. Last week I started to work on one of our client’s requirement to show RSS feed in Office 365. For surprise I came across few posts which indicated RSS Viewer Web Part is not supported.

To start my research first I tried with RSS Reader Web part present in CodePlex written by phil wicklund. If you try to deploy this solution on cloud it would through error because of few limitations that I had posted here in my previous post.

So I started to Google to check how to display RSS feeds in ASP.net which doesn’t use any web part concept. I ended up with This post. With the help of the above two posts I started creating JQUERY RSS Reader web part for office 365.

After completing the development of the base web part, I thought it would be great if can render the rss feeds as ticker instead of static. So I ended up in creating the following display mode 1. Basic and  2.Ticker which can be configured to render feeds accordingly. Here are some snapshots of the configuration and how the web part looks.



Please find below the source code and the WSP for this web part now. Please feel free to modify this webpart according to your needs and let me know if you have any better solution.

Summary of OFFICE 365 Limitations and Workarounds


This blog post will brief you about that various limitations I faced during Office 365 Sandbox development. Sandbox limitations differ when it comes to cloud deployment compared to on premise deployment.You will find various blogs with Sandbox Limitations. 

This post would help you understand these limitations in a quick way, so that you can plan before you start your deployment. If you are a SharePoint Expert this blog would not help you much, but there are lots of Office 365 BeginnersJ.    
    1. The WSP package cannot deploy files to hive .i.e. file system. The possible option to uses document library to deploy your files
    2. We can use Sandboxed Visual WebParts with some limitations while you are developing for Office 365. You need to install the Visual Studio 2010 SharePoint Power Tools and use Visual WebPart (Sandboxed) Item Template.
      3. Performing asynchronous post back cannot be achieved, we may try using JQUERY, I need to explore more on this and will update my post accordingly.
    4. You cannot use Assembly.GetExecutingAssembly on cloud but this will work when you are developing sandbox for on premise application.
    5. You cannot use Page.RegisterClient script for registering JavaScript on the page; you can use html render tag to insert script tag in the page. This holds good for adding css. Few say to use embedded resources but not sure if it’s really going to work out on cloud.
    7. You cannot use Run with Elevated privileges in sand box solution.
    8. Using resources in sandbox solution is Tricky, which is not feasible while developing solutions for OFFICE 365 or cloud.

Will be updating this blog as and when I find more limitations. Please feel free to comment on the above points or if you have a better workarounds.

Note: Post Updated On August 8 2011

August 28, 2010

QueryString Value using JavaScript in SharePoint

This post talks about how to use JavaScript to retrieve query string value from the URL and display it in an asp.net web control in an OOB SharePoint page. This might be a very common scenario in an ASP.Net environment, but when it comes to SharePoint the implementation is different and it may also take couple of hours to achieve this if you don’t have a complete idea about how SharePoint page works.

There are some limitations or rather you can say security related to SharePoint pages when it comes to JavaScript which access server side control. You cannot write directly access server side controls using JavaScript you need to make certain tweaks for this to work.

1.Make web.config changes so that you can access controls using JavaScript without getting “Page Parser Error message code blocks are not allowed”.

If you have scenario where you want to allow JavaScript in a particular page then you have to make the below entries in your pages

For ASPx Pages
<PageParserPaths> 

  <PageParserPath VirtualPath="/pages/[file name].aspx" CompilationMode="Always" AllowServerSideScript="true" /> 

</PageParserPaths>

For master page, this will enable inline code blocks for all master pages:

<PageParserPaths> 

  <PageParserPath VirtualPath="/_catalogs/masterpage/*" CompilationMode="Always" AllowServerSideScript="true" /> 

</PageParserPaths>

Making these changes will allow users who have access to Content DB to embed JavaScript in your site using SharePoint Designer.

2.The other option is to user HTML controls in your page. But even in this scenario SharePoint will adds an Auto Generated ID suffix and the control id changes like the one give below.

label id="lblName{generate-id}

So you may have to remove the auto generated suffix and keep only the label id.
So here goes the JavaScript which you can embed in a SharePoint page at the bottom and set the value of the control based on the query string

<script type="text/javascript">

var query = location.search.substring(1); 

if(query!=null)

{

 var query = location.search.substring(1).split('&');

 if(query .length>0)

 {

      var keys = query[0];

      var key = keys.split('=');

      var control=  document.getElementById('lblName');

      if(control!=null && key.length>0)

      {

        Control.innerText = key[1] ;

      }

 }

}

</script>