Monday, January 24, 2011

An exception of type System.TypeLoadException

One free advice to all SharePoint developers. While you are trying to set up the development environment rejoice only after you are through with the Configuration Wizard. I was stuck with step 5 of the configuration wizard. The screen gifted me with the error

Failed to register SharePoint services.
An exception of type System.TypeLoadException was thrown. Additional exception information: Could not load type 'Microsoft.Office.Server.Search.Administration.SearchWebServiceManagerService' from assembly 'Microsoft.Office.Server.Search, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71E9BCE111E9429C'.
System.TypeLoadException: Could not load type 'Microsoft.Office.Server.Search.Administration.SearchWebServiceManagerService' from assembly 'Microsoft.Office.Server.Search, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71E9BCE111E9429C'.
at System.RuntimeTypeHandle._GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark, Boolean loadTypeFromPartialName)
at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark)
at System.RuntimeType.PrivateGetType(String typeName, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark)
at
System.Type.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase)
at Microsoft.SharePoint.PostSetupConfiguration.ReflectionHelper.InvokeConstructor(String assemblyQualifiedName, Type[] constructorSignature, Object[] constructorParameters)
at Microsoft.SharePoint.PostSetupConfiguration.TaskCommon.ReflectionHelperInvokeConstructor(String assemblyQualifiedName, Type[] constructorSignature, Object[] constructorParameters, TaskBase task)
at Microsoft.SharePoint.PostSetupConfiguration.ServicesTask.InvokeServiceConstructor(String serviceRegistryKeyName, String solutionIdRegistryName, String serviceNameRegistryName, Type[] constructorSignature, Object[] constructorParameters)
at Microsoft.SharePoint.PostSetupConfiguration.ServicesTask.InstallServiceInConfigDB(Boolean provisionTheServiceToo, String serviceRegistryKeyName)
at Microsoft.SharePoint.PostSetupConfiguration.ServicesTask.InstallServices(Boolean provisionTheServicesToo)
at Microsoft.SharePoint.PostSetupConfiguration.ServicesTask.Run()
at Microsoft.SharePoint.PostSetupConfiguration.TaskThread.ExecuteTask()


Well the root cause is not as complicated as the error message.
The reason behind the error is, you might not installed the "Chart Control" in your windows 7 machine.
Solution:
So, download the chart control from http://go.microsoft.com/fwlink/?LinkID=122517 and install it.

Friday, January 21, 2011

Installing the prerequisites for SharePoint 2010 in Win 7

Like every other SharePoint developer I had dreamed of having a SharePoint 2010 development environment in my personal laptop.Microsoft said its fine to go ahead with Win 7 ultimate edition and with all excitement copied the SharePoint 2010 set up files from the CD to my hard disk. As SharePoint requires the OS to have certain prerequisites before you install the actual product I double clicked the PrerequisiteInstaller.exe tool and there you go! Guess what, I was presented with an error message saying "The tool does not support this version of OS". I did some googling and realised you cannot use PrerequisiteInstaller.exe on Windows 7 or Windows Vista. For these operating systems there are some additional steps that need to be executed which I thought of sharing them here.

1.Needless to say you must execute each of the following steps with an account that has administrator access on the local computer. As a practice I always copy the installation files to my hard disk before proceeding further.

2.Locate the installation configuration file, config.xml in the path ..\Files\Setup\config.xml. Add this line under the tag:
<Setting Id="AllowWindowsClientInstall" Value="True"/>
The contents of the configuration file should look as below
<Configuration>
<Package Id="sts">
<Setting Id="SETUPTYPE" Value="CLEAN_INSTALL" />
</Package>
<DATADIR Value="%CommonProgramFiles%\Microsoft Shared\Web Server
Extensions\14\Data" />
<Logging Type="verbose" Path="%temp%" Template="Microsoft Windows
SharePoint Services 4.0 Setup *.log" />
<PIDKEY Value="PIDKey Value" />
<Setting Id="UsingUIInstallMode" Value="1" />
<Setting Id="SETUP_REBOOT" Value="Never" />
<Setting Id="AllowWindowsClientInstall" Value="True"/>
</Configuration>

3.Save the config.xml file. Remember the configuration file is case-sensitive.

4.Run the FilterPack.msi file located at ..\PrerequisiteInstallerFiles\FilterPack\FilterPack.msi

5.Install Microsoft Sync Framework

6.SQL Server Native Client

7.Windows Identity Foundation

8.Chart Controls

9.SQL Server Analysis Services - ADOMD.Net

10.Go to Control Panel > Programs and Features > Turn Windows features on or off and enable the following Windows 7 Features:

11.Restart your system to activate the new feature set.

12.Now that you are done with the prerequisites run the ../Setup.exe and follow the wizard. The installation should be smooth!