Archive

Archive for the ‘Uncategorized’ Category

Web Services Architecture

December 18, 2009 rehmangul Leave a comment

Just for me!!!

A quick primer on web services, lest I forget :) :

What is a web service and why is it there?
Two different pieces of hardware running two different pieces of software on two different operating platforms (systems), now they want to communicate accross a network, what will you do, you will write a web service.

What could be the best example of such scenario, ofcourse it is the internet. Millions of completely different systems connected with eachother and wishing to communicate. Do not confuse Communication of these systems with things like emails, online chats etc. It is an actual system to system or software to software or service to service level direct communication.

A bit of history:
It was also possible to achieve this before the advent of Web Services. This was done using Remote Procedure Calls (RPC) for communication between DCOM and CORBA objects. However, this had security and compatibility issues, most of such communication was blocked by proxy servers and firewalls. Web Services came in and used HTTP for communication which is already compatible accross different browsers and systems.

High Level Architecture (kind of :) ):
So, a web service will be communicated by an outside system. In such a scenario, the web service has to outline a couple of things for everyone to know, one: What it does, two: How it does it.

So, “what it does” is specified in some document (or agreement) e.g. I am a calculator and I calculate additions, multiplications, subtractions and divisions.

And, “how it does” is actually the architecture of the web service. First of all, what ever is to be specified in this section, it has to be machine readable and processable. If so, this can be done only by a proper programming language. So, the language we use here is called Web Service Definition Language (WSDL). This language defines the architecture of the web service i.e. it defines message formats to be used, what datatypes will be used, what will be the transport protocol for communication etc etc.

Since web service is going to be accessed through the web, it has to expose itself through a network location. That will be the point of contact for the web service. Web service will also use that network location to give some description about itself e.g. message exchange patterns etc etc.

We are talking about message passing among web services, which is a primary way of web service communication. How is that achieved. For that we have got a complete framework know as Simple Object Access Protocol (SOAP). It is web protocol or a standard framework for passing and exchanging messages between web services. It has a complete specification for message formats, Message Exchange Patterns (MEP), underlying transport protocol bindings, message processing models and protocol extensibility. SOAP messages use XML formatted messages which can be carried by HTTP, SMTP, FTP etc etc.

A bit Technical:
A SOAP message is acutally a method invocation of a remote object, and the serialization of the argument list of that method that must be moved from the local environment to the remote environment.

WSDL describes Web Services starting with the messages that are exchanged between the requester and the provider. The messages themselves are described abstractly and then bound to a concrete network protocol and message format.

Web Service definitions can be mapped to any implementation language, platform, object model, or messaging system. As long as both the sender and receiver agree on the service description e.g. WSDL file, the implementation behind the Web Service could be anything.

Summary:
So, I talked about four necessities for a web service to run:

  1. It shoud decide about Service Provisioning (What is it going to do e.g. im a calculator)
  2. It should provide a Machine Readable/Processable definition of itself  to the world (thats done using WSDL)
  3. Then it should expose itself through a network location so that it can be accessed by other systems in the network (usually internet)
  4. Then there should be a standard way of commnication with the web service (that is done using SOAP messaging)

Hope this helps me–:)

Master Pages in SharePoint 2007

December 15, 2009 rehmangul Leave a comment


Basic Intro:
Master pages could be classified in three groups as per their usage:

  • Application Master
  • System Master
  • Site Master

There are three kinds of Pages in sharepoint (explains why there are three kinds of master pages):

  • Publishing Pages (like the pages saved in Pages document library e.g pages/default.aspx)
  • Forms and Views pages (like document library views e.g. Forms/allitems.aspx or Forms/MyCustomView.aspx)
  • Application Pages (like all pages that come under _layouts/…. e.g. _layouts/settings.aspx)

 Application master is a type of master page that appears on any page that resides in Layouts folder under 12 hive (or _layouts/…. appears in the URL) for a Sharepoint Site e.g. Site Settings pages (_layouts/settings.aspx).

Site master is a type of master page that appears on publishing pages throughout sharepoint sites, such as those pages stored in the Pages document library.

System Master is a type of master page that specifically relates to Forms and Views pages within sharepoint sites, such as Forms/Allitems.aspx or Forms/MyCustomView.aspx.

We know that we can set a master page as a ‘System Master Page’ from Site Actions -> Site Settings -> Modify All Site Settings -> Master Page:






The page set here as ‘System Master Page’ is essentially (or by default) for Forms and Views pages. Change this master page here and you will see that only the pages under “…Forms/…” will display the new master page. The site home page and all settings pages will still have the same old master page. 








We also know that we can set a master page as a ‘Site Master page’ from Site Actions -> Site Settings -> Modify All Site Settings -> Master Page:







The page set here as ‘Site Master Page’ is essentially (or by default) for Publishing Pages.Change this master page here and you will see that only the pages saved in the Pages library e.g.  Pages/default.aspx will display the new master page. The Forms and Views pages and all settings pages will still have the same old master page.





 

Default and Custom Master Page:
Now we have also heard about ‘Default Master Page’ and ‘Custom Master Page’. What are these. Just to clarify the confusion: ‘custom master page’ and ‘default master page’ are just terms used as a setting for a master page. These terms usually come into play while working with SharePoint Designer. These are not master pages themselves, these are just to set a master page as custom or default. Ofcourse there is a reason to that and I will explain that shortly.

So, why do we set master pages as custom or default? What happens when we do this? whats the gain? This brings us to the discussion of tokens.



Why Tokens?:
In an asp.net page we can specify a master page like this <%@ Page Language=”C#”

MasterPageFile="~/MasterPages/Master1.master".........

Now, if you want to change the master page, we have to modify the page code and specify a new master page. This is not expected in SharePoint. SharePoint is a content management system targeted towards end users, hence it is supposed to provide maximum functionailty out of the box without doing much customizations, let alone changes to the code. So, changing master pages is one of the common requirements by end users, and ofcourse they need it done without changing the code for the page. For end users, they should just select a different master page from a list and it should render for their site.

So, to achieve such an architecture Sharepoint uses tokens. In sharepoint, master pages are specified in Content Pages (in Non Pulishing Sites) and Page Layouts (in Publishing Sites). These pages use tokens to specify a master page in SharePoint. These tokens will be replaced by the actual master page reference.


Types of Tokens:
Now tokens are of two types:

  • Static
  • Dynamic

It is important to understand the difference first :) (before we dive deep in details). The static tokens will point to a “location” where the content page could be found.

Dynamic tokens will not specify a location, rather they will point to a place from where you will get the location of the master page at run time (a little indirect and dynamic). I will talk about that place below.


*******************************************
Static Tokens:
Static tokens are of two types:

Static Token for Site Collection-Relative Master Page:
~sitecollection/_catalogs/masterpage/MyMasterPage.master

Static Token for Site-Relative Master Page:
~site/_catalogs/masterpage/MyMasterPage.master

Example:
For instance, if our content page is located at
http://MySitecol/MySubSite1/MySubsite2/default.aspx

and we use the token

"~sitecollection/MyMasterPage.master"

our content page would use the master page at
http://MySiteCol/MyMasterPage.master

If you use the token

"~site/MyMasterPage.master"

the content page would use the master page located at http://MySiteCol/MySubSite1/MySubSite2/MyMasterPage.master

These two are valid static tokens:
~sitecollection/_catalogs/masterpage/MyMasterPage.master
~site/_catalogs/masterpage/MyMasterPage.master

************************************


************************************
Dynamic Tokens:
Dynamic Tokens are of two types as well:

Dynamic Token “~masterurl/defualt.master”:
This token is set as the value of MasterPageFile attribute e.g.

<%@ Page MasterPageFile="~masterurl\default.master"%>

which is telling that MasterPageFile is a dyanmic token, so look for the master page reference at a predefined place (its the same place we talked about above), so what is that place, it is a property named as MasterUrl. So, the token “~masterurl\default.master” will be replaced by whatever is in the MasterUrl property. Now, what has this property got in it. It has the server relative full path to the master page including the file name.

Something very important to note here is that “~masterurl/default.master” is a complete token string, default.master is part of the token and not the master page name. You can set MasterUrl property both by SharePoint Designer and Sharepoint Object Model.

page.MasterPageFile = "~masterurl/default.master";
SPContext.Current.Web.MasterUrl = "/_catalogs/masterpage/MyMasterPage.master";
 

Dynamic token “~masterurl/custom.master”:
Same mechanism applies to “~masterurl/custom.master” as well. The only difference is that it refers the property called as CustomMasterUrl. The token “~masterurl/custom.master” is replaced at run time by the value in the CustomMasterUrl property, which contains the server-relative full path to the master page, including file name. You can set CustomMasterUrl property both by SharePoint Designer and Sharepoint Object Model.

page.MasterPageFile = "~masterurl/custom.master";
SPContext.Current.Web.CustomMasterUrl= "/_catalogs/masterpage/MyCustomMaster.master";

**********************************


Usage of two Dynamic Tokens in Non Publishing sites:
By default, all SharePoint Content pages use “~masterurl/default.master” dynamic token. And the Master Url property is set to default.master master page. A Content page could be a Team Site home page e.g. default.aspx. Master pages in Content pages are set in the Content pages themselves. So, if you open a default.aspx page of a Team Site in SharePoint Designer, you will find something like this:

Page language="C#" MasterPageFile="~masterurl/default.master"

Now, if you open …/Forms/…. pages of a Team site e.g. …/Forms/AllItems.aspx page in SharePoint Designer (_catalogs/masterpage/Forms/AllItem.aspx), you will see the following:

Page language="C#" MasterPageFile="~masterurl/default.master"

So, they have only one master page i.e. default.master, publishing is not there at all, they do not have custom master pages like publishing site has e.g. BlueBand.master, BlackBand.master etc. So, if there is only one master page, one token should be enough to refer it, thats why only “~masterurl/default.master” is used in both kinds of pages i.e. Content pages and Forms/Views pages.

In a team site you cannot change master page from the UI (assuming that it is not created under any publishing site). you can only do it from designer, that also if you have added some other new master page in the site collection in master page gallery (yeah, a team site has a Master Page gallery), otherwise team site has only one master page by default and that is used for all kinds of pages i.e. content pages, Forms and Views pages and Application pages.


Usage of two Dynamic Tokens in Publishing sites:
“~masterurl/custom.master” is not used by any SharePoint Content page by default. Then why is it there at all? This token is used in all Publishing pages in SharePoint and is provided as a way to have a second shared master page. A Publishing page could be a Publishing site home page e.g. default.aspx page. Master pages are specified in Page Layouts in Publishing pages. So, if you open DefaultLayout.aspx of a Publishing site in SharePoint Designer (default layout page for all Publishing pages), you will see something like this:

Page language="C#" MasterPageFile="~masterurl/custom.master"

Now, if you open …/Forms/…. pages of a Publishing site e.g. …/Forms/AllItems.aspx page in SharePoint Designer (_catalogs/masterpage/Forms/AllItem.aspx), you will see the following:

Page language="C#" MasterPageFile="~masterurl/default.master"

Now, you can clearly see that in Publishing scenario, we are using two different tokens to fulfill the need for two different types of master pages applied to the site at one time. One token would not have fulfilled this requirement as we need different look for a Publishing page and a different look for Forms/Views page.


How to set Dynamic Tokens from SharePoint Designer?
Now there is an option in SharePoint Designer through which you can set a master page as Default or Custom. Open your site in Designer and go to “_catalogs/masterpage” folder, right click any master page to see the context menu and you will see two options as “Set as Default Master Page” and “Set as Custom Master Page”. Make sure to Check Out the page before you set it as Default or Custom. Save your site in Designer and move to SharePoint to view the changes made. You must see the new master page applied to the site or …/Forms/….pages as per the selection of Custom or Default respectively:







Relationship between UI, SharePoint Designer and Page Code:
I want to show a relationship among so many cofusing things here, have a look:

[~masterurl/default.master](the token)----->[/_catalogs/masterpage/default.master](the URL usually)---->[System Master Page](as specified in Site Actions -> Site Settings -> Modify All Site Settings -> Master Page)----->[Set as default masterpage] (as specified in SharePoint Designer)

So which ever master page you select from the User Interface in the System Master Page section, that will be picked up by the “~masterurl/default.master” token in the content page, in default sharepoint settings it will resolve to .../_catalogs/masterpage/default.master master page, and now you may want any other of your master pages to be picked up by “~masterurl/default.master” token, and you may want to do it from sharepoint desinger, in that case you will use “set as default masterpage” option. And if you want to do it from UI, simply go to the System Master Page section and select the desired master page from the available list.

So, I hope now you understand the mapping between these somewhat confusing terms.

System Master Page setting from the UI corresponds to “Set as Default Master Page” setting in SharePoint Desinger. When we set a master page as “Set as default master page”, we actually mean to say that set MasterUrl property to point to this master page. Similarly, when we set a master page as a System Master Page, we actually mean to say that set MasterUrl property to point to this master page.

Similarly, here is the second obvious combination:

[~masterurl/custom.master](the token)----->[/_catalogs/masterpage/custom.master](the URL usually)---->[Site Master Page](as specified in Site Actions -> Site Settings -> Modify All Site Settings -> Master Page)----->[Set as custom masterpage] (as specified in SharePoint Designer)

Site Master Page setting from the UI corresponds to “Set as Custom Master Page” setting in SharePoint Desinger.When we set a master page as “Set as custom master page”, we actually mean to say that set CustomMasterUrl property to point to this master page. Similarly, when we set a master page as a Site Master Page, we actually mean to say that set CustomMasterUrl property to point to this master page.


Conclusion:
The two tokens works exactly the same. The purpose of having two tokens is that it provides a way to have a second shared master page as per a SharePoint Publishing site needs i.e. one for Publishing pages and one for Forms/Views pages.

Note that MasterUrl and CustomMasterUrl properties are set at SPWeb level:

SPContext.Current.Web.CustomMasterUrl = "/_catalogs/masterpage/MyCustomMaster.master";
SPContext.Current.Web.MasterUrl = "/_catalogs/masterpage/MyMasterPage.master";

So, these properties are available from anywhere within the web.

Hope this helps–

SharePoint 2010 Configuration Wizard Errors on Windows 7

December 9, 2009 rehmangul 5 comments

Alright, installing sharepoint 2010 on Windows 7 could be adventurous :) , Why? Coz we do not follow what Microsoft tells us. Here is Microsoft’s full length article to do so:

http://msdn.microsoft.com/en-us/library/ee554869(office.14).aspx

Here is a complete process for Installing SharePoint 2010 on Windows 7.

Anyways, if you are stuck on your way, here is a list of SharePoint Configuration Wizard errors and there solutions to help: 

Error no. -1:
I expect that you have already run all the pre-requisites present at the following location:
C:\Program Files (x86)\MSECache\oserver2010\PrerequisiteInstallerFiles

If not, run them now. In Windows 7, Usually it will be “FilterPack.msi” alone. Run this and run others if there are any.


Error no. zero:
In case you see something like this:






 

Solution:
Click here to view the solution.

 

Error no. 1:
friendlyMessage for task configdb is An exception of type System.IO.FileNotFoundException was thrown. Additional exception information: 

Could not load file or assembly ‘Microsoft.IdentityModel’

, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
12/09/2009 10:59:10 8 INF debugMessage for task configdb is An exception of type System.IO.FileNotFoundException was thrown. Additional exception information: Could not load file or assembly 'Microsoft.IdentityModel, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.IdentityModel, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
File name: 'Microsoft.IdentityModel, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'
at Microsoft.SharePoint.Administration.SPFarm.CurrentUserIsAdministrator(Boolean allowContentApplicationAccess)
at Microsoft.SharePoint.Administration.SPConfigurationDatabase.Microsoft.SharePoint.Administration.ISPPersistedStoreProvider.DoesCurrentUserHaveWritePermission(SPPersistedObject persistedObject)
at Microsoft.SharePoint.Administration.SPPersistedObject.BaseUpdate()
at Microsoft.SharePoint.Administration.SPFarm.Update()
at Microsoft.SharePoint.Administration.SPConfigurationDatabase.RegisterDefaultDatabaseServices(SqlConnectionStringBuilder connectionString)
at Microsoft.SharePoint.Administration.SPConfigurationDatabase.Provision(SqlConnectionStringBuilder connectionString)
at Microsoft.SharePoint.Administration.SPFarm.Create(SqlConnectionStringBuilder configurationDatabase, SqlConnectionStringBuilder administrationContentDatabase, IdentityType identityType, String farmUser, SecureString farmPassword, SecureString masterPassphrase)
at Microsoft.SharePoint.PostSetupConfiguration.ConfigurationDatabaseTask.CreateOrConnectConfigDb()
at Microsoft.SharePoint.PostSetupConfiguration.ConfigurationDatabaseTask.Run()
at Microsoft.SharePoint.PostSetupConfiguration.TaskThread.ExecuteTask()

WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].

Solution:
You do not have the correct version of Microsoft Geneva Framework, download and install here (and better to restart your machine):

Microsoft Geneva Framework Runtime for x64



Error no. 2:
Task evalprovision has failed with an unknown exception
12/09/2009 16:47:37 16 ERR Exception: Microsoft.Office.Server.UserProfiles.UserProfileException:

Unrecognized attribute ‘allowInsecureTransport’.

Note that attribute names are case-sensitive. (C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\WebClients\Profile\client.config line 56) ---> System.Configuration.ConfigurationErrorsException: Unrecognized attribute 'allowInsecureTransport'. Note that attribute names are case-sensitive. (C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\WebClients\Profile\client.config line 56)
at System.Configuration.BaseConfigurationRecord.EvaluateOne(String[] keys, SectionInput input, Boolean isTrusted, FactoryRecord factoryRecord, SectionRecord sectionRecord, Object parentResult)
at System.Configuration.BaseConfigurationRecord.Evaluate(FactoryRecord factoryRecord, SectionRecord sectionRecord, Object parentResult, Boolean getLkg, Boolean getRuntimeObject, Object& result, Object& resultRuntimeObject)
at System.Configuration.BaseConfigurationRecord.GetSectionRecursive(String configKey, Boolean getLkg, Boolean checkPermission, Boolean getRuntimeObject, Boolean requestIsHere, Object& result, Object& resultRuntimeObject)
at System.Configuration.ConfigurationSectionCollection.Get(String name)
at System.ServiceModel.Configuration.ServiceModelSectionGroup.get_Client()
at Microsoft.Office.Server.UserProfiles.MossClientBase`1.GetServiceBinding(String endpointConfigurationName)
at Microsoft.Office.Server.UserProfiles.MossClientBase`1.GetChannelFactory(String endpointConfigurationName)
at Microsoft.Office.Server.UserProfiles.MossClientBase`1.get_Channel()
at Microsoft.Office.Server.UserProfiles.MossClientBase`1.ExecuteOnChannel(String operationName, CodeBlock codeBlock)
at Microsoft.Office.Server.UserProfiles.ProfilePropertyServiceClient.ExecuteOnChannel(String operationName, CodeBlock codeBlock)
--- End of inner exception stack trace ---
 

Solution:
There is a hotfix available for this issue, download and install here (must restart your machine after installation):

https://connect.microsoft.com/VisualStudio/Downloads/DownloadDetails.aspx?DownloadID=23806&wa=wsignin1.0

 

Error no. 3:
An exception of type Microsoft.Office.Server.UserProfiles.UserProfileException was thrown. Additional exception information:

The HTTP request is unauthorized with client authentication scheme ‘Negotiate’.

The authentication header received from the server was ''.
Microsoft.Office.Server.UserProfiles.UserProfileException: The HTTP request is unauthorized with client authentication scheme 'Negotiate'. The authentication header received from the server was ''. ---> System.ServiceModel.Security.MessageSecurityException: The HTTP request is unauthorized with client authentication scheme 'Negotiate'. The authentication header received from the server was ''. ---> System.Net.WebException: The remote server returned an error: (401) Unauthorized.
at System.Net.HttpWebRequest.GetResponse()
at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)
--- End of inner exception stack trace ---

Solution:
You are missing IIS/Windows Features configurations. Run the following command in a command prompt window, this enables required IIS/Windows Features (the command is from Microsoft, so you can trust :) ):

start /w pkgmgr /iu:IIS-WebServerRole;IIS-WebServer;IIS-CommonHttpFeatures;IIS-StaticContent;IIS-DefaultDocument;IIS-DirectoryBrowsing;IIS-HttpErrors;IIS-ApplicationDevelopment;IIS-ASPNET;IIS-NetFxExtensibility;IIS-ISAPIExtensions;IIS-ISAPIFilter;IIS-HealthAndDiagnostics;IIS-HttpLogging;IIS-LoggingLibraries;IIS-RequestMonitor;IIS-HttpTracing;IIS-CustomLogging;IIS-Security;IIS-BasicAuthentication;IIS-WindowsAuthentication;IIS-DigestAuthentication;IIS-RequestFiltering;IIS-Performance;IIS-HttpCompressionStatic;IIS-HttpCompressionDynamic;IIS-WebServerManagementTools;IIS-ManagementConsole;IIS-IIS6ManagementCompatibility;IIS-Metabase;IIS-WMICompatibility;WAS-WindowsActivationService;WAS-ProcessModel;WAS-NetFxEnvironment;WAS-ConfigurationAPI;WCF-HTTP-Activation;

Make sure you execute the command with no line breaks, hopefully if you copy from above, there should not be any line breaks.

At this point, you may also want to have a look at Error no. 4 below, coz the above command from Microsoft misses one setting in IIS. Better to set it now instead of getting another error :) .

 



 

Error. no. 4:
An exception of type Microsoft.Office.Server.UserProfiles.UserProfileException was thrown.  Additional exception information:

The content type text/html; charset=utf-8 of the response message does not match the content type of the binding (application/soap+msbin1).

If using a custom encoder, be sure that the IsContentTypeSupported method is implemented properly. The first 1024 bytes of the response were: '<html>
    <head>
        <title>An item with the same key has already been added.</title>
        <style>
         body {font-family:"Verdana";font-weight:normal;font-size: .7em;color:black;}
         p {font-family:"Verdana";font-weight:normal;color:black;margin-top: -5px}
         b {font-family:"Verdana";font-weight:bold;color:black;margin-top: -5px}
         H1 { font-family:"Verdana";font-weight:normal;font-size:18pt;color:red }
         H2 { font-family:"Verdana";font-weight:normal;font-size:14pt;color:maroon }
         pre {font-family:"Lucida Console";font-size: .9em}
         .marker {font-weight: bold; color: black;text-decoration: none;}
         .version {color: gray;}
         .error {margin-bottom: 10px;}
         .expandable { text-decoration:underline; font-weight:bold; color:navy; cursor:hand; }
        </style>
    </head>


failed to create sample data

 


    <body bgcolor="white">

            <span><H1>Server Error in '/6a20012013634d01ab8c94df735a227b' Application.<hr width=100% size=1 color=silver>'.

Solution:

You are missing a Windows Feature that should be enabled. The command given above does not enable it. Go to Control Panel -> Programs -> Turn Windows Features on or off -> fill the check box for “Windows Communication Foundation Non-HTTP Activation” and OK (make sure you do not uncheck anything else).






See here for Installing SharePoint 2010 on Windows 7  

Hope this helps–

Installing SharePoint 2010 on Windows 7

December 8, 2009 rehmangul 1 comment

It’s not one hundred percent straight forward to install SharePoint 2010 on Windows 7. Here’s a list of steps that you must take before you’ll be able to create your first Enterprise Wiki ;) :

I assume that you have seen System requirements for SharePoint 2010:

http://blogs.msdn.com/sharepoint/archive/2009/05/07/announcing-sharepoint-server-2010-preliminary-system-requirements.aspx

Before you hit the setup file with a couple of clicks, you MUST fulfill the following pre-requisites (these will save you a lot of frustration that might come in the form of Configuration Wizard errors):

  1. Install Geneva Framework Runtime for x64:

    Microsoft Geneva Framework Runtime for x64

  2.  Install the following hotfix: 

     https://connect.microsoft.com/VisualStudio/Downloads/DownloadDetails.aspx?DownloadID=23806&wa=wsignin1.0

  3. Run the following command in a command prompt window, this enables required IIS/Windows Features (the command is from Microsoft, so you can trust ):




start /w pkgmgr /iu:IIS-WebServerRole;IIS-WebServer;IIS-CommonHttpFeatures;IIS-StaticContent;IIS-DefaultDocument;IIS-DirectoryBrowsing;IIS-HttpErrors;IIS-ApplicationDevelopment;IIS-ASPNET;IIS-NetFxExtensibility;IIS-ISAPIExtensions;IIS-ISAPIFilter;IIS-HealthAndDiagnostics;IIS-HttpLogging;IIS-LoggingLibraries;IIS-RequestMonitor;IIS-HttpTracing;IIS-CustomLogging;IIS-Security;IIS-BasicAuthentication;IIS-WindowsAuthentication;IIS-DigestAuthentication;IIS-RequestFiltering;IIS-Performance;IIS-HttpCompressionStatic;IIS-HttpCompressionDynamic;IIS-WebServerManagementTools;IIS-ManagementConsole;IIS-IIS6ManagementCompatibility;IIS-Metabase;IIS-WMICompatibility;WAS-WindowsActivationService;WAS-ProcessModel;WAS-NetFxEnvironment;WAS-ConfigurationAPI;WCF-HTTP-Activation;


Make sure you execute the command with no line breaks, if you copy from above, hopefully there should not be any line breaks.




 




 

       5.   The command given above does not enable one of the required Windows Features. Go to Control Panel -> Programs -> Turn Windows Features on or off -> fill the check box for “Windows Communication Foundation Non-HTTP Activation” and OK (make sure you do not uncheck anything else).








 

   6.  Must Restart your machine here.

Now we have to use/modify a few files within the SharePoint setup file. For that we have to extract files from setup.exe. There could be two ways of doing this. One is manual and the other is automatic. I recommend the automatic way. If you like automatic, skip the Manual step and go straright to automatic below.

Manual Extract:

First one is to extract the files from the setup exe manually, modify files and run the setup.exe (the extracted one).  The command to extract files is here:

C:\Users\rehmang>"D:\SharePoint 2010 Setup\SharePoint 2010\Microsoft SharePoint
Server 2010\14.0.4536.1000_OfficeServer_none_ship_x64_en-us_exe" /extract:"D:\Sh
arePoint 2010 Setup\SharePoint 2010\Microsoft SharePoint Server 2010\Extracted"

Your setup exe is at “D:\SharePoint 2010 Setup\SharePoint 2010\Microsoft SharePoint
Server 2010\”

and you are extracting files at
 
“D:\SharePoint 2010 Setup\SharePoint 2010\Microsoft SharePoint
Server 2010\Extracted”.

As soon as you will run the command, the extraction will start:






 

Click Ok on the success message and move to the folder where you extracted the files.

Run all the pre-requisites present at the following location:


D:\SharePoint 2010 Setup\SharePoint 2010\Microsoft SharePoint
Server 2010\Extracted\PrerequisiteInstallerFiles


In Windows 7, usually it will be “FilterPack.msi” alone. Run this and run others if there are any. Note that "Software Pre-requisite Tool" or "Preparation Tool" doesnt work with Windows 7, so you have to do it manually.

Go to following directory:

D:\SharePoint 2010 Setup\SharePoint 2010\Microsoft SharePoint
Server 2010\Extracted\Files\Setup

You will find a config file:




 





Right click and edit in Notepad:








 

Add the following line of code just before the closing </Configuration> tag (as shown above):


<Setting Id="AllowWindowsClientInstall" Value="True"/>





Save the file.

Go to "D:\SharePoint 2010 Setup\SharePoint 2010\Microsoft SharePoint
Server 2010\Extracted"
and click setup.exe (and not setup.cmd). This setup.exe is placed where you just extracted files from the original setup file. On the following splash screen click "Install SharePoint Server":




 





Your setup should proceed now:




 





Automatic Extraction (my way): 

So, which way I want to take. I will run the setup, which will extract the files automatically, and then setup will complain that your system is not Windows Server 2008 x64 bit and hence the setup cannot continue. I will say OK.

Note here that the files are extracted already, so I will go to the file extraction folder and modify the files there. Now the setup is ready to run on Windows 7. However, I will not run the setup again, but only click "Install Sharepoint Server" on the splash screen. This time the installer will get the modified files....(saves me from creating folders, getting the command right and manually extracting the files)...Read on.

Double click SharePoint 2010 setup:








You will see the Extracting Files screen:









 

You will get the following splash screens:













 






 

Click "Install Software Prerequisites" and you will get the following error message:









 

Click "Install SharePoint Server" and you will get the following error message:









 

To get rid of this error, we have to modify a config file on the file system. Click OK on the error message above and make sure you do not Exit on the splash screen behind.

Go to following directory:

C:\Program Files (x86)\MSECache\oserver2010\Files\Setup




You will find a config file:









 

Right click and edit in Notepad:









 

Add the following line of code just before the closing </Configuration> tag (as shown above):

<Setting Id="AllowWindowsClientInstall" Value="True"/>



Save the file.

Run all the pre-requisites present at the following location:
C:\Program Files (x86)\MSECache\oserver2010\PrerequisiteInstallerFiles

In Windows 7, usually it will be “FilterPack.msi” alone. Run this and run others if there are any. Note that "Software Pre-requisite Tool" or "Preparation Tool" doesnt work with Windows 7, so you have to do it manually.

Click "Install SharePoint Server" on the screen that we left running:









 

Your setup should proceed now:




 





For Product Keys, not me, its Microsoft :) .

On Windows 7, better to perform a Standalone installation.

Permissions Issue:

In case you got a permissions issue with editing the Config file, give yourself permissions on the Setup folder (in which the Config is contained):

Right click Setup -> go to Security tab -> click Edit -> click Add -> add your account like Domain\username -> fill the check box infront of "Full Control" -> OK all:





 





Edit Config file now and it should be all good.

After completing the above process, if you have started receiving Configuration Wizard errors, look here for a consolidated list of errors and there solutions.

Here is a useful MSDN link from Microsoft:

http://msdn.microsoft.com/en-us/library/ee554869(office.14).aspx

Hope this helps--

Setting Item Level Permissions Programmatically

December 4, 2009 rehmangul 3 comments


Here is how you can set item level permissions for a document library/list in sharepoint.


public string ItemLevelPermissions(string SiteAddress)

{

        string ReturnResult = "";

        try

        {
            SPSecurity.RunWithElevatedPrivileges(delegate()
            {               
               using (SPSite WebApp = new SPSite(SiteAddressHere))
               {

                   using (SPWeb Site = WebApp.OpenWeb())
                   {

                      SPList list = Site.Lists["MyDocLib"];

                      SPListItem item = list.Items[0];

                      SPRoleDefinition RoleDefinition = Site.RoleDefinitions.GetByType(SPRoleType.Contributor);

                      SPRoleAssignment RoleAssignment = new SPRoleAssignment("<DomainNameHere>\\<UserNameHere>", "EmailAddressHere", "GiveNameHere", "GiveNotesHere");

                      RoleAssignment.RoleDefinitionBindings.Add(RoleDefinition);

                      if(!item.HasUniqueRoleAssignments)

                      {

                         item.BreakRoleInheritance(true);               

                      }

                     item.RoleAssignments.Add(RoleAssignment);

                     item.Update();

                  }
               }
           });
        }
        catch (Exception ex)

        {

            ReturnResult += "Sorry the permissions could not be set for the item due to the following exception: " + ex.Message;

        }

        return ReturnResult;
}

Hope this helps–