﻿<?xml version="1.0" encoding="utf-8"?><rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0"><channel><ttl>60</ttl><title>HariEdge - Haris views on Cutting Edge Technology!</title><link>http://hariedge.com</link><lastBuildDate>Fri, 12 Mar 2010 00:58:36 GMT</lastBuildDate><pubDate>Fri, 12 Mar 2010 00:58:36 GMT</pubDate><language>en</language><copyright /><itunes:subtitle> </itunes:subtitle><itunes:author /><itunes:summary /><description /><itunes:owner><itunes:name /><itunes:email>hari.vignesh@gmail.com</itunes:email></itunes:owner><itunes:explicit>no</itunes:explicit><itunes:category text="Arts" /><item><title>SharePoint Event Receivers – ItemUpdated, itemUpdating, beforeProperties, afterProperties</title><link>http://hariedge.com/2009/09/25/sharepoint-event-receivers--itemupdated-itemupdating-beforeproperties-afterproperties.aspx?ref=rss</link><dc:creator>Hari</dc:creator><description>&lt;p&gt;On my recent project we were using ItemAdded event to send custom emails to Tasks assigned by a SharePoint workflow. One requirement was the ability to reassign the Task if required.
&lt;/p&gt;&lt;p&gt;To do this I had to Check the "Assigned To" property and then reassign if required.. Having had trouble with beforeProperties and afterProperties I googled for it and came across this wonderful link:
&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.synergyonline.com/blog/blog-moss/Lists/Posts/Post.aspx?ID=25"&gt;http://www.synergyonline.com/blog/blog-moss/Lists/Posts/Post.aspx?ID=25&lt;/a&gt;  definitely a good read that will save anyone a lot of pain &lt;span style="font-family:Wingdings"&gt;J&lt;/span&gt;
	&lt;/p&gt;&lt;p&gt;HTH,
&lt;/p&gt;&lt;p&gt;Hari
&lt;/p&gt;&lt;p&gt;
 &lt;/p&gt;</description><category>SharePoint</category><comments>http://hariedge.com/2009/09/25/sharepoint-event-receivers--itemupdated-itemupdating-beforeproperties-afterproperties.aspx#Comments</comments><guid isPermaLink="false">7983776d-c76d-4652-9e8d-eca012d2c966</guid><pubDate>Fri, 25 Sep 2009 15:02:04 GMT</pubDate></item><item><title>Writing to a SharePoint List using Web Services leveraging Batch Updates</title><link>http://hariedge.com/2009/09/07/writing-to-a-sharepoint-list-using-web-services-leveraging-batch-updates.aspx?ref=rss</link><dc:creator>Hari</dc:creator><description>&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;It is possible to write to a SharePoint List using SharePoint web Services. This is very useful in scenarios where you might want to integrate 3 party data into your portal (through a scheduled task) and when you do not have access to running scripts on the SharePoint server itself [thus not allowing you to make use of the SharePoint Object model). I am using VS 2008 and .Net 3.5 SP1. The reason I am mentioning the environment is because of the different ways I had to configure my web service reference (as opposed to VS 2005 and .NET 2.0). Also the SharePoint portal I am writing to is configured with  windows authentication.&lt;/p&gt;&lt;ol&gt;&lt;li&gt;The first step is to add the Lists web service.  You can add a reference to the Project in Visual Studio by right clicking Project Properties and saying Add Service Reference.  (Called Add Web service in VS 2005 and .net 2.0). The URL for your Lists web service will be usually : &lt;span style="color:green; font-family:Courier New; font-size:10pt"&gt;http://&lt;span style="background-color:yellow"&gt;your server/site&lt;/span&gt;/_vti_bin/lists.asmx&lt;/span&gt;		&lt;/li&gt;&lt;li&gt;Once you have the web service, the next thing you need is the "List ID" of the List that you are going to write to. This ID is a GUID and can be obtained from your portal as follows: Go to the list settings page. Paste the URL in the Browser into notepad and copy everything after "List=" in the string. That's your URL Encoded GUID for the list. To get the LIST ID without the weird (also known as HTML encoded&lt;span style="font-family:Wingdings"&gt;J&lt;/span&gt;) characters, you can use this tool: &lt;a href="http://www.albionresearch.com/misc/urlencode.php"&gt;http://www.albionresearch.com/misc/urlencode.php&lt;/a&gt;  Copy the ID in the "Encoded" text box and click URLDecode.  Copy the ID generated in the Plain text box. This is the List GUID.&lt;/li&gt;&lt;li&gt;By default when you add a web service reference in VS 2008, it DOES not use Ntlm authentication which (most) of the SharePoint servers are configured with. So in order to make it work, you need to configure the "security" element under &amp;lt;binding&amp;gt;. This is what I have after the changes&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;&lt;span style="font-family:Courier New; font-size:10pt"&gt;&lt;span style="color:blue"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;security&lt;/span&gt;&lt;span style="color:blue"&gt;			&lt;/span&gt;&lt;span style="color:red"&gt;mode&lt;/span&gt;&lt;span style="color:blue"&gt;=&lt;/span&gt;"&lt;span style="color:blue"&gt;TransportCredentialOnly&lt;/span&gt;"&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Courier New; font-size:10pt"&gt;&lt;span style="color:blue"&gt;             &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;transport&lt;/span&gt;&lt;span style="color:blue"&gt;			&lt;/span&gt;&lt;span style="color:red"&gt;clientCredentialType&lt;/span&gt;&lt;span style="color:blue"&gt;=&lt;/span&gt;"&lt;span style="color:blue"&gt;Ntlm&lt;/span&gt;"&lt;span style="color:blue"&gt;			&lt;/span&gt;&lt;span style="color:red"&gt;proxyCredentialType&lt;/span&gt;&lt;span style="color:blue"&gt;=&lt;/span&gt;"&lt;span style="color:blue"&gt;Ntlm&lt;/span&gt;"&lt;span style="color:blue"&gt;			&lt;/span&gt;&lt;span style="color:red"&gt;realm&lt;/span&gt;&lt;span style="color:blue"&gt;=&lt;/span&gt;""&lt;span style="color:blue"&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Courier New; font-size:10pt"&gt;&lt;span style="color:blue"&gt;             &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;message&lt;/span&gt;&lt;span style="color:blue"&gt;			&lt;/span&gt;&lt;span style="color:red"&gt;clientCredentialType&lt;/span&gt;&lt;span style="color:blue"&gt;=&lt;/span&gt;"&lt;span style="color:blue"&gt;UserName&lt;/span&gt;"&lt;span style="color:blue"&gt;			&lt;/span&gt;&lt;span style="color:red"&gt;algorithmSuite&lt;/span&gt;&lt;span style="color:blue"&gt;=&lt;/span&gt;"&lt;span style="color:blue"&gt;Default&lt;/span&gt;"&lt;span style="color:blue"&gt; /&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-left: 36pt"&gt;&lt;span style="font-family:Courier New; font-size:10pt"&gt;&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;security&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;	&lt;/p&gt;&lt;ol&gt;&lt;li&gt;&lt;div&gt;Now you are ready to write some C# code. Here is the class I wrote for adding an item with some random "Title" to a List in SharePoint&lt;/div&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;&lt;span style="font-family:Courier New; font-size:10pt"&gt;&lt;span style="color:blue"&gt;using&lt;/span&gt; System;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Courier New; font-size:10pt"&gt;&lt;span style="color:blue"&gt;using&lt;/span&gt; System.Security.Principal;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Courier New; font-size:10pt"&gt;&lt;span style="color:blue"&gt;using&lt;/span&gt; System.ServiceModel;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Courier New; font-size:10pt"&gt;&lt;span style="color:blue"&gt;using&lt;/span&gt; System.Text;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Courier New; font-size:10pt"&gt;&lt;span style="color:blue"&gt;using&lt;/span&gt; System.Xml;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Courier New; font-size:10pt"&gt;&lt;span style="color:blue"&gt;using&lt;/span&gt; WriteToSharePointList.ListService;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Courier New; font-size:10pt"&gt;&lt;span style="color:blue"&gt;namespace&lt;/span&gt; WriteToSharePointList&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Courier New; font-size:10pt"&gt;{&lt;/span&gt;&lt;/p&gt;&lt;blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"&gt;&lt;span style="font-family: 'Courier New'; font-size: 13px; "&gt;&lt;span style="color:blue"&gt;class&lt;/span&gt;			&lt;span style="color:#2b91af"&gt;Program&lt;/span&gt;&lt;/span&gt;&lt;br&gt;&lt;span style="font-family: 'Courier New'; font-size: 13px; "&gt;{&lt;/span&gt;&lt;br&gt;&lt;/blockquote&gt;&lt;blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"&gt;&lt;blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"&gt;&lt;span style="font-family: 'Courier New'; font-size: 13px; "&gt;&lt;span style="color:blue"&gt;static&lt;/span&gt;			&lt;span style="color:blue"&gt;void&lt;/span&gt; Main(&lt;span style="color:blue"&gt;string&lt;/span&gt;[] args)&lt;/span&gt;&lt;br&gt;&lt;span style="font-family: 'Courier New'; font-size: 13px; "&gt;{&lt;/span&gt;&lt;br&gt;&amp;nbsp;&lt;br&gt;&lt;/blockquote&gt;&lt;/blockquote&gt;&lt;blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"&gt;&lt;blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"&gt;&lt;blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"&gt;&lt;span style="font-family: 'Courier New'; font-size: 13px; color: rgb(0, 0, 255); "&gt;try&lt;/span&gt;&lt;br&gt;&lt;span style="font-family: 'Courier New'; font-size: 13px; "&gt;{&lt;/span&gt;&lt;br&gt;&lt;/blockquote&gt;&lt;/blockquote&gt;&lt;/blockquote&gt;&lt;blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"&gt;&lt;blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"&gt;&lt;blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"&gt;&lt;blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"&gt;&lt;span style="font-family: 'Courier New'; font-size: 13px; "&gt;&lt;span style="color:blue"&gt;const&lt;/span&gt;			&lt;span style="color:blue"&gt;string&lt;/span&gt; listGuid = &lt;span style="color:#a31515"&gt;"{B98831FA-DFC1-4743-8E7E-D952A77D7BD9}"&lt;/span&gt;;&lt;/span&gt;&lt;br&gt;&lt;span style="font-family: 'Courier New'; font-size: 13px; color: rgb(0, 128, 0); "&gt;//Construct teh required batch XML element&lt;/span&gt;&lt;br&gt;&lt;span style="font-family: 'Courier New'; font-size: 13px; "&gt;&lt;span style="color:#2b91af"&gt;XmlElement&lt;/span&gt; batch = GetBatchElement();&lt;/span&gt;&lt;br&gt;&amp;nbsp;&lt;br&gt;&lt;span style="font-family: 'Courier New'; font-size: 13px; color: rgb(0, 128, 0); "&gt;//Set the content of the Batch elemnt to elements we need to update (in required XML Format)&lt;/span&gt;&lt;br&gt;&lt;span style="font-family: 'Courier New'; font-size: 13px; "&gt;batch.InnerXml = GetElementsToUpdate();&lt;/span&gt;&lt;br&gt;&amp;nbsp;&lt;br&gt;&lt;span style="font-family: 'Courier New'; font-size: 13px; color: rgb(0, 128, 0); "&gt;//Get the List Web Service Client&lt;/span&gt;&lt;br&gt;&lt;span style="font-family: 'Courier New'; font-size: 13px; "&gt;&lt;span style="color:#2b91af"&gt;ListsSoapClient&lt;/span&gt; client = GetWebServiceClient();&lt;/span&gt;&lt;br&gt;&amp;nbsp;&lt;br&gt;&lt;span style="font-family: 'Courier New'; font-size: 13px; color: rgb(0, 128, 0); "&gt;//Make the call to insert the elements&lt;/span&gt;&lt;br&gt;&lt;span style="font-family: 'Courier New'; font-size: 13px; "&gt;&lt;span style="color:blue"&gt;var&lt;/span&gt; status = client.UpdateListItems(listGuid, batch);&lt;/span&gt;&lt;br&gt;&amp;nbsp;&lt;br&gt;&lt;span style="font-family: 'Courier New'; font-size: 13px; color: rgb(0, 128, 0); "&gt;//Write results..&lt;/span&gt;&lt;br&gt;&lt;span style="font-family: 'Courier New'; font-size: 13px; "&gt;&lt;span style="color:#2b91af"&gt;Console&lt;/span&gt;.Out.WriteLine(status.InnerXml);&lt;/span&gt;&lt;br&gt;&lt;span style="font-family: 'Courier New'; font-size: 13px; "&gt;}&lt;/span&gt;&lt;br&gt;&lt;span style="font-family: 'Courier New'; font-size: 13px; "&gt;&lt;span style="color:blue"&gt;catch&lt;/span&gt; (&lt;span style="color:#2b91af"&gt;Exception&lt;/span&gt; e)&lt;/span&gt;&lt;br&gt;&lt;span style="font-family: 'Courier New'; font-size: 13px; "&gt;{&lt;/span&gt;&lt;br&gt;&lt;span style="font-family: 'Courier New'; font-size: 13px; "&gt;&lt;span style="color:#2b91af"&gt;Console&lt;/span&gt;.Out.WriteLine(&lt;span style="color:#a31515"&gt;"Error trying to insert items.."&lt;/span&gt;);&lt;/span&gt;&lt;br&gt;&lt;span style="font-family: 'Courier New'; font-size: 13px; "&gt;&lt;span style="color:#2b91af"&gt;Console&lt;/span&gt;.WriteLine(e);&lt;/span&gt;&lt;br&gt;&lt;span style="font-family: 'Courier New'; font-size: 13px; "&gt;}&lt;/span&gt;&lt;br&gt;&lt;span style="font-family: 'Courier New'; font-size: 13px; "&gt;&lt;span style="color:#2b91af"&gt;Console&lt;/span&gt;.Out.WriteLine(&lt;span style="color:#a31515"&gt;"End of program..press enter to exit"&lt;/span&gt;);&lt;/span&gt;&lt;br&gt;&lt;span style="font-family: 'Courier New'; font-size: 13px; "&gt;&lt;span style="color:#2b91af"&gt;Console&lt;/span&gt;.ReadLine();&lt;/span&gt;&lt;br&gt;&lt;/blockquote&gt;&lt;/blockquote&gt;&lt;/blockquote&gt;&lt;/blockquote&gt;&lt;blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"&gt;&lt;blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"&gt;&lt;blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"&gt;&lt;br&gt;&lt;/blockquote&gt;&lt;blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"&gt;&lt;span style="font-family: 'Courier New'; font-size: 13px; "&gt;}&lt;/span&gt;&lt;/blockquote&gt;&lt;/blockquote&gt;&lt;/blockquote&gt;&lt;blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"&gt;&lt;blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"&gt;&lt;br&gt;&lt;/blockquote&gt;&lt;blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"&gt;&lt;span style="font-family: 'Courier New'; font-size: 13px; "&gt;&lt;span style="color:blue"&gt;private&lt;/span&gt;			&lt;span style="color:blue"&gt;static&lt;/span&gt;			&lt;span style="color:#2b91af"&gt;XmlElement&lt;/span&gt; GetBatchElement()&lt;/span&gt;&lt;br&gt;&lt;span style="font-family: 'Courier New'; font-size: 13px; "&gt;{&lt;/span&gt;&lt;br&gt;&lt;/blockquote&gt;&lt;/blockquote&gt;&lt;blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"&gt;&lt;blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"&gt;&lt;blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"&gt;&lt;span style="font-family: 'Courier New'; font-size: 13px; "&gt;&lt;span style="color:#2b91af"&gt;XmlDocument&lt;/span&gt; doc = &lt;span style="color:blue"&gt;new&lt;/span&gt;			&lt;span style="color:#2b91af"&gt;XmlDocument&lt;/span&gt;();&lt;/span&gt;&lt;br&gt;&lt;span style="font-family: 'Courier New'; font-size: 13px; "&gt;&lt;span style="color:#2b91af"&gt;XmlElement&lt;/span&gt; batch = doc.CreateElement(&lt;span style="color:#a31515"&gt;"Batch"&lt;/span&gt;);&lt;/span&gt;&lt;br&gt;&lt;span style="font-family: 'Courier New'; font-size: 13px; "&gt;batch.SetAttribute(&lt;span style="color:#a31515"&gt;"OnError"&lt;/span&gt;, &lt;span style="color:#a31515"&gt;"Continue"&lt;/span&gt;);&lt;/span&gt;&lt;br&gt;&lt;span style="font-family: 'Courier New'; font-size: 13px; "&gt;batch.SetAttribute(&lt;span style="color:#a31515"&gt;"ListVersion"&lt;/span&gt;, &lt;span style="color:#a31515"&gt;"1"&lt;/span&gt;);&lt;/span&gt;&lt;br&gt;&lt;span style="font-family: 'Courier New'; font-size: 13px; "&gt;&lt;span style="color:blue"&gt;return&lt;/span&gt; batch;&lt;/span&gt;&lt;br&gt;&lt;/blockquote&gt;&lt;/blockquote&gt;&lt;/blockquote&gt;&lt;blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"&gt;&lt;blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"&gt;&lt;span style="font-family: 'Courier New'; font-size: 13px; "&gt;}&lt;/span&gt;&lt;br&gt;&amp;nbsp;&lt;br&gt;&lt;/blockquote&gt;&lt;/blockquote&gt;&lt;blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"&gt;&lt;span style="font-family: 'Courier New'; font-size: 13px; "&gt;&lt;span style="color:blue"&gt;private&lt;/span&gt;			&lt;span style="color:blue"&gt;static&lt;/span&gt;			&lt;span style="color:#2b91af"&gt;String&lt;/span&gt; GetElementsToUpdate()&lt;/span&gt;&lt;br&gt;&lt;span style="font-family: 'Courier New'; font-size: 13px; "&gt;{&lt;/span&gt;&lt;br&gt;&lt;/blockquote&gt;&lt;blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"&gt;&lt;blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"&gt;&lt;span style="font-family: 'Courier New'; font-size: 13px; "&gt;&lt;span style="color:#2b91af"&gt;StringBuilder&lt;/span&gt; methodBuilder = &lt;span style="color:blue"&gt;new&lt;/span&gt;			&lt;span style="color:#2b91af"&gt;StringBuilder&lt;/span&gt;();&lt;/span&gt;&lt;br&gt;&lt;span style="font-family: 'Courier New'; font-size: 13px; "&gt;&lt;span style="color:blue"&gt;const&lt;/span&gt;			&lt;span style="color:blue"&gt;string&lt;/span&gt; methodFormat = &lt;span style="color:#a31515"&gt;"&amp;lt;Method ID='1' Cmd='New'&amp;gt;"&lt;/span&gt; +&lt;/span&gt;&lt;br&gt;&lt;span style="font-family: 'Courier New'; font-size: 13px; "&gt;&lt;span style="color:#a31515"&gt;"&amp;lt;Field Name='ID'&amp;gt;New&amp;lt;/Field&amp;gt;"&lt;/span&gt; +&lt;/span&gt;&lt;br&gt;&lt;span style="font-family: 'Courier New'; font-size: 13px; "&gt;&lt;span style="color:#a31515"&gt;"&amp;lt;Field Name='Title'&amp;gt;{0}&amp;lt;/Field&amp;gt;"&lt;/span&gt; +&lt;/span&gt;&lt;br&gt;&lt;span style="font-family: 'Courier New'; font-size: 13px; "&gt;&lt;span style="color:#a31515"&gt;"&amp;lt;/Method&amp;gt;"&lt;/span&gt;;&lt;/span&gt;&lt;br&gt;&lt;span style="font-family: 'Courier New'; font-size: 13px; "&gt;&lt;span style="color:blue"&gt;for&lt;/span&gt; (&lt;span style="color:blue"&gt;int&lt;/span&gt; i = 0; i &amp;lt; 5; i++)&lt;/span&gt;&lt;br&gt;&lt;span style="font-family: 'Courier New'; font-size: 13px; "&gt;{&lt;/span&gt;&lt;br&gt;&lt;span style="font-family: 'Courier New'; font-size: 13px; "&gt;methodBuilder.AppendFormat(methodFormat,&lt;span style="color:#a31515"&gt;"Title "&lt;/span&gt; +i);&lt;/span&gt;&lt;br&gt;&lt;span style="font-family: 'Courier New'; font-size: 13px; "&gt;}&lt;/span&gt;&lt;br&gt;&lt;span style="font-family: 'Courier New'; font-size: 13px; "&gt;&lt;span style="color:blue"&gt;return&lt;/span&gt; methodBuilder.ToString();&lt;/span&gt;&lt;br&gt;&lt;/blockquote&gt;&lt;/blockquote&gt;&lt;blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"&gt;&lt;span style="font-family: 'Courier New'; font-size: 13px; "&gt;}&lt;/span&gt;&lt;br&gt;&amp;nbsp;&lt;br&gt;&lt;span style="font-family: 'Courier New'; font-size: 13px; "&gt;&lt;span style="color:blue"&gt;private&lt;/span&gt;			&lt;span style="color:blue"&gt;static&lt;/span&gt;			&lt;span style="color:#2b91af"&gt;ListsSoapClient&lt;/span&gt; GetWebServiceClient()&lt;/span&gt;&lt;br&gt;&lt;span style="font-family: 'Courier New'; font-size: 13px; "&gt;{&lt;/span&gt;&lt;br&gt;&lt;/blockquote&gt;&lt;blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"&gt;&lt;blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"&gt;&lt;span style="font-family: 'Courier New'; font-size: 13px; "&gt;&lt;span style="color:#2b91af"&gt;ListsSoapClient&lt;/span&gt; client = &lt;span style="color:blue"&gt;new&lt;/span&gt;			&lt;span style="color:#2b91af"&gt;ListsSoapClient&lt;/span&gt;();&lt;/span&gt;&lt;br&gt;&lt;span style="font-family: 'Courier New'; font-size: 13px; "&gt;client.ClientCredentials.Windows.AllowedImpersonationLevel = &lt;span style="color:#2b91af"&gt;TokenImpersonationLevel&lt;/span&gt;.Impersonation;&lt;/span&gt;&lt;br&gt;&lt;span style="font-family: 'Courier New'; font-size: 13px; color: rgb(0, 128, 0); "&gt;//client.Endpoint.Address = new EndpointAddress("http://&lt;span style="background-color:yellow"&gt;your server/site&lt;/span&gt;/_vti_bin/lists.asmx");&lt;/span&gt;&lt;br&gt;&lt;span style="font-family: 'Courier New'; font-size: 13px; "&gt;&lt;span style="color:blue"&gt;return&lt;/span&gt; client;&lt;/span&gt;&lt;br&gt;&lt;/blockquote&gt;&lt;/blockquote&gt;&lt;blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"&gt;&lt;span style="font-family: 'Courier New'; font-size: 13px; "&gt;}&lt;/span&gt;&lt;br&gt;&amp;nbsp;&lt;/blockquote&gt;&lt;blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"&gt;&lt;span style="font-family: 'Courier New'; font-size: 13px; "&gt;}&lt;/span&gt;&lt;br&gt;&lt;/blockquote&gt;&lt;p&gt;&lt;span style="font-family:Courier New; font-size:10pt"&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;As you can see, it is possible to change the server name, List GUID as highlighted above. &lt;/p&gt;&lt;p&gt;If you need to add a new column value to the List, you just need to include an extra Field element as shown below(where we also add a status element)&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Courier New; font-size:10pt"&gt;&lt;span style="color:blue"&gt;const&lt;/span&gt;			&lt;span style="color:blue"&gt;string&lt;/span&gt; methodFormat = &lt;span style="color:#a31515"&gt;"&amp;lt;Method ID='1' Cmd='New'&amp;gt;"&lt;/span&gt; +&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Courier New; font-size:10pt"&gt;			&lt;span style="color:#a31515"&gt;&lt;span&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;"&amp;lt;Field Name='ID'&amp;gt;New&amp;lt;/Field&amp;gt;"&lt;/span&gt; +&lt;br&gt;&lt;span style="color:#a31515"&gt;&lt;span&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;"&amp;lt;Field Name='Title'&amp;gt;{0}&amp;lt;/Field&amp;gt;"&lt;/span&gt; +&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Courier New; font-size:10pt"&gt;&lt;span&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&amp;nbsp;&lt;span style="color:#a31515"&gt;"&amp;lt;Field Name='Status'&amp;gt;{1}&amp;lt;/Field&amp;gt;"&lt;/span&gt; +&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Courier New; font-size:10pt"&gt;&lt;span style="color:#a31515"&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;"&amp;lt;/Method&amp;gt;"&lt;/span&gt;;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;And then in loop&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Courier New; font-size:10pt"&gt;			&lt;span style="color:blue"&gt;for&lt;/span&gt; (&lt;span style="color:blue"&gt;int&lt;/span&gt; i = 0; i &amp;lt; 5; i++)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Courier New; font-size:10pt"&gt;            {&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Courier New; font-size:10pt"&gt;                &lt;span&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;methodBuilder.AppendFormat(methodFormat,&lt;span style="color:#a31515"&gt;"Title "&lt;/span&gt; +I,&lt;span style="color:#a31515"&gt; "Status "&lt;/span&gt; +i);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Courier New; font-size:10pt"&gt;            }&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Happy coding, &lt;/p&gt;&lt;p&gt;Hari&lt;/p&gt;</description><category>SharePoint</category><comments>http://hariedge.com/2009/09/07/writing-to-a-sharepoint-list-using-web-services-leveraging-batch-updates.aspx#Comments</comments><guid isPermaLink="false">817ff78c-a423-4067-a657-9eb615c91e06</guid><pubDate>Tue, 08 Sep 2009 14:35:11 GMT</pubDate></item><item><title>Getting SPUser from SharePoint List Column</title><link>http://hariedge.com/2009/07/24/getting-spuser-from-sharepoint-list-column.aspx?ref=rss</link><dc:creator>Hari</dc:creator><description>&lt;p&gt;In the project I was working on right now, I had to get a User field from a SharePoint User colum. The value is stored as a lookup column and in order to get it as a SPUSER I had to write the following utility method 
&lt;/p&gt;&lt;p style="margin-left: 72pt"&gt;&lt;span style="font-family:Courier New; font-size:10pt"&gt;&lt;span style="color:blue"&gt;public&lt;/span&gt;
			&lt;span style="color:blue"&gt;static&lt;/span&gt;
			&lt;span style="color:#2b91af"&gt;SPUser&lt;/span&gt; GetUser(&lt;span style="color:blue"&gt;string&lt;/span&gt; columnValue, &lt;span style="color:#2b91af"&gt;SPField&lt;/span&gt; userField)
&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-left: 36pt"&gt;&lt;span style="font-family:Courier New; font-size:10pt"&gt;        {
&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-left: 72pt"&gt;&lt;span style="font-family:Courier New; font-size:10pt"&gt;
			&lt;span style="color:#2b91af"&gt;SPFieldUser&lt;/span&gt; field = (&lt;span style="color:#2b91af"&gt;SPFieldUser&lt;/span&gt;)userField;
&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-left: 72pt"&gt;&lt;span style="font-family:Courier New; font-size:10pt"&gt;
			&lt;span style="color:#2b91af"&gt;SPFieldUserValue&lt;/span&gt; fieldValue = (&lt;span style="color:#2b91af"&gt;SPFieldUserValue&lt;/span&gt;)field.GetFieldValue(columnValue);
&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-left: 72pt"&gt;&lt;span style="font-family:Courier New; font-size:10pt"&gt;
			&lt;span style="color:blue"&gt;return&lt;/span&gt; fieldValue.User;    
&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-left: 36pt"&gt;&lt;span style="font-family:Courier New; font-size:10pt"&gt;        }&lt;/span&gt; 
&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Courier New; font-size:10pt"&gt;    To get the SPUSer filed now, we just call the method as follows &lt;/span&gt;
	&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Courier New; font-size:10pt"&gt;        &lt;span style="color:blue"&gt;string&lt;/span&gt; managerColumnValue = 
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Courier New; font-size:10pt"&gt;            nominationListItem[&lt;span style="color:#2b91af"&gt;NominationListColumns&lt;/span&gt;.MANAGER].ToString(); &lt;/span&gt;
	&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Courier New; font-size:10pt"&gt;&lt;span style="color:#2b91af"&gt;    SPUser&lt;/span&gt; manager = &lt;span style="color:#2b91af"&gt;Utilities&lt;/span&gt;.GetUser(managerColumnValue, &lt;/span&gt;
	&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Courier New; font-size:10pt"&gt;    nominationListItem.Fields[&lt;span style="color:#2b91af"&gt;NominationListColumns&lt;/span&gt;.MANAGER]); &lt;/span&gt;
	&lt;/p&gt;&lt;p&gt; 
 &lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Courier New; font-size:10pt"&gt;    where &lt;/span&gt;
	&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Courier New; font-size:10pt"&gt;        &lt;span style="color:#2b91af"&gt;NominationListColumns&lt;/span&gt;.MANAGER = "Manager", which is the column name..&lt;/span&gt;&lt;/p&gt;</description><category>SharePoint</category><comments>http://hariedge.com/2009/07/24/getting-spuser-from-sharepoint-list-column.aspx#Comments</comments><guid isPermaLink="false">d3432cea-3976-4b20-ab33-95c20e9494d4</guid><pubDate>Fri, 24 Jul 2009 18:54:47 GMT</pubDate></item><item><title>Active Directory in .Net 3.5</title><link>http://hariedge.com/2009/06/24/active-directory-in-net-35.aspx?ref=rss</link><dc:creator>Hari</dc:creator><description>&lt;p&gt;
&amp;nbsp;&lt;/p&gt;&lt;p&gt;For one of my recent endeavors in planet .NET I had to deal with vanquishing a problem that required the use of Active Directory libraries in .NET. Having almost 0 experience in active directory libraries (apart from using the role providers once for an Asp.Net web site) and having full trust in Google I started to proceed..
&lt;/p&gt;&lt;p&gt;I was surprised that "Google" failed me at first followed by MSDN followed by lack of any good examples (heh I need someone to blame : ) ). There were very few posts regarding using the .Net 3.5 Active Directory libraries. I did find a lot of examples using the 2.0 version. So here is a posting of all the links and some weird issues that I ran with the Libraries.
&lt;/p&gt;&lt;p&gt;The best link I figured for knowing about these libraries is the one given below. Believe it or not, this never showed up in my normal Google search. It ended up being one of the links displayed when I was searching for something else..Anyway the best link is 
&lt;/p&gt;&lt;p&gt;&lt;a href="http://msdn.microsoft.com/en-us/magazine/cc135979.aspx"&gt;http://msdn.microsoft.com/en-us/magazine/cc135979.aspx&lt;/a&gt;
	&lt;/p&gt;&lt;p&gt;Other links that I had found very useful were 
&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://glorix.blogspot.com/2008/01/net-35-finally-brings-some-decent.html"&gt;http://glorix.blogspot.com/2008/01/net-35-finally-brings-some-decent.html&lt;/a&gt;
		&lt;/li&gt;&lt;li&gt;&lt;a href="http://costoda.blogspot.com/2008/01/getting-information-from-active.html"&gt;http://costoda.blogspot.com/2008/01/getting-information-from-active.html&lt;/a&gt;
		&lt;/li&gt;&lt;li&gt;
		&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;These should be a very good place for getting you started.
&lt;/p&gt;&lt;p&gt;Apart from that, here are some issues for which I was banging my head against the wall for a few hours. Hopefully these should save someone the pain
&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;div&gt;&lt;strong&gt;Getting more than 1000 records returned (or 2000, 3000 whatever is configured in Active Directory) in the PrincipalSearcher
&lt;/strong&gt;&lt;/div&gt;&lt;p&gt;So everything seemed fine in ".NET AD Library Wonderland" and I was cruising around using the libraries until I found out that a wild card search returned only 1000 users when there should have been around 6000.  Here was the code I had 
&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;span style="font-family:Courier New; font-size:10pt"&gt;&lt;span style="color:blue"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;using&lt;/span&gt; (&lt;span style="color:blue"&gt;var&lt;/span&gt; principalContext = &lt;span style="color:blue"&gt;new&lt;/span&gt;
			&lt;span style="color:#2b91af"&gt;PrincipalContext&lt;/span&gt;(&lt;span style="color:#2b91af"&gt;ContextType&lt;/span&gt;.Domain, Controller, Container))
&lt;/span&gt;&lt;/p&gt;&lt;blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"&gt;&lt;span style="font-family: 'Courier New'; font-size: 13px; "&gt;{&lt;/span&gt;&lt;br&gt;&lt;/blockquote&gt;&lt;blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"&gt;&lt;blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"&gt;&lt;span style="font-family: 'Courier New'; font-size: 13px; "&gt;&lt;span style="color:blue"&gt;var&lt;/span&gt; u = &lt;span style="color:blue"&gt;new&lt;/span&gt;
			&lt;span style="color:#2b91af"&gt;UserPrincipal&lt;/span&gt;(principalContext);&lt;/span&gt;&lt;br&gt;&lt;span style="font-family: 'Courier New'; font-size: 13px; color: rgb(0, 128, 0); "&gt;// Set properties on the user principal object.&lt;/span&gt;&lt;br&gt;&lt;span style="font-family: 'Courier New'; font-size: 13px; "&gt;u.SamAccountName = "*";&lt;/span&gt;&lt;br&gt;&lt;span style="font-family: 'Courier New'; font-size: 13px; "&gt;u.Enabled = &lt;span style="color:blue"&gt;true&lt;/span&gt;;&lt;/span&gt;&lt;br&gt;&amp;nbsp;&lt;br&gt;&lt;span style="font-family: 'Courier New'; font-size: 13px; color: rgb(0, 128, 0); "&gt;// Create a PrincipalSearcher object to perform the search.&lt;/span&gt;&lt;br&gt;&lt;span style="font-family: 'Courier New'; font-size: 13px; "&gt;&lt;span style="color:blue"&gt;using&lt;/span&gt; (&lt;span style="color:blue"&gt;var&lt;/span&gt; ps = &lt;span style="color:blue"&gt;new&lt;/span&gt;
			&lt;span style="color:#2b91af"&gt;PrincipalSearcher&lt;/span&gt;())&lt;/span&gt;&lt;br&gt;&lt;span style="font-family: 'Courier New'; font-size: 13px; "&gt;{&lt;/span&gt;&lt;br&gt;&lt;/blockquote&gt;&lt;/blockquote&gt;&lt;blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"&gt;&lt;blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"&gt;&lt;blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"&gt;&lt;span style="font-family: 'Courier New'; font-size: 13px; "&gt;ps.QueryFilter = u;&lt;/span&gt;&lt;br&gt;&lt;span style="font-family: 'Courier New'; font-size: 13px; "&gt;&lt;span style="color:#2b91af"&gt;PrincipalSearchResult&lt;/span&gt;&amp;lt;&lt;span style="color:#2b91af"&gt;Principal&lt;/span&gt;&amp;gt; users = ps.FindAll();&lt;/span&gt;&lt;br&gt;&lt;/blockquote&gt;&lt;/blockquote&gt;&lt;/blockquote&gt;&lt;blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"&gt;&lt;blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"&gt;&lt;span style="font-family: 'Courier New'; font-size: 13px; "&gt;}&lt;/span&gt;&lt;br&gt;&lt;/blockquote&gt;&lt;/blockquote&gt;&lt;blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"&gt;&amp;nbsp;&lt;br&gt;&lt;span style="font-family: 'Courier New'; font-size: 13px; "&gt;}&lt;/span&gt;&lt;br&gt;&lt;/blockquote&gt;&lt;p style="margin-left: 36pt"&gt;
&amp;nbsp;&lt;/p&gt;&lt;p style="margin-left: 36pt"&gt;So I figured that there should be a Limit setting on the Query filter or maybe on the PrincipalSearcher object that would allow me to set the result set size… But guess what there was NONE!!
&lt;/p&gt;&lt;p style="margin-left: 36pt"&gt;Finally with some help from this link, I figured that you had to ALSO supply the UserPrincipal object to the PrincipalSearcher Object, and Just setting it to ps.QueryFilter only returns 1000 users..very weird. So here is the same code with the change shown.
&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Courier New; font-size:10pt"&gt;&lt;span style="color:blue"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;using&lt;/span&gt; (&lt;span style="color:blue"&gt;var&lt;/span&gt; principalContext = &lt;span style="color:blue"&gt;new&lt;/span&gt;
			&lt;span style="color:#2b91af"&gt;PrincipalContext&lt;/span&gt;(&lt;span style="color:#2b91af"&gt;ContextType&lt;/span&gt;.Domain, Controller, Container))
&lt;/span&gt;&lt;/p&gt;&lt;blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"&gt;&lt;span style="font-family: 'Courier New'; font-size: 13px; "&gt;{&lt;/span&gt;&lt;br&gt;&lt;/blockquote&gt;&lt;blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"&gt;&lt;blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"&gt;&lt;span style="font-family: 'Courier New'; font-size: 13px; "&gt;&lt;span style="color:blue"&gt;var&lt;/span&gt; u = &lt;span style="color:blue"&gt;new&lt;/span&gt;
			&lt;span style="color:#2b91af"&gt;UserPrincipal&lt;/span&gt;(principalContext);&lt;/span&gt;&lt;br&gt;&lt;span style="font-family: 'Courier New'; font-size: 13px; color: rgb(0, 128, 0); "&gt;// Set properties on the user principal object.&lt;/span&gt;&lt;br&gt;&lt;span style="font-family: 'Courier New'; font-size: 13px; "&gt;u.SamAccountName = "*";&lt;/span&gt;&lt;br&gt;&lt;span style="font-family: 'Courier New'; font-size: 13px; "&gt;u.Enabled = &lt;span style="color:blue"&gt;true&lt;/span&gt;;&lt;/span&gt;&lt;br&gt;&amp;nbsp;&lt;br&gt;&lt;span style="font-family: 'Courier New'; font-size: 13px; color: rgb(0, 128, 0); "&gt;// Create a PrincipalSearcher object to perform the search.&lt;/span&gt;&lt;br&gt;&lt;span style="font-family: 'Courier New'; font-size: 13px; font-weight: bold; "&gt;&lt;span style="color:blue"&gt;using&lt;/span&gt; (&lt;span style="color:blue"&gt;var&lt;/span&gt; ps = &lt;span style="color:blue"&gt;new&lt;/span&gt;
				&lt;span style="color:#2b91af"&gt;PrincipalSearcher&lt;/span&gt;(&lt;span style="background-color:yellow"&gt;u))&lt;/span&gt;&lt;/span&gt;&lt;br&gt;&lt;span style="font-family: 'Courier New'; font-size: 13px; "&gt;{&lt;/span&gt;&lt;br&gt;&lt;/blockquote&gt;&lt;/blockquote&gt;&lt;blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"&gt;&lt;blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"&gt;&lt;blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"&gt;&lt;span style="font-family: 'Courier New'; font-size: 13px; "&gt;ps.QueryFilter = u;&lt;/span&gt;&lt;br&gt;&lt;span style="font-family: 'Courier New'; font-size: 13px; "&gt;&lt;span style="color:#2b91af"&gt;PrincipalSearchResult&lt;/span&gt;&amp;lt;&lt;span style="color:#2b91af"&gt;Principal&lt;/span&gt;&amp;gt; users = ps.FindAll();&lt;/span&gt;&lt;br&gt;&lt;/blockquote&gt;&lt;/blockquote&gt;&lt;/blockquote&gt;&lt;blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"&gt;&lt;blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"&gt;&lt;span style="font-family: 'Courier New'; font-size: 13px; "&gt;&amp;nbsp;}&lt;/span&gt;&lt;br&gt;&lt;/blockquote&gt;&lt;/blockquote&gt;&lt;blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"&gt;&amp;nbsp;&lt;br&gt;&lt;span style="font-family: 'Courier New'; font-size: 13px; "&gt;}&lt;/span&gt;&lt;br&gt;&lt;/blockquote&gt;&lt;p style="margin-left: 36pt"&gt;
&amp;nbsp;&lt;/p&gt;&lt;p style="margin-left: 36pt"&gt;
&amp;nbsp;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Getting the right "LastLogin" value!
&lt;/strong&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Imagine my Joy when I found that you could just get the "LastLogin" value using the UserPrincipal object. Something like "&lt;span style="font-family:Courier New; font-size:10pt"&gt;principal.LastLogon&lt;/span&gt;".  Unfortunately my Joy was short lived as I &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;found that it always returned some sort of "Cached Value" instead of the most recent Login value (run against the same Domain Controller). I was able to use other tools, browse to the Domain &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Controller and see that the "last Login" date was different..
&lt;/p&gt;&lt;p style="margin-left: 36pt"&gt;So I had to change the code to explicitly query for the "lastLogon" property explicitly as shown below..
&lt;/p&gt;&lt;p style="margin-left: 36pt"&gt;&lt;span style="font-family:Courier New; font-size:10pt"&gt;&lt;span style="color:#2b91af"&gt;DateTime&lt;/span&gt;? lastLoginDateFromAd = GetLastLoginDateExplicitly(principal);
&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-left: 36pt"&gt;&lt;span style="font-family:Courier New; font-size:10pt"&gt;And the method is: 
&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-left: 36pt"&gt;&lt;span style="font-family:Courier New; font-size:10pt"&gt;&lt;span style="color:blue"&gt;private&lt;/span&gt;
			&lt;span style="color:blue"&gt;static&lt;/span&gt;
			&lt;span style="color:#2b91af"&gt;DateTime&lt;/span&gt;? GetLastLoginDateExplicitly(&lt;span style="color:#2b91af"&gt;UserPrincipal&lt;/span&gt; principal)
&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-left: 36pt"&gt;&lt;span style="font-family:Courier New; font-size:10pt"&gt;        {
&lt;/span&gt;&lt;/p&gt;&lt;blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"&gt;&lt;blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"&gt;&lt;span style="font-family: 'Courier New'; font-size: 13px; "&gt;&lt;span style="color:#2b91af"&gt;DateTime&lt;/span&gt;? fromDe = &lt;span style="color:blue"&gt;null&lt;/span&gt;;&lt;/span&gt;&lt;br&gt;&lt;span style="font-family: 'Courier New'; font-size: 13px; "&gt;&lt;span style="color:blue"&gt;var&lt;/span&gt; deUser = principal.GetUnderlyingObject() &lt;span style="color:blue"&gt;as&lt;/span&gt;
			&lt;span style="color:#2b91af"&gt;DirectoryEntry&lt;/span&gt;;&lt;/span&gt;&lt;br&gt;&lt;span style="font-family: 'Courier New'; font-size: 13px; "&gt;&lt;span style="color:blue"&gt;if&lt;/span&gt; (deUser != &lt;span style="color:blue"&gt;null&lt;/span&gt;)&lt;/span&gt;&lt;br&gt;&lt;span style="font-family: 'Courier New'; font-size: 13px; "&gt;{&lt;/span&gt;&lt;br&gt;&lt;/blockquote&gt;&lt;/blockquote&gt;&lt;blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"&gt;&lt;blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"&gt;&lt;blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"&gt;&lt;span style="font-family: 'Courier New'; font-size: 13px; "&gt;&lt;span style="color:blue"&gt;var&lt;/span&gt; lastLogonThisServer = &lt;span style="color:blue"&gt;new&lt;/span&gt;
			&lt;span style="color:#2b91af"&gt;Int64&lt;/span&gt;();&lt;/span&gt;&lt;br&gt;&lt;span style="font-family: 'Courier New'; font-size: 13px; "&gt;&lt;span style="color:blue"&gt;if&lt;/span&gt; (deUser.Properties[&lt;span style="color:#a31515"&gt;"lastLogon"&lt;/span&gt;].Value != &lt;span style="color:blue"&gt;null&lt;/span&gt;)&lt;/span&gt;&lt;br&gt;&lt;span style="font-family: 'Courier New'; font-size: 13px; "&gt;{&lt;/span&gt;&lt;br&gt;&lt;/blockquote&gt;&lt;/blockquote&gt;&lt;/blockquote&gt;&lt;blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"&gt;&lt;blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"&gt;&lt;blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"&gt;&lt;blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"&gt;&lt;span style="font-family: 'Courier New'; font-size: 13px; "&gt;&lt;span style="color:blue"&gt;var&lt;/span&gt; lgInt =&lt;/span&gt;&lt;br&gt;&lt;span style="font-family: 'Courier New'; font-size: 13px; "&gt;(&lt;span style="color:#2b91af"&gt;IADsLargeInteger&lt;/span&gt;) deUser.Properties[&lt;span style="color:#a31515"&gt;"lastLogon"&lt;/span&gt;].Value;&lt;/span&gt;&lt;br&gt;&lt;span style="font-family: 'Courier New'; font-size: 13px; "&gt;lastLogonThisServer = ((&lt;span style="color:blue"&gt;long&lt;/span&gt;) lgInt.HighPart &amp;lt;&amp;lt; 32) + lgInt.LowPart;&lt;/span&gt;&lt;br&gt;&lt;span style="font-family: 'Courier New'; font-size: 13px; "&gt;fromDe = &lt;span style="color:#2b91af"&gt;DateTime&lt;/span&gt;.FromFileTime(lastLogonThisServer);&lt;/span&gt;&lt;br&gt;&lt;/blockquote&gt;&lt;/blockquote&gt;&lt;/blockquote&gt;&lt;/blockquote&gt;&lt;blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"&gt;&lt;blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"&gt;&lt;blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"&gt;&lt;span style="font-family: 'Courier New'; font-size: 13px; "&gt;}&lt;/span&gt;&lt;br&gt;&lt;/blockquote&gt;&lt;/blockquote&gt;&lt;/blockquote&gt;&lt;blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"&gt;&lt;blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"&gt;&lt;span style="font-family: 'Courier New'; font-size: 13px; "&gt;}&lt;/span&gt;&lt;br&gt;&lt;span style="font-family: 'Courier New'; font-size: 13px; "&gt;&lt;span style="color:blue"&gt;return&lt;/span&gt; fromDe;&lt;/span&gt;&lt;br&gt;&lt;/blockquote&gt;&lt;/blockquote&gt;&lt;p style="margin-left: 36pt"&gt;&lt;span style="font-family:Courier New; font-size:10pt"&gt;        }
&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-left: 36pt"&gt;&lt;span style="font-family:Courier New; font-size:10pt"&gt;Hope this helps someone..
&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-left: 36pt"&gt;&lt;span style="font-family:Courier New; font-size:10pt"&gt;Hari&lt;/span&gt;&lt;/p&gt;</description><category>.Net Learnings</category><comments>http://hariedge.com/2009/06/24/active-directory-in-net-35.aspx#Comments</comments><guid isPermaLink="false">7b066712-b0fc-43f6-b75e-7b3890ac7388</guid><pubDate>Wed, 24 Jun 2009 17:50:23 GMT</pubDate></item><item><title>Understanding Web Applications, Site Collection and Sites</title><link>http://hariedge.com/2009/05/13/understanding-web-applications-site-collection-and-sites.aspx?ref=rss</link><dc:creator>Hari</dc:creator><description>&lt;p&gt;So if you have been developing or using SharePoint you have definitely come across these terms. The best way I have come up with to understand them is to compare them to a Condo Complex (or Flats as known in India &lt;span style="font-family:Wingdings"&gt;J&lt;/span&gt;)
&lt;/p&gt;&lt;h1&gt;Web Application
&lt;/h1&gt;&lt;p&gt;An empty piece of land is the Web Application. You have a placeholder for building something, but as such it is pretty much empty. This is true in case of a SharePoint web Application. When you create a web application using Central Administration, *unless* you create a Site Collection, you can't access it. If you try tying the web application URL in the browser and try to navigate to it, it will throw an error.
&lt;/p&gt;&lt;h1&gt;Site Collection
&lt;/h1&gt;&lt;p&gt;Your entire Condo Complex is your "Site Collection".  Some of the stuff in the Condo Complex (Common lawn, Patio, Garden, driveway) are shared by everyone in the Condo.  This is similar to "Site Collection" features, Web part galleries that are shared by everyone else. An interesting thing is Security. One of the reasons that you might want to create a "Site Collection" would be for Security reasons. Security is *not* shared among different site collections.  So if you had a different Site Collection for IT and HR, you would have to create separate security configurations for people who need to access both the sites. In a condo this would be like the "key" to the Common front door. Unless you have that common key, you can't get into the building, and you definitely can't get into any other Condo Complex with the same key.
&lt;/p&gt;&lt;h1&gt;Site and Child Sites
&lt;/h1&gt;&lt;p&gt;Your condo is equivalent to the "Site". Only you have access to your house and depending upon how many good friends you have, some of your close friends might have the key to your house! Now within the house, you might have certain rooms that are not accessible by everyone. For example, you might not be able to get into your 14 year old sons/daughters room without his/her permission!
&lt;/p&gt;&lt;h1&gt;Lists and Document Libraries
&lt;/h1&gt;&lt;p&gt;The cabinets or Lockers in the house that only certain people might have access to are the Lists! A good example of a List common to everyone might be the refrigerator.
&lt;/p&gt;&lt;p&gt;Hopefully this helps someone trying to understand these terminologies. An awesome diagram that I have found useful is one by &lt;a href="http://www.shareesblog.com/"&gt;Sharee English&lt;/a&gt; found at &lt;a href="http://images.google.com/imgres?imgurl=http://blog.webdevrocks.com/wp-content/sharepointsitelogicalarchitectur-1.jpg&amp;amp;imgrefurl=http://www.shareesblog.com/%3Fp%3D178&amp;amp;usg=__dtLDL-841F2bpB-A1SUE61PY6gg=&amp;amp;h=677&amp;amp;w=421&amp;amp;sz=55&amp;amp;hl=en&amp;amp;start=7&amp;amp;um=1&amp;amp;tbnid=zpo7GPYNo3Kh_M:&amp;amp;tbnh=139&amp;amp;tbnw=86&amp;amp;prev=/images%3Fq%3Dsharepoint%2Bweb%2Bapplication&amp;hl%3Den&amp;rlz%3D1C1GGLS_enUS322US322&amp;sa%3DG&amp;um%3D1"&gt;here&lt;/a&gt; .  It is an excellent article describing the decision around deciding on web applications, Site Collections, Sites for an enterprise!
&lt;/p&gt;&lt;p&gt;Enjoy!&lt;/p&gt;</description><category>SharePoint</category><comments>http://hariedge.com/2009/05/13/understanding-web-applications-site-collection-and-sites.aspx#Comments</comments><guid isPermaLink="false">70713384-c120-45a5-9a4f-53dfd310a980</guid><pubDate>Wed, 13 May 2009 15:41:39 GMT</pubDate></item><item><title>SalesForce.Com  Part 1 – Finding out what to do? :)</title><link>http://hariedge.com/2009/01/26/salesforcecom--part-1--finding-out-what-to-do-.aspx?ref=rss</link><dc:creator>Hari</dc:creator><description>&lt;p style="text-align: justify"&gt;After hearing a lot of talk about "Cloud Computing" and also about "Sales Force" I decided to look more into SalesForce this weekend. After my brief experience with salesforce.com, though a very interesting and intriguing one, I decided to blog about it in a series of Posts as I am quite positive that I will be playing around with it for the next 2-3 weeks.
&lt;/p&gt;&lt;p style="text-align: justify"&gt;So my first step was to look at &lt;a href="http://www.SalesForce.com"&gt;http://www.SalesForce.com&lt;/a&gt;. And there was a lot of information there and when I mean lots, I literally mean tones and tones of information. So there was cloud computing, Apex, Visual Force, SalesForce CRM, Force.com, AppExchange, Platform as a Service(Paas), Software as a Service (SaaS) and much more…. One thing that I really liked about the website though was the way the contents were organized…
&lt;/p&gt;&lt;p style="text-align: justify"&gt;So being a developer at heart I started with the developer tab and soon realized that I had plenty of good material to start with.  I was able to get my own space for developing, playing around with SalesForce and of course learning, by registering with SalesForce. I downloaded all the materials from the developer Wiki (which you get access to after registration). 
&lt;/p&gt;&lt;p style="text-align: justify"&gt;I realized that I had to first learn more about  the "SalesForce CRM application" before I got into their Cloud Computing or Apex or Visual Force. So I started with the Tutorial from the book "Force.Com_Fundamentals.pdf" that was part of the pdf's I had downloaded. The CRM application is built upon the Force platform.
&lt;/p&gt;&lt;p style="text-align: justify"&gt;Over a period of 1-2 hours, I was able to complete 6 chapters of that book (over 120 pages) and also develop and implement all the features in the book in my own development work space&lt;span style="font-family:Wingdings"&gt;J&lt;/span&gt;. Here are some snapshots of the cool CRM Portal I had built so far for the Human Resources Recruiting Portal. 
&lt;/p&gt;&lt;p style="text-align: justify"&gt;&lt;img src="http://hariedge.com/images/25731-24451/012609_0532_SalesForceC1.png" alt=""/&gt;
	&lt;/p&gt;&lt;p style="text-align: justify"&gt;
 &lt;/p&gt;&lt;p style="text-align: justify"&gt;&lt;img src="http://hariedge.com/images/25731-24451/012609_0532_SalesForceC2.png" alt=""/&gt;
	&lt;/p&gt;&lt;p style="text-align: justify"&gt;&lt;img src="http://hariedge.com/images/25731-24451/012609_0532_SalesForceC3.png" alt=""/&gt;
	&lt;/p&gt;&lt;p style="text-align: justify"&gt;So basically the 6 chapters I went through were 
&lt;/p&gt;&lt;ol&gt;&lt;li&gt;&lt;div style="text-align: justify"&gt;Fundamentals
&lt;/div&gt;&lt;/li&gt;&lt;li&gt;&lt;div style="text-align: justify"&gt;Sample Recruiting Application
&lt;/div&gt;&lt;/li&gt;&lt;li&gt;&lt;div style="text-align: justify"&gt;Reviewing Database Concepts
&lt;/div&gt;&lt;/li&gt;&lt;li&gt;&lt;div style="text-align: justify"&gt;Building a Simple App
&lt;/div&gt;&lt;/li&gt;&lt;li&gt;&lt;div style="text-align: justify"&gt;Enhancing the Simple App with Advanced Fields and Page Layouts
&lt;/div&gt;&lt;/li&gt;&lt;li&gt;&lt;div style="text-align: justify"&gt;Expanding the Simple App using Relationships
&lt;/div&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p style="text-align: justify"&gt;&lt;strong&gt;SharePoint vs Salesforce
&lt;/strong&gt;&lt;/p&gt;&lt;p style="text-align: justify"&gt;Having worked with SharePoint for the last year, I should say that most of the things looked very much like SharePoint. Instead of Sites there were Tabs, Instead of Content Types there were Objects(well sort of as Objects are also Tabs in SalesForce), instead of "Site Columns" there were "Fields" and instead of "List Items" you had "Records"&lt;strong&gt;
		&lt;/strong&gt;&lt;/p&gt;&lt;p style="text-align: justify"&gt;But what impressed me the most about SalesForce.com which I have not found in SharePoint is the ability to have a relational data feature that is very limited in SharePoint. I also liked the fact that you don't have to worry about the deployment to the SharePoint server (custom trust policies, cab file, manifest file..etc etc ). One thing that is difficult to beat is the integration of SharePoint with Word, excel, PowerPoint. Yet to see how SalesForce addresses that. 
&lt;/p&gt;&lt;p&gt;Looking forward to get into more depth on Security, custom code and reports very soon….
&lt;/p&gt;&lt;p&gt;HTH
&lt;/p&gt;&lt;p&gt;Hari 
&lt;/p&gt;</description><category>SalesForce</category><comments>http://hariedge.com/2009/01/26/salesforcecom--part-1--finding-out-what-to-do-.aspx#Comments</comments><guid isPermaLink="false">b65a23db-c73d-4dba-af05-a6a4cd69e14f</guid><pubDate>Mon, 26 Jan 2009 05:31:06 GMT</pubDate></item><item><title>Gacutil location in VS2008</title><link>http://hariedge.com/2008/12/21/gacutil-location-in-vs2008.aspx?ref=rss</link><dc:creator>Hari</dc:creator><description>&lt;p&gt;Microsoft decided to change the location of gacutil when you install vs2008! 
&lt;/p&gt;&lt;p&gt;The new location is : &lt;strong&gt;C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin
&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;I have now added this to the "Path" environment variable so that I can use it from any command prompt..
&lt;/p&gt;&lt;p&gt;HTH
&lt;/p&gt;&lt;p&gt;Hari&lt;/p&gt;</description><category>.Net Learnings</category><comments>http://hariedge.com/2008/12/21/gacutil-location-in-vs2008.aspx#Comments</comments><guid isPermaLink="false">b1ff8a19-d1ba-4969-98eb-88ee68f25256</guid><pubDate>Sun, 21 Dec 2008 07:25:27 GMT</pubDate></item><item><title>Starting computer remotely</title><link>http://hariedge.com/2008/12/19/starting-computer-remotely.aspx?ref=rss</link><dc:creator>Hari</dc:creator><description>&lt;p&gt;To restart a computer remotely you can run the shutdown command. 
&lt;/p&gt;&lt;p&gt;Shutdown  /r /f  /m \\serverName /c "Restarting frozen computer"
&lt;/p&gt;&lt;p&gt;Hari&lt;/p&gt;</description><comments>http://hariedge.com/2008/12/19/starting-computer-remotely.aspx#Comments</comments><guid isPermaLink="false">c2a92949-cda9-43ff-a2a2-d6f4ad2aad15</guid><pubDate>Fri, 19 Dec 2008 15:01:16 GMT</pubDate></item><item><title>Accessing Cache in a SharePoint List Item event Receiver</title><link>http://hariedge.com/2008/12/06/accessing-cache-in-a-sharepoint-list-item-event-receiver.aspx?ref=rss</link><dc:creator>Hari</dc:creator><description>&lt;p&gt;There are times when for performance reasons you might want to store things in the Application cache. The same applies to SharePoint also.
&lt;/p&gt;&lt;p&gt;In our recent project we had to store some configuration information in a SharePoint list that would rarely change. So instead of reading it from the SP list every time we decided to store it in the Cache. This was easy to do as we did it inside a web part.  And since we can hook up to the List modifications through Event Receivers we planned to clear the cache in the event code.
&lt;/p&gt;&lt;p&gt;But what we dint realize was that there was no easy way to get to the application cache &lt;span style="font-family:Wingdings"&gt;L&lt;/span&gt; inside the event receiver code. SPContext is null.
&lt;/p&gt;&lt;p&gt;So what do you do ? After some research I found out that you can access the cache through HttpRuntime.Cache. Also removing a cache value through cache["Key"] will throw an exception. You would have to say cache.Remove("Key")
&lt;/p&gt;&lt;p&gt;
 &lt;/p&gt;&lt;p&gt;HTH
&lt;/p&gt;&lt;p&gt;Hari &lt;/p&gt;</description><category>SharePoint</category><comments>http://hariedge.com/2008/12/06/accessing-cache-in-a-sharepoint-list-item-event-receiver.aspx#Comments</comments><guid isPermaLink="false">ae56bc78-7360-48ff-b47b-5ad81eee9c96</guid><pubDate>Sat, 06 Dec 2008 17:48:21 GMT</pubDate></item><item><title>Configuring MOSS for AJAX  3.5</title><link>http://hariedge.com/2008/11/28/configuring-moss-for-ajax--35.aspx?ref=rss</link><dc:creator>Hari</dc:creator><description>&lt;p&gt;As I was playing around developing and testing the Telerik controls within a MOSS env, I found a nice post explaining how to configure MOSS / SharePoint for AJAX in their web site. Here is the link…
&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.telerik.com/help/aspnet-ajax/moss-install-aspnet-ajax-35.html"&gt;http://www.telerik.com/help/aspnet-ajax/moss-install-aspnet-ajax-35.html&lt;/a&gt;
	&lt;/p&gt;&lt;p&gt;
 &lt;/p&gt;&lt;p&gt;HTH
&lt;/p&gt;&lt;p&gt;Hari &lt;/p&gt;</description><category>SharePoint</category><comments>http://hariedge.com/2008/11/28/configuring-moss-for-ajax--35.aspx#Comments</comments><guid isPermaLink="false">2999c79f-813a-4490-be7b-75be51dc3be3</guid><pubDate>Fri, 28 Nov 2008 20:59:50 GMT</pubDate></item><item><title>Unit Testing in SharePoint</title><link>http://hariedge.com/2008/11/25/unit-testing-in-sharepoint.aspx?ref=rss</link><dc:creator>Hari</dc:creator><description>&lt;p&gt;One of the things that most agile developers hate about SharePoint is the inability to test SharePoint functionality using Unit tests!
&lt;/p&gt;&lt;p&gt;For the most recent projects that involve a lot of custom coding, we have abstracted the functionalities that require interacting with the object model by using the data repository and Gateway Pattern. There does seem to be a new Unit testing framework that has been developed for SharePoint.  And whats more…They are offering it free of cost to the first 50 bloggers who blog about it..&lt;span style="font-family:Wingdings"&gt;J&lt;/span&gt; So here is mine...
&lt;/p&gt;&lt;p&gt;&lt;span style="color:#c0504d; font-size:12pt"&gt;"Typemock are offering their new product for &lt;a href="http://www.typemock.com/sharepointpage.php?utm_source=sp_bb&amp;amp;utm_medium=blog_4sp&amp;amp;utm_campaign=sp_bb"&gt;&lt;span style="text-decoration:underline"&gt;unit testing SharePoint&lt;/span&gt;&lt;/a&gt; called Isolator For SharePoint, for a special introduction price. it is the only tool that allows you to &lt;a href="http://blog.typemock.com/2008/11/newisolatorforsharepointtoolforunittest.html?utm_source=typeblog&amp;amp;utm_medium=sp_bb&amp;amp;utm_campaign=typeblog"&gt;&lt;span style="text-decoration:underline"&gt;unit test SharePoint&lt;/span&gt;&lt;/a&gt; without a SharePoint server. To learn more &lt;a href="http://www.typemock.com/sharepointpage.php?utm_source=sp_bb&amp;amp;utm_medium=blog_4sp&amp;amp;utm_campaign=sp_bb"&gt;&lt;span style="text-decoration:underline"&gt;click here&lt;/span&gt;&lt;/a&gt;. 
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color:#c0504d; font-size:12pt"&gt;&lt;strong&gt;The first 50 bloggers &lt;/strong&gt;who blog this text in their blog and tell us about it, will get a Full Isolator license, Free. for rules and info &lt;a href="http://blog.typemock.com/2008/11/newisolatorforsharepointtoolforunittest.html"&gt;&lt;span style="text-decoration:underline"&gt;click here&lt;/span&gt;&lt;/a&gt;."
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;Good luck!&lt;/p&gt;</description><category>SharePoint</category><comments>http://hariedge.com/2008/11/25/unit-testing-in-sharepoint.aspx#Comments</comments><guid isPermaLink="false">203f081e-2602-4aea-9889-9ace303879b7</guid><pubDate>Tue, 25 Nov 2008 11:23:46 GMT</pubDate></item><item><title>Passed WSS App Dev exam :)</title><link>http://hariedge.com/2008/11/02/passed-wss-app-dev-exam-.aspx?ref=rss</link><dc:creator>Hari</dc:creator><description>&lt;p&gt;So I am officially now a Microsoft certified Technology Specialist in WSS 3.0. The formal title is "MCTS: Microsoft Windows SharePoint Services 3.0 – Application Development"&lt;/p&gt;&lt;p&gt;&lt;b&gt;Resources&lt;/b&gt;&lt;/p&gt;&lt;p&gt;I had used the following 3 resources&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://www.amazon.ca/Microsoft-Windows-SharePoint-Services-Version/dp/0735623201"&gt;Inside WSS 3.0 Book&lt;/a&gt;  : I believe that anyone doing custom WSS development should get this book. Period.&lt;/li&gt;&lt;li&gt;Ricks awesome post of his notes on the book and additional topics:  &lt;a href="http://rickenberg.net/blog/?p=45"&gt;http://rickenberg.net/blog/?p=45&lt;/a&gt;		&lt;/li&gt;&lt;li&gt;Me reading all the questions and answers in our company's Internal SharePoint email list whenever someone popped a question sort of helped(Thank you guys!)&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;I did not use any 3 party exam simulators or brain dumps for the exam. I was sort of forced to take the exam on this day.&lt;/p&gt;&lt;p&gt;&lt;b&gt;Exam&lt;/b&gt;&lt;/p&gt;&lt;p&gt;Got up at 7.30, went to the office around 9.00 and spent my time going over my notes from the &lt;a href="http://www.amazon.ca/Microsoft-Windows-SharePoint-Services-Version/dp/0735623201"&gt;Inside WSS 3.0 Book&lt;/a&gt;  before leaving to take the exam @ 11.30&lt;/p&gt;&lt;p&gt;The exam as such was not very bad. If you had worked with the WSS API and had done some decent development involving the Object Model, Web Part deployment, Solution Deployment to farms and dealt with Custom Security Policies you should be able to pass this exam without much preparation…  There were a lot of questions about Web Parts (Of which I had limited experience as I had always used User Controls and Smart Parts), Security (That was pretty easy) and Features. There were few questions around Custom Security Policies, Timer Jobs…&lt;/p&gt;&lt;p&gt;I was happy to know at the end of the exam that I had passed the exam and that I had scored 800 &lt;/p&gt;&lt;p&gt;&lt;b&gt;Background&lt;br&gt;&lt;/b&gt;I cleared the exam last Sunday. I was actually not planning to take the exam on this day&lt;span style="font-family:Wingdings"&gt;J&lt;/span&gt;. Just 2 weeks back I had postponed the exam as I had not really prepared completely(around 20%). For some reason I had thought it was 3 weeks and at 1.30 a.m on Sunday after enjoying an awesome dinner with my colleague at our house, Just when I climbed into bed I realized that I might have screwed up… And I did… The exam was for 12.30 p.m on the same day…&lt;/p&gt;&lt;p&gt;So I am really happy that I cleared the exam given the scenario under which I took the exam… If I had not forgotten to postpone the exam I highly doubt that I would have given it in the next 2-3 months..!&lt;b&gt;		&lt;/b&gt;&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt; &lt;/p&gt;</description><category>Certifications</category><comments>http://hariedge.com/2008/11/02/passed-wss-app-dev-exam-.aspx#Comments</comments><guid isPermaLink="false">5e8e04c4-340f-488f-9267-cb55c673b73f</guid><pubDate>Mon, 03 Nov 2008 03:11:51 GMT</pubDate></item><item><title>Enterprise Library Wrapper - Making the LOG API more intitutive!</title><link>http://hariedge.com/2008/07/14/enterprise-library-wrapper--making-the-log-api-more-intitutive.aspx?ref=rss</link><dc:creator>Hari</dc:creator><description>&lt;p&gt;For my recent project I had to use the "Enterprise Logging Block" from the Enterprise Library. &lt;br&gt;&lt;br&gt;Having used log4net for all the previous projects, this was something new and it turned out to be&lt;br&gt; an interesting experience..&lt;br&gt;&lt;br&gt;The version I had to use was 3.2. I believe that there is a version 4.0 out right now.&lt;/p&gt;&lt;p&gt;&lt;span style=""&gt;&lt;span&gt;&lt;span style="COLOR: #FF0000;"&gt;&lt;span style="font-size: small;"&gt;Update: If you need to use version 4 , you would have to strong name your assemblies. Version I used were already signed. Here is a link that explains what I am talking about: &lt;/span&gt;&lt;span style=""&gt;&lt;a href="http://blogsprajeesh.blogspot.com/2008/05/strong-naming-enterprise-library.html"&gt;&lt;span style="font-size: small;"&gt;http://blogsprajeesh.blogspot.com/2008/05/strong-naming-enterprise-library.html&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size: small;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br&gt;&lt;br&gt;Anyway one thing I dint like about Enterprise Logger was the way you write Logs..You can use &lt;br&gt;one of the 18 or so overloaded "Write" methods. It is great that Microsoft provided so many &lt;br&gt;overloads but they are not just so intuitive like log4net..As a developer I am mostly going to&lt;br&gt; log errors, warnings, info or debug statements and I loved the fact that you can just call .Info,&lt;br&gt; .Warn methods using log4Net ....&lt;br&gt;&lt;br&gt;To construct a log entry with all required parameters like "User name", "Exception" you &lt;br&gt;had to define extended propertied, Construct a LogEntry object then fill it with properties &lt;br&gt;and then call the Write Method with the LogEntry object...aarg..I am just too lazy to do that &lt;img src="http://hariedge.com/emoticons/smile.png" border="0"&gt;&lt;br&gt;&lt;br&gt;So I wrote a Wrapper Logger class that has methods like Debug, Info, Warn that can be used by&lt;br&gt; developers to log messages...Each of these method then has overloads that take in Category/Exception/Message etc etc ...All these methods then call the Write method &lt;br&gt;of the Microsoft Logger class that take a LogEntry as the parameter...&lt;br&gt;&lt;br&gt;for example Debug method overloads will be ...&lt;/p&gt;
&lt;p style="FONT-SIZE: 9pt; BACKGROUND: white; MARGIN: 0px; COLOR: black; FONT-FAMILY: Courier New"&gt;        &lt;span style="COLOR: blue"&gt;public&lt;/span&gt; &lt;span style="COLOR: blue"&gt;static&lt;/span&gt; &lt;span style="COLOR: blue"&gt;void&lt;/span&gt; Debug(&lt;span style="COLOR: blue"&gt;object&lt;/span&gt; message) &lt;/p&gt;
&lt;p style="FONT-SIZE: 9pt; BACKGROUND: white; MARGIN: 0px; COLOR: black; FONT-FAMILY: Courier New"&gt;        { &lt;/p&gt;
&lt;p style="FONT-SIZE: 9pt; BACKGROUND: white; MARGIN: 0px; COLOR: black; FONT-FAMILY: Courier New"&gt;            WriteMessage(message, &lt;span style="COLOR: #2b91af"&gt;TraceEventType&lt;/span&gt;.Verbose, &lt;span style="COLOR: blue"&gt;null&lt;/span&gt;, &lt;span style="COLOR: blue"&gt;null&lt;/span&gt;); &lt;/p&gt;
&lt;p style="FONT-SIZE: 9pt; BACKGROUND: white; MARGIN: 0px; COLOR: black; FONT-FAMILY: Courier New"&gt;        } &lt;/p&gt;
&lt;p style="FONT-SIZE: 9pt; BACKGROUND: white; MARGIN: 0px; COLOR: black; FONT-FAMILY: Courier New"&gt; &lt;/p&gt;
&lt;p style="FONT-SIZE: 9pt; BACKGROUND: white; MARGIN: 0px; COLOR: black; FONT-FAMILY: Courier New"&gt;        &lt;span style="COLOR: blue"&gt;public&lt;/span&gt; &lt;span style="COLOR: blue"&gt;static&lt;/span&gt; &lt;span style="COLOR: blue"&gt;void&lt;/span&gt; Debug(&lt;span style="COLOR: blue"&gt;object&lt;/span&gt; message, &lt;span style="COLOR: #2b91af"&gt;Category&lt;/span&gt; category) &lt;/p&gt;
&lt;p style="FONT-SIZE: 9pt; BACKGROUND: white; MARGIN: 0px; COLOR: black; FONT-FAMILY: Courier New"&gt;        { &lt;/p&gt;
&lt;p style="FONT-SIZE: 9pt; BACKGROUND: white; MARGIN: 0px; COLOR: black; FONT-FAMILY: Courier New"&gt;            WriteMessage(message, &lt;span style="COLOR: #2b91af"&gt;TraceEventType&lt;/span&gt;.Verbose, category, &lt;span style="COLOR: blue"&gt;null&lt;/span&gt;); &lt;/p&gt;
&lt;p style="FONT-SIZE: 9pt; BACKGROUND: white; MARGIN: 0px; COLOR: black; FONT-FAMILY: Courier New"&gt;        } &lt;/p&gt;
&lt;p style="FONT-SIZE: 9pt; BACKGROUND: white; MARGIN: 0px; COLOR: black; FONT-FAMILY: Courier New"&gt; &lt;/p&gt;
&lt;p style="FONT-SIZE: 9pt; BACKGROUND: white; MARGIN: 0px; COLOR: black; FONT-FAMILY: Courier New"&gt;        &lt;span style="COLOR: blue"&gt;public&lt;/span&gt; &lt;span style="COLOR: blue"&gt;static&lt;/span&gt; &lt;span style="COLOR: blue"&gt;void&lt;/span&gt; Debug(&lt;span style="COLOR: blue"&gt;object&lt;/span&gt; message, &lt;span style="COLOR: blue"&gt;object&lt;/span&gt; category) &lt;/p&gt;
&lt;p style="FONT-SIZE: 9pt; BACKGROUND: white; MARGIN: 0px; COLOR: black; FONT-FAMILY: Courier New"&gt;        { &lt;/p&gt;
&lt;p style="FONT-SIZE: 9pt; BACKGROUND: white; MARGIN: 0px; COLOR: black; FONT-FAMILY: Courier New"&gt;            WriteMessage(message, &lt;span style="COLOR: #2b91af"&gt;TraceEventType&lt;/span&gt;.Verbose, category, &lt;span style="COLOR: blue"&gt;null&lt;/span&gt;); &lt;/p&gt;
&lt;p style="FONT-SIZE: 9pt; BACKGROUND: white; MARGIN: 0px; COLOR: black; FONT-FAMILY: Courier New"&gt;        } &lt;/p&gt;
&lt;p style="FONT-SIZE: 9pt; BACKGROUND: white; MARGIN: 0px; COLOR: black; FONT-FAMILY: Courier New"&gt; &lt;/p&gt;
&lt;p style="FONT-SIZE: 9pt; BACKGROUND: white; MARGIN: 0px; COLOR: black; FONT-FAMILY: Courier New"&gt;        &lt;span style="COLOR: blue"&gt;public&lt;/span&gt; &lt;span style="COLOR: blue"&gt;static&lt;/span&gt; &lt;span style="COLOR: blue"&gt;void&lt;/span&gt; Debug(&lt;span style="COLOR: blue"&gt;object&lt;/span&gt; message, &lt;span style="COLOR: #2b91af"&gt;Exception&lt;/span&gt; ex) &lt;/p&gt;
&lt;p style="FONT-SIZE: 9pt; BACKGROUND: white; MARGIN: 0px; COLOR: black; FONT-FAMILY: Courier New"&gt;        { &lt;/p&gt;
&lt;p style="FONT-SIZE: 9pt; BACKGROUND: white; MARGIN: 0px; COLOR: black; FONT-FAMILY: Courier New"&gt;            WriteMessage(message, &lt;span style="COLOR: #2b91af"&gt;TraceEventType&lt;/span&gt;.Verbose, &lt;span style="COLOR: blue"&gt;null&lt;/span&gt;, ex); &lt;/p&gt;
&lt;p style="FONT-SIZE: 9pt; BACKGROUND: white; MARGIN: 0px; COLOR: black; FONT-FAMILY: Courier New"&gt;        } &lt;/p&gt;
&lt;p style="FONT-SIZE: 9pt; BACKGROUND: white; MARGIN: 0px; COLOR: black; FONT-FAMILY: Courier New"&gt; &lt;/p&gt;
&lt;p style="FONT-SIZE: 9pt; BACKGROUND: white; MARGIN: 0px; COLOR: black; FONT-FAMILY: Courier New"&gt;        &lt;span style="COLOR: blue"&gt;public&lt;/span&gt; &lt;span style="COLOR: blue"&gt;static&lt;/span&gt; &lt;span style="COLOR: blue"&gt;void&lt;/span&gt; Debug(&lt;span style="COLOR: blue"&gt;object&lt;/span&gt; message, &lt;span style="COLOR: blue"&gt;object&lt;/span&gt; category, &lt;span style="COLOR: #2b91af"&gt;Exception&lt;/span&gt; ex) &lt;/p&gt;
&lt;p style="FONT-SIZE: 9pt; BACKGROUND: white; MARGIN: 0px; COLOR: black; FONT-FAMILY: Courier New"&gt;        { &lt;/p&gt;
&lt;p style="FONT-SIZE: 9pt; BACKGROUND: white; MARGIN: 0px; COLOR: black; FONT-FAMILY: Courier New"&gt;            WriteMessage(message, &lt;span style="COLOR: #2b91af"&gt;TraceEventType&lt;/span&gt;.Verbose, category, ex); &lt;/p&gt;
&lt;p style="FONT-SIZE: 9pt; BACKGROUND: white; MARGIN: 0px; COLOR: black; FONT-FAMILY: Courier New"&gt;        } &lt;br&gt;&lt;br&gt;The WriteMessage is given below&lt;br&gt;&lt;br&gt;&lt;/p&gt;
&lt;div style="FONT-SIZE: 9pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: Courier New"&gt;
&lt;p style="MARGIN: 0px"&gt;&lt;span style="COLOR: blue"&gt;private&lt;/span&gt; &lt;span style="COLOR: blue"&gt;static&lt;/span&gt; &lt;span style="COLOR: blue"&gt;void&lt;/span&gt; WriteMessage(&lt;span style="COLOR: blue"&gt;object&lt;/span&gt; message, &lt;span style="COLOR: #2b91af"&gt;TraceEventType&lt;/span&gt; eventType, &lt;br&gt;&lt;span style="COLOR: blue"&gt;object&lt;/span&gt; category, &lt;span style="COLOR: #2b91af"&gt;Exception&lt;/span&gt; exception) &lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;        { &lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;            &lt;span style="COLOR: blue"&gt;try&lt;/span&gt; { &lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;                &lt;span style="COLOR: #2b91af"&gt;LogEntry&lt;/span&gt; entry = &lt;span style="COLOR: blue"&gt;new&lt;/span&gt; &lt;span style="COLOR: #2b91af"&gt;LogEntry&lt;/span&gt;(); &lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;                entry.Severity = eventType; &lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;                &lt;span style="COLOR: green"&gt;//Add Message &lt;/span&gt;&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;                &lt;span style="COLOR: blue"&gt;if&lt;/span&gt; (((message != &lt;span style="COLOR: blue"&gt;null&lt;/span&gt;))) { &lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;                    entry.Message = message.ToString(); &lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;                } &lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;                &lt;span style="COLOR: green"&gt;//Add category &lt;/span&gt;&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;                &lt;span style="COLOR: blue"&gt;if&lt;/span&gt; (((category != &lt;span style="COLOR: blue"&gt;null&lt;/span&gt;))) { &lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;                    entry.Categories.Add(category.ToString()); &lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;                } &lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;                &lt;span style="COLOR: green"&gt;//Add exception, user name, detailed date &amp;amp; time if needed &lt;/span&gt;&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;               &lt;span style="COLOR: #e01a6f"&gt;AddExtendedProperties(entry, exception); &lt;/span&gt;&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;                entry.TimeStamp = &lt;span style="COLOR: #2b91af"&gt;DateTime&lt;/span&gt;.Now; &lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt; &lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;                &lt;span style="COLOR: green"&gt;//Only log the entry if we have a valid user name &lt;/span&gt;&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;                &lt;span style="COLOR: blue"&gt;if&lt;/span&gt; ((IsValidUser(entry))) { &lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;                    &lt;span style="COLOR: blue"&gt;try&lt;/span&gt; { &lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;                        &lt;span style="COLOR: #2b91af"&gt;MicrosoftLogger&lt;/span&gt;.Write(entry);    &lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;                    } &lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;                    &lt;span style="COLOR: blue"&gt;catch&lt;/span&gt; (&lt;span style="COLOR: #2b91af"&gt;Exception&lt;/span&gt; ex) { &lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;                        &lt;span style="COLOR: green"&gt;//Something wrong with the Logger ..make sure we &lt;br&gt;                         //dispose it properly &lt;/span&gt;&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;                        &lt;span style="COLOR: blue"&gt;if&lt;/span&gt; (((&lt;span style="COLOR: #2b91af"&gt;MicrosoftLogger&lt;/span&gt;.Writer != &lt;span style="COLOR: blue"&gt;null&lt;/span&gt;))) { &lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;                            &lt;span style="COLOR: #2b91af"&gt;MicrosoftLogger&lt;/span&gt;.Writer.Dispose(); &lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;                        } &lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;                    }  &lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;                } &lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;            } &lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;            &lt;span style="COLOR: blue"&gt;catch&lt;/span&gt; (&lt;span style="COLOR: #2b91af"&gt;Exception&lt;/span&gt; ex) { &lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;                &lt;span style="COLOR: green"&gt;//Logger exception we dont do anything about it as it will &lt;br&gt;                //lead to recursive call &lt;/span&gt;&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;                &lt;span style="COLOR: green"&gt;//Write to the file system or event log ? &lt;/span&gt;&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;            }  &lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;        } &lt;/p&gt;&lt;/div&gt;
&lt;p style="FONT-SIZE: 9pt; BACKGROUND: white; MARGIN: 0px; COLOR: black; FONT-FAMILY: Courier New"&gt;&lt;!--EndFragment--&gt;&lt;br&gt;One important line is "&lt;span style="COLOR: #e01a6f"&gt;AddExtendedProperties(entry, exception); &lt;/span&gt;which does &lt;br&gt;the following &lt;br&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Constructs the User name (first tries to get it from HttpContext, if not gets &lt;br&gt;it from the Thread)and writes it as an extended property&lt;/li&gt;
&lt;li&gt;Constructs the Exception details (inner exception also) and writes it as an Extended Property&lt;/li&gt;
&lt;li&gt;Constructs the detailed Date and Time(in format &lt;span style="COLOR: #a31515"&gt;yyyy-MM-dd hh:mm:ss.fff&lt;/span&gt;) and &lt;br&gt;writes it as an extended property&lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;I have included the code for this class where you can go over and see how these are &lt;br&gt;exactly constructed...&lt;br&gt;&lt;/p&gt;
&lt;p style="FONT-SIZE: 9pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: Courier New"&gt;&lt;!--EndFragment--&gt;&lt;b&gt;Using the Logger - Sample Project:&lt;/b&gt;&lt;br&gt;The Logger file is included within the "HariEdge.Util.Logging" project. To use the&lt;br&gt;Logger class you just need to add the "HariEdge.Util.Logging" dll to your project &lt;br&gt;(This will also copy the required Enterprise dlls (3 of them) along with the &lt;br&gt;logging dll to the bin directory of your project) &lt;br&gt;&lt;br&gt;Then to use the Logger, you would just call the corresponding Info, Warn or Debug messages...&lt;br&gt;&lt;/p&gt;
&lt;div style="FONT-SIZE: 9pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: Courier New"&gt;
&lt;p style="MARGIN: 0px"&gt;        &lt;span style="COLOR: #2b91af"&gt;Logger&lt;/span&gt;.Info(&lt;span style="COLOR: #a31515"&gt;"Test Message 1"&lt;/span&gt;, &lt;span style="COLOR: #a31515"&gt;"Custom Category"&lt;/span&gt;);&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;        &lt;span style="COLOR: #2b91af"&gt;Logger&lt;/span&gt;.Warn(&lt;span style="COLOR: #a31515"&gt;"Test Message 2"&lt;/span&gt;, &lt;span style="COLOR: #2b91af"&gt;Category&lt;/span&gt;.UI);&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;        &lt;span style="COLOR: #2b91af"&gt;Logger&lt;/span&gt;.Critical(&lt;span style="COLOR: #a31515"&gt;"Test Message 3"&lt;/span&gt;, &lt;span style="COLOR: #2b91af"&gt;Category&lt;/span&gt;.WebServices);&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;        &lt;span style="COLOR: #2b91af"&gt;Logger&lt;/span&gt;.Info(&lt;span style="COLOR: #a31515"&gt;"Test Message 4"&lt;/span&gt;);&lt;br&gt;&lt;br&gt;&lt;br&gt;There are two Sample Applications included with the source file "Test.ConsoleApp"&lt;br&gt;and "Test.WebSite" that has the required configuration you would need to add &lt;br&gt;to the App.config or web.config file. &lt;br&gt;&lt;br&gt;As you can see there are also some predefined categories that you can use &lt;br&gt;like &lt;span style="COLOR: #2b91af"&gt;Category&lt;/span&gt;.UI,  &lt;span style="COLOR: #2b91af"&gt;Category&lt;/span&gt;.WebServices that you can use as the Category or &lt;br&gt;you can just pass in a custom category as a String. &lt;br&gt;&lt;br&gt;&lt;br&gt;If you have used Enterprise logging before, you do already know that one &lt;br&gt;cool concept of using categories is to have a custom filter on the Severity of &lt;br&gt;the Error (Info, Warn etc)  and also specify a separate file for the category!!&lt;br&gt;&lt;br&gt;&lt;br&gt;Logs only Errors, Warnings and Info when switchValue is set to "Info"&lt;br&gt;&lt;/p&gt;
&lt;div style="FONT-SIZE: 9pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: Courier New"&gt;
&lt;p style="MARGIN: 0px"&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;!--&lt;/span&gt;&lt;span style="COLOR: green"&gt; Configure for Web Services category Source&lt;/span&gt;&lt;span style="COLOR: blue"&gt;--&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;&lt;span style="COLOR: blue"&gt;      &amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;add&lt;/span&gt;&lt;span style="COLOR: blue"&gt; &lt;/span&gt;&lt;span style="COLOR: red"&gt;switchValue&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;"&lt;font color="#0000ff"&gt;Info&lt;/font&gt;"&lt;span style="COLOR: blue"&gt; &lt;/span&gt;&lt;span style="COLOR: red"&gt;name&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;"&lt;span style="COLOR: blue"&gt;WebServices&lt;/span&gt;"&lt;span style="COLOR: blue"&gt;&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;&lt;span style="COLOR: blue"&gt;        &amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;listeners&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;&lt;span style="COLOR: blue"&gt;          &amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;add&lt;/span&gt;&lt;span style="COLOR: blue"&gt; &lt;/span&gt;&lt;span style="COLOR: red"&gt;name&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;"&lt;span style="COLOR: blue"&gt;WebServices category Rolling Flat File Trace Listener&lt;/span&gt;"&lt;span style="COLOR: blue"&gt;/&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;&lt;span style="COLOR: blue"&gt;        &amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;listeners&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;&lt;span style="COLOR: blue"&gt;      &amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;add&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&gt;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;
&lt;p style="MARGIN: 0px"&gt;&lt;!--EndFragment--&gt;&lt;br&gt;&lt;br&gt;&lt;/p&gt;
&lt;div style="FONT-SIZE: 9pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: Courier New"&gt;
&lt;p style="MARGIN: 0px"&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;add&lt;/span&gt;&lt;span style="COLOR: blue"&gt; &lt;/span&gt;&lt;span style="COLOR: red"&gt;fileName&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;"&lt;span style="COLOR: blue"&gt;C:\Logs2\Application_WebServices_Category.log&lt;/span&gt;"&lt;span style="COLOR: blue"&gt; &lt;br&gt;&lt;/span&gt;&lt;span style="COLOR: red"&gt;rollSizeKB&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;"&lt;span style="COLOR: blue"&gt;1024&lt;/span&gt;"&lt;span style="COLOR: blue"&gt; &lt;/span&gt;&lt;span style="COLOR: red"&gt;timeStampPattern&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;"&lt;span style="COLOR: blue"&gt;yyyy-MM-dd&lt;/span&gt;"&lt;span style="COLOR: blue"&gt; &lt;br&gt;&lt;/span&gt;&lt;span style="COLOR: red"&gt;rollFileExistsBehavior&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;"&lt;span style="COLOR: blue"&gt;Increment&lt;/span&gt;"&lt;span style="COLOR: blue"&gt; &lt;br&gt;&lt;/span&gt;&lt;span style="COLOR: red"&gt;rollInterval&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;"&lt;span style="COLOR: blue"&gt;Day&lt;/span&gt;"&lt;span style="COLOR: blue"&gt; &lt;/span&gt;&lt;span style="COLOR: red"&gt;formatter&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;"&lt;span style="COLOR: blue"&gt;Text Formatter&lt;/span&gt;"&lt;span style="COLOR: blue"&gt; &lt;/span&gt;&lt;span style="COLOR: red"&gt;header&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;""&lt;span style="COLOR: blue"&gt; &lt;/span&gt;&lt;span style="COLOR: red"&gt;footer&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;""&lt;span style="COLOR: blue"&gt; &lt;/span&gt;&lt;span style="COLOR: red"&gt;listenerDataType&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;"&lt;span style="COLOR: blue"&gt;Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.&lt;br&gt;RollingFlatFileTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging,&lt;br&gt; Version=3.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a&lt;/span&gt;"&lt;span style="COLOR: blue"&gt; &lt;br&gt;&lt;/span&gt;&lt;span style="COLOR: red"&gt;traceOutputOptions&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;"&lt;span style="COLOR: blue"&gt;Timestamp&lt;/span&gt;"&lt;span style="COLOR: blue"&gt; &lt;br&gt;&lt;/span&gt;&lt;span style="COLOR: red"&gt;type&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;"&lt;span style="COLOR: blue"&gt;Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.&lt;br&gt;RollingFlatFileTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging,&lt;br&gt;Version=3.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a&lt;/span&gt;"&lt;span style="COLOR: blue"&gt; &lt;br&gt;&lt;/span&gt;&lt;span style="COLOR: red"&gt;name&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;"&lt;span style="COLOR: blue"&gt;WebServices category Rolling Flat File Trace Listener&lt;/span&gt;"&lt;span style="COLOR: blue"&gt;/&gt;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;!--EndFragment--&gt;
&lt;p style="MARGIN: 0px"&gt;&lt;br&gt;&lt;br&gt;&lt;b&gt;SharePoint Users&lt;br&gt;&lt;/b&gt;One of the things that would bite you when trying to use this in &lt;br&gt;SharePoint is Security!!!!! If your logging dll is in GAC or if the application is &lt;br&gt;running under "Full Trust"  you wont see any issue..If it is not as stated &lt;br&gt;above(most shared environments run under WSS-Medium)not you would most probably&lt;br&gt; see an "Unexpected error" or "a beautiful stack trace quoting some &lt;br&gt;security permission error" if you have custom errors turned off. &lt;br&gt;&lt;br&gt;So to take care of this you would need a custom Security Policy file that gives your &lt;br&gt;logging dll full trust. So one thing you would need to do is find out what the Trust &lt;br&gt;level is , find out where the trust file is located and then do the following &lt;br&gt;&lt;br&gt;If you change for "&lt;b&gt;trust"&lt;/b&gt; in web.config you  will see an element like this&lt;br&gt;&lt;b&gt;&amp;lt;trust level="WSS_Medium" originUrl="" /&gt;&lt;/b&gt;&lt;br&gt;&lt;br&gt;Then if you search for the value in trust (WSS_Medium in our case) you &lt;br&gt;will see where the policy file is located as shown below&lt;br&gt;&lt;br&gt;&lt;b&gt;&amp;lt;trustLevel name="WSS_Medium" &lt;br&gt;policyFile="C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\CONFIG\wss_mediumtrust_custom.config" /&gt;&lt;/b&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;Insert the CodeGroup element given below in the custom trust file. The CodeGroup &lt;br&gt;elements should be placed under the following CodeGroup element in the Configuration file:&lt;br&gt;&amp;lt;CodeGroup class="FirstMatchCodeGroup"  version="1" PermissionSetName="Nothing"&gt;&lt;br&gt;&lt;br&gt;&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;&lt;b&gt; &amp;lt;CodeGroup class="UnionCodeGroup" version="1" PermissionSetName="FullTrust"&gt;&lt;br&gt; &amp;lt;IMembershipCondition version="1" &lt;br&gt;Name="HariEdge.Util.Logging" class="UrlMembershipCondition" Url="$AppDirUrl$/bin/HariEdge.Util.Logging.dll" /&gt;&lt;br&gt;&amp;lt;/CodeGroup&gt;&lt;br&gt;&lt;br&gt;&lt;/b&gt;&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;&lt;br&gt;Hopefully this helps someone....&lt;br&gt;&lt;br&gt;Source Files: &lt;a href="http://hariedge.com/files/25731-24451/HariEdge_Util_Logging.zip"&gt;Logging Source File &lt;/a&gt;&lt;br&gt;&lt;br&gt;Hari &lt;br&gt;&lt;br&gt;&lt;/p&gt;&lt;/div&gt;&lt;!--EndFragment--&gt;</description><category>.Net Learnings</category><comments>http://hariedge.com/2008/07/14/enterprise-library-wrapper--making-the-log-api-more-intitutive.aspx#Comments</comments><guid isPermaLink="false">ae34a9a6-2863-42da-81b0-2f979be7c011</guid><pubDate>Mon, 14 Jul 2008 17:16:00 GMT</pubDate></item><item><title>Item has already been added Exception ......</title><link>http://hariedge.com/2008/04/25/item-has-already-been-added-exception-.aspx?ref=rss</link><dc:creator>Hari</dc:creator><description>&lt;P&gt;Hi&lt;BR&gt;&lt;BR&gt;I was working happily with some web services... getting data from the web services binding them to grids and all that cool stuff... when I get this exception....&lt;BR&gt;&lt;BR&gt;&lt;od&gt;"&lt;BR&gt;&amp;nbsp; -----------------------&amp;nbsp; Inner Exception Details&amp;nbsp;&lt;BR&gt;&amp;nbsp;Message: Item has already been added. Key in dictionary: 'Java:com.some name.model:BaseModel'&amp;nbsp; Key being added: 'Java:com.some name.model:BaseModel'&lt;BR&gt;&amp;nbsp;Stack Trace:&amp;nbsp;&amp;nbsp;&amp;nbsp; at System.Collections.Hashtable.Insert(Object key, Object nvalue, Boolean add)&lt;BR&gt;&amp;nbsp;&amp;nbsp; at System.Collections.Hashtable.Add(Object key, Object value)&lt;BR&gt;&amp;nbsp;&amp;nbsp; at System.Xml.Serialization.XmlSerializationReader.AddReadCallback(String name, String ns, Type type, XmlSerializationReadCallback read)&lt;/od&gt;&lt;FONT face="Courier New"&gt;&lt;BR&gt;"&lt;BR&gt;&lt;/FONT&gt;&lt;BR&gt;Now I had solved it before but being confident on my memory powers refused to blog it..Goggling dint help either and after 5 minutes I realized what I had done to fix this..So in case I don't forget it and also to help people out there I am blogging it &lt;IMG src="http://hariedge.com/emoticons/smile.png" border=0&gt; enough said.. the solution is quite simple...&lt;BR&gt;&lt;BR&gt;&lt;STRONG&gt;You need to turn off Autogeneration of Serialization assemblies in Compile Options in Visual Studio... &lt;/STRONG&gt;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;&lt;STRONG&gt;Go To Project (Right Click) --&amp;gt; Properties&amp;nbsp; &lt;/STRONG&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;STRONG&gt;Choose Compile tab on left&lt;/STRONG&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;STRONG&gt;Choose Advanced Compile options by clicking the button &lt;/STRONG&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;STRONG&gt;If "Generate Serialization assemblies" is set to "Auto" turn it to "Off". If it does not have "Auto" then I am sorry &lt;IMG src="http://hariedge.com/emoticons/sad.png" border=0&gt;&lt;/STRONG&gt;&lt;/LI&gt;&lt;/OL&gt;
&lt;P&gt;try running your app/site now and see if it solves the problemmm....&lt;BR&gt;&lt;BR&gt;I remember reading that AutoGeneration of Serialization assemblies might help in optimizing some serialization/Deserialization but yet to see some substantial proof for the same...&lt;BR&gt;&lt;BR&gt;So I am going to go with the "Off"option for now.... &lt;BR&gt;&lt;BR&gt;HTH&lt;BR&gt;Hari&lt;/P&gt;</description><category>.Net Learnings</category><comments>http://hariedge.com/2008/04/25/item-has-already-been-added-exception-.aspx#Comments</comments><guid isPermaLink="false">22aea9f8-575e-4f7b-ac6c-4b1cb12fa6bb</guid><pubDate>Fri, 25 Apr 2008 22:02:00 GMT</pubDate></item><item><title>Revisiting design pattern Heroes</title><link>http://hariedge.com/2008/02/22/revisiting-design-pattern-heroes.aspx?ref=rss</link><dc:creator>Hari</dc:creator><description>&lt;P&gt;Design Patterns&lt;BR&gt;Long time back (almost 2 years back) I started&amp;nbsp;a &lt;A href="http://hariedge.com/2006/06/17/a-design-pattern-a-week-keeps-bad-software-away--series.aspx" target=_blank&gt;Blog&lt;/A&gt;&amp;nbsp;about going through all the design Patterns. I started off with the “&lt;A href="http://hariedge.com/2006/06/26/meet-our-first-design-pattern-super-hero--mr-strategy.aspx"&gt;Strategy Pattern&lt;/A&gt;” and for some reason (ok Laziness) I was not able to continue that train of thought …&lt;/P&gt;
&lt;P&gt;Inspired by reading martins Book(&lt;A href="http://www.amazon.com/Principles-Patterns-Practices-Robert-Martin/dp/0131857258" target=_blank&gt;Agile Principles, Patterns, and Practices in C#&lt;/A&gt;), I am planning to go over the design patterns. I would follow the order as discussed in martins book.&amp;nbsp; The patterns are &lt;BR&gt;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Command&lt;/LI&gt;
&lt;LI&gt;Active Object&lt;/LI&gt;
&lt;LI&gt;Template Method&lt;/LI&gt;
&lt;LI&gt;Strategy&lt;/LI&gt;
&lt;LI&gt;Facade&lt;/LI&gt;
&lt;LI&gt;Mediator&lt;/LI&gt;
&lt;LI&gt;Singleton&lt;/LI&gt;
&lt;LI&gt;Monostate&lt;/LI&gt;
&lt;LI&gt;Null Object&lt;/LI&gt;
&lt;LI&gt;Factory&lt;/LI&gt;
&lt;LI&gt;Composite&lt;/LI&gt;
&lt;LI&gt;Observer&lt;/LI&gt;
&lt;LI&gt;Abstract Server&lt;/LI&gt;
&lt;LI&gt;Adapter&lt;/LI&gt;
&lt;LI&gt;Bridge&lt;/LI&gt;
&lt;LI&gt;Proxy&lt;/LI&gt;
&lt;LI&gt;Gateway&lt;/LI&gt;
&lt;LI&gt;Visitor&lt;/LI&gt;
&lt;LI&gt;State&lt;/LI&gt;&lt;/OL&gt;
&lt;P&gt;Having collected several materials on Design patterns, I have decided to refer to the following books and resources when blogging about a Design pattern. So here are the resources (apart from Martin’s book)&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;&lt;A href="http://www.oreilly.com/catalog/hfdesignpat/"&gt;Head First Design Patterns&lt;/A&gt;&lt;BR&gt;The Best book out there for learning Patterns. Period.&lt;BR&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://www.amazon.com/Refactoring-Patterns-Addison-Wesley-Signature-Kerievsky/dp/0321213351"&gt;Refactoring to Patterns&lt;/A&gt;&lt;BR&gt;One of the reasons to motivate you to start refactoring your code.&lt;BR&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="/Dofactory.com"&gt;Dofactory.com&lt;/A&gt;&lt;BR&gt;The best quick reference for design patterns.&lt;BR&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://www.amazon.com/Design-Patterns-Object-Oriented-Addison-Wesley-Professional/dp/0201633612"&gt;Design Patterns: Elements of Reusable Object-Oriented Software&lt;/A&gt;&lt;BR&gt;The “father”&lt;IMG src="http://hariedge.com/emoticons/smile.png" border=0&gt; &amp;nbsp;of all design pattern books.&lt;/LI&gt;&lt;/OL&gt;
&lt;P&gt;Thanks&lt;BR&gt;Hari &lt;/P&gt;</description><category>Patterns</category><comments>http://hariedge.com/2008/02/22/revisiting-design-pattern-heroes.aspx#Comments</comments><guid isPermaLink="false">e9bcb3b7-cd4d-41b4-bd84-043bc8b19ebd</guid><pubDate>Fri, 22 Feb 2008 18:51:00 GMT</pubDate></item><item><title>OO Principles - Rest of the Gang</title><link>http://hariedge.com/2008/02/22/oo-principles--rest-of-the-gang.aspx?ref=rss</link><dc:creator>Hari</dc:creator><description>&lt;P&gt;I finally had time to go over the other Object Oriented Principles. Lack of time (and some laziness) is preventing me from posting an example and discussing each one of them in detail. So I am going to stop with the definitions and add some comments. Before I get into the principles one line that particuary caught my attention in Martins book was &lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;“An Axis of change is an axis of change only if the changes occur”. &lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;Martin warns us against applying any of the principles if the symptom does not exist.&amp;nbsp; One thing that might help us define these symptoms early are Unit tests. Here are the principles&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;&lt;STRONG&gt;The Open/Closed Principle: &lt;/STRONG&gt;&lt;EM&gt;A Software Entity (mostly class) should be open for extension but closed for modification.&lt;BR&gt;&lt;/EM&gt;&lt;BR&gt;My favorite principle! Closed to Modification indicates that we would not change the source code and thus not cause the application depending on the code(in a dll in .NET) to be recompiled. Using &lt;BR&gt;abstraction (base class) we would allow the class to be extended by defining new classes(derived &lt;BR&gt;from old class) that would define new behavior!&lt;BR&gt;&lt;BR&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;STRONG&gt;Liskov Substitution Principle:&lt;/STRONG&gt; &lt;EM&gt;Subtypes must be substitutable for their base types.&lt;BR&gt;&lt;/EM&gt;&lt;BR&gt;The most important thing to remember is not to blindly follow the “IS-A” rule of inheritance. As martin explains, A Square is a Rectangle might look like it is a perfect match for the “IS-A” relationship, but Passing a Square(height = 5, width = 5) to a method that accepts Rectangle and changing width(to 6 for example) would result in a Square with unequal sides breaking the assumption that Squares have same height and width leading to unexpected errors.&lt;BR&gt;&lt;BR&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;STRONG&gt;Dependency Inversion Principle:&lt;/STRONG&gt; &lt;EM&gt;High Level modules should not depend on low level modules. Both should depend on abstractions. Abstractions should not depend upon details. Details should depend on abstractions. &lt;BR&gt;&lt;/EM&gt;&lt;BR&gt;This principle pretty much violates what I was doing fresh out of school J . In a way as martin describes, violating this principle would lead your program to be more rigid and also make your program look like traditional procedural programming and I am sure we don’t want that to happen for a lot of reasons!&lt;BR&gt;&lt;BR&gt;&lt;BR&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;STRONG&gt;Interface Aggregation Principle: &lt;/STRONG&gt;&lt;EM&gt;Clients should not be forced to depend on methods they do not use.&lt;BR&gt;&lt;/EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR&gt;Without unit tests, with a big development team and new features, violating this principle can lead&amp;nbsp;to a lot of problems. Most of the time you land up with “dead code” in your project that is not used by&amp;nbsp;the classes containing it and exists for confusing developers! &lt;/LI&gt;&lt;/OL&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;The most preferred approach of implementing this principle in the case where there is a Fat interface is&amp;nbsp;to split&amp;nbsp;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;it up to small interfaces and have the client implement all the small interfaces.&lt;/P&gt;
&lt;P&gt;HTH &lt;BR&gt;Hari&amp;nbsp; &lt;BR&gt;&lt;/P&gt;</description><category>Patterns</category><comments>http://hariedge.com/2008/02/22/oo-principles--rest-of-the-gang.aspx#Comments</comments><guid isPermaLink="false">6ea2a537-ab55-424c-8e50-b59362f6cad4</guid><pubDate>Fri, 22 Feb 2008 18:21:00 GMT</pubDate></item><item><title>Passed Application Development Foundation Exam :)</title><link>http://hariedge.com/2008/01/05/passed-application-development-foundation-exam-.aspx?ref=rss</link><dc:creator>Hari</dc:creator><description>&lt;BR&gt;&lt;BR&gt;I finally managed to pass the&amp;nbsp; &lt;A href="http://www.microsoft.com/learning/exams/70-536.mspx" target=_blank&gt;TS: Microsoft .NET Framework 2.0—Application Development Foundation&lt;/A&gt;development Exam" today.. I was able to score &lt;STRONG&gt;876&lt;/STRONG&gt;..The passing score is 700..&lt;BR&gt;&lt;BR&gt;Here is my experience ..&lt;BR&gt;&lt;BR&gt;&lt;STRONG&gt;The Exam&lt;/STRONG&gt;&lt;BR&gt;The exam was tougher (and better) than the previous Microsoft exams&amp;nbsp;I had taken.. Microsoft has really done a good job revamping the certifications.. I was not surprised to see that I had not scored high in the sections relating to Interoperability(aargh...COM ) and Reflection both of which I never had used in my development so far &lt;BR&gt;&lt;BR&gt;I had a LOT of questions regarding Security, Serialization and Internationalization.. no Regular Expression questions &lt;IMG src="http://hariedge.com/emoticons/smile.png" border=0&gt;&amp;nbsp;.. 2 -3 questions regarding Services, 3-4 on COM &lt;IMG src="http://hariedge.com/emoticons/sad.png" border=0&gt; , 4-5 questions on IO, 4-5 questions on Debugging and Management features, 2-3 on App Domains and Reflection..&lt;BR&gt;&lt;BR&gt;I had&amp;nbsp;to answer 45 questions in 120 minutes..I went through all the 45 questions within the first 10 minutes to get an idea of what to expect ... Then I started answering the questions sequentially marking questions that I was not sure of for later review .. &lt;BR&gt;&lt;BR&gt;I was able to complete all the questions in 40 minutes.. and spent the next 30 minutes reviewing the marked questions .. After that I spent 10 minutes going through all the questions and finished 20 mins ahead of time ...&lt;BR&gt;&lt;BR&gt;&lt;BR&gt;So here are the resources I had used for the exam&lt;BR&gt;&lt;BR&gt;&lt;STRONG&gt;Books&lt;BR&gt;&lt;/STRONG&gt;
&lt;OL&gt;
&lt;LI&gt;&amp;nbsp;&lt;A href="http://www.amazon.com/MCTS-Self-Paced-Training-Exam-70-536/dp/0735622779/ref=pd_bbs_sr_1?ie=UTF8&amp;amp;s=books&amp;amp;qid=1199569685&amp;amp;sr=8-1"&gt;MCTS Self-Paced Training Kit (Exam 70-536): Microsoft .NET Framework 2.0 Application Development Foundation&lt;/A&gt;&lt;BR&gt;&lt;BR&gt;This is the only one book that is available as an Exam Guide for this Exam. Unfortunately it has a lot of errors and typos (there are around 2 pages of errata! for this book).&amp;nbsp;&lt;BR&gt;&lt;BR&gt;Nevertheless it is the only book available and helps you in getting an idea of what to expect for the exam. It also has a practice test (around 300 questions) , and a learning plan (with links to MSDN) which are pretty helpful. I was lazy in trying to take the exam questions only one day before the exam and ended up not taking all the questions! &lt;BR&gt;&lt;BR&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://www.amazon.com/Practical-Net2-Platform-Language-Framework/dp/0976613220" target=_blank&gt;Practical .NET2 and C#2&lt;/A&gt;&lt;BR&gt;This is one of my favorite book on C# and is an excellent book especially for C++ programmers transitioning to C#(lots of comparisons made between C++ and C#). Even though the book says that the user level is Introductory, most of the stuff discussed are advanced stuff.&lt;BR&gt;&lt;BR&gt;The book covers around &lt;STRONG&gt;70%&lt;/STRONG&gt; of the objectives required by the exam and is a good read for any professional developer interested in knowing more about .NET and C#&lt;/LI&gt;&lt;/OL&gt;
&lt;P&gt;&lt;STRONG&gt;Internet&lt;/STRONG&gt;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;&lt;STRONG&gt;MSDN&lt;/STRONG&gt;&lt;BR&gt;This is the BEST resource you will find for the exam. I ended up spending most of my preparation time in looking at information from MSDN. Especially most of the weird classes that I had never used in my entire .net development lifetime like&amp;nbsp; IAppicationManagerTrustInterface, AuthorizationRule, SACL ..you get the idea..&lt;BR&gt;&lt;BR&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;STRONG&gt;Wikis&lt;BR&gt;&lt;/STRONG&gt;I did stumble across&amp;nbsp;an incomplete wikis for the exam ..Even though&amp;nbsp;it was&amp;nbsp;incomplete, most of the sections had links to MSDN and served as a pretty good Section-MSDN lookup &lt;IMG src="http://hariedge.com/emoticons/smile.png" border=0&gt;&lt;BR&gt;&lt;A href="http://en.wikibooks.org/wiki/.NET_Development_Foundation"&gt;Wiki 1&lt;/A&gt;&amp;nbsp;&lt;BR&gt;&lt;/LI&gt;&lt;/OL&gt;
&lt;P&gt;&lt;STRONG&gt;Exam Simulators&lt;/STRONG&gt;&lt;BR&gt;I had used the Transcender Exam simulator (very sparsely..last 2 days). I went through the 150 questions in Transcender and scored almost 85%. I found the questions far more easier than the exams I encountered on the test. I would not suggest spending amount on the exam Simulator. You are better off referring to MSDN.&lt;BR&gt;&lt;BR&gt;For those of you looking at TestKing beware! I have read that it is just a collection of Brain Dump questions and I personally consider using it as Cheating! I think that Microsoft has a case against them..&lt;BR&gt;&lt;BR&gt;&lt;BR&gt;If you want to get an idea of what certifications are available and if it is worth taking the certifications have a look at my previous bog entry(almost 1.5 years old!!)&amp;nbsp;at &lt;A href="http://hariedge.com/2006/06/16/net-certification.aspx"&gt;http://hariedge.com/2006/06/16/net-certification.aspx&lt;/A&gt;&amp;nbsp;.... &lt;BR&gt;&lt;BR&gt;&lt;STRONG&gt;More Exams&lt;BR&gt;&lt;/STRONG&gt;&lt;BR&gt;So i am aiming for the &lt;A href="http://www.microsoft.com/learning/mcp/mcpd/entapp/default.mspx"&gt;MCPD: Enterprise Applications Developer&lt;/A&gt;&amp;nbsp;certification and this requires you to pass 5 exams. So 4 more to go. I will be taking them in the following order&lt;BR&gt;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;&lt;A href="http://www.microsoft.com/learning/mcp/mcts/webapps/default.mspx" target=_blank&gt;MCTS: .NET Framework 2.0 Web Applications&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://www.microsoft.com/learning/mcp/mcts/distapps/default.mspx" target=_blank&gt;MCTS: .NET Framework 2.0 Distributed Applications&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://www.microsoft.com/learning/mcp/mcts/winapps/default.mspx" target=_blank&gt;MCTS: .NET Framework 2.0 Windows Applications&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://www.microsoft.com/learning/exams/70-549.mspx"&gt;Designing and Developing Enterprise Applications by Using the Microsoft .NET Framework&lt;/A&gt;&lt;/LI&gt;&lt;/OL&gt;
&lt;P&gt;So its ASP.NET next !!&lt;BR&gt;&lt;BR&gt;Good luck everyone..&lt;BR&gt;&lt;BR&gt;Hari &lt;/P&gt;</description><category>Certifications</category><comments>http://hariedge.com/2008/01/05/passed-application-development-foundation-exam-.aspx#Comments</comments><guid isPermaLink="false">143945f5-acb1-48d0-8070-bb14bc82e6b4</guid><pubDate>Sat, 05 Jan 2008 21:15:00 GMT</pubDate></item><item><title>OO Principles - Single Responsibility Principle (SRP)</title><link>http://hariedge.com/2007/12/28/oo-principles--single-responsibility-principle-srp.aspx?ref=rss</link><dc:creator>Hari</dc:creator><description>I have recently started reading "Agile, Principles, Patterns and Practices in C#" by Robert Martin. It is an excellent book that speaks about the basics of OOAD, Patterns and using them in C#. &lt;BR&gt;&lt;BR&gt;One of the things that I remember reading long time back are the&amp;nbsp;5 main principles of OOAD. They were&lt;BR&gt;&lt;BR&gt;
&lt;OL&gt;
&lt;LI&gt;Single Responsibility principle (SRP)&lt;/LI&gt;
&lt;LI&gt;Open/Closed Principle&amp;nbsp; (OCP)&lt;/LI&gt;
&lt;LI&gt;Liskov Substitution Principle (LSP)&lt;/LI&gt;
&lt;LI&gt;Dependency Inversion Principle (DIP)&lt;/LI&gt;
&lt;LI&gt;Interface Segregation Principle (ISP)&lt;/LI&gt;&lt;/OL&gt;
&lt;P&gt;Any good object oriented programmer SHOULD know about these principles. Lets look at the SRP in this entry&lt;BR&gt;&lt;BR&gt;The SRP is defined as follows:&lt;BR&gt;&amp;nbsp;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;A class should have only one reason to change.&lt;BR&gt;&lt;/STRONG&gt;&lt;BR&gt;As simple as this sounds, over the time of development a class becomes blown up and becomes responsible for more than one functionality or the original purpose it was designed for. &lt;BR&gt;&lt;BR&gt;Robert defines a Responsibility to be a &lt;STRONG&gt;reason for change&lt;/STRONG&gt;.&lt;BR&gt;&lt;BR&gt;&lt;BR&gt;He gives 2-3 examples in the book that violates this principle and then a way to fix them. My favorite was the good old Rectangle example where a Rectangle class is defined as follows &lt;BR&gt;&lt;BR&gt;&lt;FONT face="Courier New"&gt;Rectangle&lt;BR&gt;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Draw()&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Area()&lt;BR&gt;}&lt;/FONT&gt;&lt;BR&gt;&lt;BR&gt;Imagine a case where this class(in Shapes.dll)&amp;nbsp;is used by two applications. One application(A.exe) just needs the Area value while the other&amp;nbsp;application(B.exe) needs both the Draw and Area methods. &lt;BR&gt;&lt;BR&gt;In .NET terms, this would be two exe using the same "Shape" dll.&amp;nbsp; Now if changes are made to to the Rectangle class because of changes required by B.exe in the draw method, this would require us to recompile, rebuild, retest the A.exe application. &lt;BR&gt;&lt;BR&gt;A better idea as Robin suggests would be to separate the rectangle class into two classes as given below&lt;BR&gt;&lt;BR&gt;&lt;FONT face="Courier New"&gt;&lt;BR&gt;&lt;BR&gt;GeometryRectangle&lt;BR&gt;{&lt;STRIKE&gt;&lt;BR&gt;&lt;/STRIKE&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Area()&lt;BR&gt;}&lt;BR&gt;&lt;BR&gt;Rectangle: GeometryRectangle&lt;BR&gt;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Draw()&lt;BR&gt;}&lt;BR&gt;&lt;BR&gt;And of course these have to be in different dlls. So lets say that GeometricRectangle is in a dll called GeometricShapes.dll and Rectangle is in Shapes.dll then the depndency becomes&amp;nbsp;&lt;BR&gt;&lt;BR&gt;A --&amp;gt; GeometricShapes.Shape.dll&amp;nbsp;&lt;BR&gt;&lt;BR&gt;B --&amp;gt; Shapes.dl&lt;BR&gt;&amp;nbsp; --&amp;gt;&amp;nbsp;GeometricShapes.Shape.dll&amp;nbsp;&lt;BR&gt;&lt;BR&gt;&lt;BR&gt;&lt;BR&gt;Good thing is changes made to Rectangle(draw method)&amp;nbsp;will affect only recompiling B.exe and not A.exe!!&lt;BR&gt;&lt;BR&gt;In the next entry we will look into the Open/Closed Principle&amp;nbsp; (OCP)&lt;BR&gt;HTH &lt;BR&gt;Hari &lt;/FONT&gt;&lt;/P&gt;</description><category>Patterns</category><comments>http://hariedge.com/2007/12/28/oo-principles--single-responsibility-principle-srp.aspx#Comments</comments><guid isPermaLink="false">2921999f-a8c7-44f5-b02a-bd5dadf74c08</guid><pubDate>Fri, 28 Dec 2007 15:35:00 GMT</pubDate></item><item><title>IISREST Vs IISAPP.VBS</title><link>http://hariedge.com/2007/12/28/r.aspx?ref=rss</link><dc:creator>Hari</dc:creator><description>&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;BR&gt;As part of developing in Sharepoint , you are required to do an IISReset some times,especially when deploying things to the GAC. The only problem with this approach is that it will recycle all application pools and also is a time consuming process. A better alternative is to just restart the process for the application pool for the web site that requires to pick up the change..&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;This can be achieved by running the following command&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;STRONG&gt;cscript.exe c:\windows\system32\iisapp.vbs /a "AppPoolForTheWebSite"&lt;/STRONG&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;To list all worker processes, the PID and the AppPoolID just type in the following command&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;STRONG&gt;cscript.exe c:\windows\system32\iisapp.vbs&lt;BR&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;BR&gt;&lt;BR&gt;Tip: This can then be also included as a post build command in VS 2005/ VS 2008!&lt;BR&gt;&lt;BR&gt;HTH, &lt;BR&gt;Hari&lt;/P&gt;</description><category>SharePoint</category><comments>http://hariedge.com/2007/12/28/r.aspx#Comments</comments><guid isPermaLink="false">2324f87b-5fde-4bd1-b0be-5bddbad5d39f</guid><pubDate>Fri, 28 Dec 2007 15:01:00 GMT</pubDate></item><item><title>Displaying Sub sites under Site name in the Site tab!  - One or more features must be turned on before this feature can be activated error...</title><link>http://hariedge.com/2007/07/24/displaying-subsites-under-site-name-in-the-site-tab---one-or-more-features-must-be-turned-on-before-this-feature-can-be-activated-error.aspx?ref=rss</link><dc:creator>Hari</dc:creator><description>&lt;p&gt;After reading some SharePoint books, I started creating sites and sub sites. The child sites of the Site collection showed up nicely as tabs alongside the SC tab. 
&lt;/p&gt;&lt;p&gt;As I started creating child sites for the child sites, they did not appear under the parent Child site &lt;span style="font-family:Wingdings"&gt;L&lt;/span&gt; But showed up as links on the Quick Launch...Hmm that was quite ugly..
&lt;/p&gt;&lt;p&gt;After doing some googling I hit at this Post : &lt;a href="http://mindsharpblogs.com/kathy/archive/2007/05/07/1750.aspx"&gt;http://mindsharpblogs.com/kathy/archive/2007/05/07/1750.aspx&lt;/a&gt;
	&lt;/p&gt;&lt;p&gt;After trying to activate the feature unsuccessfully (got the One or more features must be turned on before this feature can be activated. Error)
&lt;/p&gt;&lt;p&gt;Then hit at this wonderful post
&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.click2learn.ch/Lists/Announcements/DispForm.aspx?ID=18"&gt;http://www.click2learn.ch/Lists/Announcements/DispForm.aspx?ID=18&lt;/a&gt;
	&lt;/p&gt;&lt;p&gt;
 &lt;/p&gt;&lt;p&gt;One more post that explains step-by-step on how to make sub sites appear under the parent site is 
&lt;/p&gt;&lt;p&gt;&lt;a href="http://heathersolomon.com/blog/archive/2007/05/15/SharePoint-Tip--How-to-Activate-the-Drop-Down-Menu.aspx"&gt;http://heathersolomon.com/blog/archive/2007/05/15/SharePoint-Tip--How-to-Activate-the-Drop-Down-Menu.aspx&lt;/a&gt;
	&lt;/p&gt;&lt;p&gt;
 &lt;/p&gt;&lt;p&gt;Followed the steps and I am all set now &lt;span style="font-family:Wingdings"&gt;J&lt;/span&gt;
	&lt;/p&gt;&lt;p&gt;
 &lt;/p&gt;&lt;p&gt;Hope this helps someone else&lt;/p&gt;</description><comments>http://hariedge.com/2007/07/24/displaying-subsites-under-site-name-in-the-site-tab---one-or-more-features-must-be-turned-on-before-this-feature-can-be-activated-error.aspx#Comments</comments><guid isPermaLink="false">a3114a1b-bb04-4b43-9c69-e512576df15c</guid><pubDate>Wed, 25 Jul 2007 02:46:58 GMT</pubDate></item></channel></rss>