<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-1377174316200906704</id><updated>2011-09-04T03:42:34.436-07:00</updated><category term='C#'/><category term='Forms Services'/><category term='Pluggable Workflow Service'/><category term='Sandbox solution'/><category term='InfoPath 2010'/><category term='SharePoint 2007'/><category term='Tools and Utilities'/><category term='SharePoint 2010 Social Networking'/><category term='SharePoint Silverlight'/><category term='Workflows'/><category term='Web Parts'/><category term='SharePoint Object Model'/><category term='SharePoint Publishing'/><category term='JavaScript'/><category term='SharePoint 2010'/><category term='SharePoint Feature'/><category term='Exchange Server 2010'/><category term='Visual Studio 2010'/><title type='text'>vThink</title><subtitle type='html'>To understand how something works, you must first take it apart and un-reveal it's secret, only then you can build something better.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://vivek-soni.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1377174316200906704/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://vivek-soni.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Vivek</name><uri>http://www.blogger.com/profile/08310180297325901240</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_eTkvhTLeDPY/SnWbyjRk2rI/AAAAAAAAAQs/ElwvgOOCnfM/S220/DSC01417.JPG'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>16</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-1377174316200906704.post-1261131739389125987</id><published>2011-08-30T06:18:00.001-07:00</published><updated>2011-08-30T06:30:45.470-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SharePoint 2010'/><category scheme='http://www.blogger.com/atom/ns#' term='SharePoint Object Model'/><category scheme='http://www.blogger.com/atom/ns#' term='SharePoint 2007'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='Web Parts'/><title type='text'>Removing the OOB categories from the web part tool pane</title><content type='html'>&lt;p&gt;Often while developing custom web parts for SharePoint 2010 or MOSS, sometimes it is required to hide the OOB tool pane (for e.g. Appearance, Layouts or Advanced) from the end user.&lt;/p&gt;  &lt;p&gt;Trying for hours and scratching my head, I could not find any elegant way to achieve this. Finally I decided to use a hack via reflection. &lt;/p&gt;  &lt;p&gt;In my custom editor part class on the &lt;strong&gt;CreateChildControls() &lt;/strong&gt;method, I am calling a method &lt;strong&gt;HideOtherToolParts. &lt;/strong&gt;The HideOtherToolParts&lt;strong&gt; &lt;/strong&gt;iterates over the control collection for this editorpart and checks if the type of the child control is &lt;strong&gt;Microsoft.SharePoint.WebPartPages.WebPartToolPart&lt;/strong&gt; and accordingly hiding that child. &lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; protected override void CreateChildControls()   &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; base.CreateChildControls();    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; try    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; this.HideOtherToolParts(this.Parent.Controls);    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //other operations    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; catch    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; throw;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; private void HideOtherToolParts(ControlCollection controls)   &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; try    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; foreach (Control toolPart in controls)    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; if (toolPart.GetType().FullName == &amp;quot;Microsoft.SharePoint.WebPartPages.WebPartToolPart&amp;quot;)    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; toolPart.Visible = false;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; catch    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; throw;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;  &lt;div id="codeSnippetWrapper"&gt;Hope this helps!&lt;/div&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1377174316200906704-1261131739389125987?l=vivek-soni.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vivek-soni.blogspot.com/feeds/1261131739389125987/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vivek-soni.blogspot.com/2011/08/removing-oob-categories-from-web-part.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1377174316200906704/posts/default/1261131739389125987'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1377174316200906704/posts/default/1261131739389125987'/><link rel='alternate' type='text/html' href='http://vivek-soni.blogspot.com/2011/08/removing-oob-categories-from-web-part.html' title='Removing the OOB categories from the web part tool pane'/><author><name>Vivek</name><uri>http://www.blogger.com/profile/08310180297325901240</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_eTkvhTLeDPY/SnWbyjRk2rI/AAAAAAAAAQs/ElwvgOOCnfM/S220/DSC01417.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1377174316200906704.post-2433348656075232347</id><published>2011-05-22T00:23:00.001-07:00</published><updated>2011-05-22T00:23:23.915-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Forms Services'/><category scheme='http://www.blogger.com/atom/ns#' term='SharePoint 2010'/><category scheme='http://www.blogger.com/atom/ns#' term='InfoPath 2010'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Open a SharePoint Modal Dialog from an InfoPath Form - Live on SharePoint Developer Team Blog</title><content type='html'>&lt;p&gt;Recently I did a 5 part blog post on how to open a SharePoint Modal Dialog from an InfoPath Form on &lt;a href="http://blogs.msdn.com/b/sharepointdev/" target="_blank"&gt;SharePoint developer team blog&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;Below are the links to all the 5 parts in the series- &lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://blogs.msdn.com/b/sharepointdev/archive/2011/05/17/open-a-sharepoint-modal-dialog-from-an-infopath-form-part-1-of-5.aspx" target="_blank"&gt;Part 1&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="- http://blogs.msdn.com/b/sharepointdev/archive/2011/05/18/open-a-sharepoint-modal-dialog-from-an-infopath-form-part-2-of-5.aspx" target="_blank"&gt;Part 2&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://blogs.msdn.com/b/sharepointdev/archive/2011/05/19/open-a-sharepoint-modal-dialog-from-an-infopath-form-part-3-of-5.aspx" target="_blank"&gt;Part 3&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://blogs.msdn.com/b/sharepointdev/archive/2011/05/20/open-a-sharepoint-modal-dialog-from-an-infopath-form-part-4-of-5.aspx" target="_blank"&gt;Part 4&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://blogs.msdn.com/b/sharepointdev/archive/2011/05/21/open-a-sharepoint-modal-dialog-from-an-infopath-form-part-5-of-5.aspx" target="_blank"&gt;Part 5&lt;/a&gt; &lt;/li&gt; &lt;/ul&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1377174316200906704-2433348656075232347?l=vivek-soni.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vivek-soni.blogspot.com/feeds/2433348656075232347/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vivek-soni.blogspot.com/2011/05/open-sharepoint-modal-dialog-from.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1377174316200906704/posts/default/2433348656075232347'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1377174316200906704/posts/default/2433348656075232347'/><link rel='alternate' type='text/html' href='http://vivek-soni.blogspot.com/2011/05/open-sharepoint-modal-dialog-from.html' title='Open a SharePoint Modal Dialog from an InfoPath Form - Live on SharePoint Developer Team Blog'/><author><name>Vivek</name><uri>http://www.blogger.com/profile/08310180297325901240</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_eTkvhTLeDPY/SnWbyjRk2rI/AAAAAAAAAQs/ElwvgOOCnfM/S220/DSC01417.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1377174316200906704.post-6584834674272019436</id><published>2011-05-06T22:36:00.001-07:00</published><updated>2011-05-06T22:36:41.526-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Forms Services'/><category scheme='http://www.blogger.com/atom/ns#' term='SharePoint 2010'/><category scheme='http://www.blogger.com/atom/ns#' term='InfoPath 2010'/><category scheme='http://www.blogger.com/atom/ns#' term='Sandbox solution'/><title type='text'>InfoPath Form Sandbox Deployment Utility</title><content type='html'>&lt;p&gt;Deployment of an InfoPath form with code behind as a Sandbox solution can only be done using the InfoPath designer. But on a client’s production environment, it would be really difficult to use this approach for deploying InfoPath forms. So in order to mitigate this issue, the InfoPath Form Sandbox Deployment Utility can be leveraged.&lt;/p&gt;  &lt;p&gt;The InfoPath Form Sandbox Deployment Utility is a console application which can deploy any InfoPath form with/without code behind as a sandbox solution without requiring the InfoPath client itself. This utility can be used to deploy the InfoPath form locally or on a remote server provided the user running the application is the site collection administrator for the target SharePoint site.    &lt;br /&gt;    &lt;br /&gt;&lt;strong&gt;!!! Get Started&lt;/strong&gt;     &lt;br /&gt;* Download the &lt;a href="http://infopathsandboxdeply.codeplex.com/releases/view/65646#DownloadId=235555" target="_blank"&gt;&lt;strong&gt;&lt;font color="#3e62a6"&gt;InfoPath Form Sandbox Deployment Utility&lt;/font&gt;&lt;/strong&gt;&lt;/a&gt; runtime. &lt;a href="http://infopathsandboxdeply.codeplex.com/releases/view/65646#DownloadId=235555" target="_blank"&gt;     &lt;br /&gt;&lt;/a&gt;* Download the &lt;strong&gt;&lt;a title="User Guide" href="http://infopathsandboxdeply.codeplex.com/releases/view/65646#DownloadId=235556" target="_blank"&gt;&lt;font color="#3e62a6"&gt;User Guide&lt;/font&gt;&lt;/a&gt;&lt;/strong&gt;.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1377174316200906704-6584834674272019436?l=vivek-soni.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vivek-soni.blogspot.com/feeds/6584834674272019436/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vivek-soni.blogspot.com/2011/05/infopath-form-sandbox-deployment.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1377174316200906704/posts/default/6584834674272019436'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1377174316200906704/posts/default/6584834674272019436'/><link rel='alternate' type='text/html' href='http://vivek-soni.blogspot.com/2011/05/infopath-form-sandbox-deployment.html' title='InfoPath Form Sandbox Deployment Utility'/><author><name>Vivek</name><uri>http://www.blogger.com/profile/08310180297325901240</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_eTkvhTLeDPY/SnWbyjRk2rI/AAAAAAAAAQs/ElwvgOOCnfM/S220/DSC01417.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1377174316200906704.post-4374683491389655458</id><published>2010-10-03T00:09:00.001-07:00</published><updated>2010-10-03T00:19:40.071-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JavaScript'/><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio 2010'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Getting around the Firefox XMLHTTPRequest Cross Site Limitation</title><content type='html'>&lt;p style="MARGIN: 0cm 0cm 10pt" class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;span style="font-size:130%;"&gt;In one of our recent project, we had a module where we need to access a web service hosted on a third party domain into our SharePoint application. Well this appears as one of those mundane tasks of adding a reference to the web service and using the web service proxy in the C# code behind unless your client asks you to provide a postback free experience and he does not have his production SharePoint servers configured with AJAX configurations. &lt;/span&gt;&lt;p&gt;&lt;span style="font-size:130%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;/span&gt;&lt;/span&gt;&lt;p&gt;&lt;span style="font-size:130%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="MARGIN: 0cm 0cm 10pt" class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;span style="font-size:130%;"&gt;In this situation the only way you are left with is JavaScript hence we did the same. Now for accessing the third party web service we leveraged the XMLHttpRequest object to issue an HTTPGET request to the desired web method and accordingly use the response as returned back from the service. &lt;/span&gt;&lt;p&gt;&lt;span style="font-size:130%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;/span&gt;&lt;/span&gt;&lt;p&gt;&lt;span style="font-size:130%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="MARGIN: 0cm 0cm 10pt" class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;span style="font-size:130%;"&gt;Everything was working like a charm until we tested our app in Firefox.&lt;span style="mso-spacerun: yes"&gt; &lt;/span&gt;Bang here goes app!! &lt;/span&gt;&lt;p&gt;&lt;span style="font-size:130%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;/span&gt;&lt;/span&gt;&lt;p&gt;&lt;span style="font-size:130%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="MARGIN: 0cm 0cm 10pt" class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;span style="font-size:130%;"&gt;Below is the JavaScript script that issues an XMLHttpRequest request directly to the to the web service &lt;/span&gt;&lt;p&gt;&lt;span style="font-size:130%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;/span&gt;&lt;/span&gt;&lt;p&gt;&lt;span style="font-size:130%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:130%;"&gt;&lt;img style="BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; DISPLAY: inline; BORDER-TOP: 0px; BORDER-RIGHT: 0px" title="Script_WebServiceCall" border="0" alt="Script_WebServiceCall" src="http://lh6.ggpht.com/_eTkvhTLeDPY/TKgr9Bn14AI/AAAAAAAAAXo/Dr1zzZtx_rI/Script_WebServiceCall%5B7%5D.png?imgmax=800" width="559" height="395" /&gt; &lt;/span&gt;&lt;/p&gt;&lt;p style="MARGIN: 0cm 0cm 10pt" class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;&lt;span style="font-family:Calibri;font-size:130%;"&gt;In Internet Explorer the above script successfully calls the HelloWorld web method and displays the result.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="MARGIN: 0cm 0cm 10pt" class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;span style="font-size:130%;"&gt;&lt;img style="BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; DISPLAY: inline; BORDER-TOP: 0px; BORDER-RIGHT: 0px" title="IE_WithoutProxy" border="0" alt="IE_WithoutProxy" src="http://lh4.ggpht.com/_eTkvhTLeDPY/TKgr-uoxSaI/AAAAAAAAAXs/JdjIs4Akdoo/IE_WithoutProxy%5B5%5D.png?imgmax=800" width="561" height="332" /&gt; &lt;/span&gt;&lt;p&gt;&lt;span style="font-size:130%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;/span&gt;&lt;/span&gt;&lt;p&gt;&lt;span style="font-size:130%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="MARGIN: 0cm 0cm 10pt" class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;&lt;span style="font-family:Calibri;font-size:130%;"&gt;However in Firefox you will receive an error with status code 0.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="MARGIN: 0cm 0cm 10pt" class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;&lt;span style="font-family:Calibri;font-size:130%;"&gt;&lt;img style="BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; DISPLAY: inline; BORDER-TOP: 0px; BORDER-RIGHT: 0px" title="FF_WithoutProxy" border="0" alt="FF_WithoutProxy" src="http://lh3.ggpht.com/_eTkvhTLeDPY/TKgr_iM8QPI/AAAAAAAAAXw/QScBzI3Kv2w/FF_WithoutProxy%5B6%5D.png?imgmax=800" width="558" height="330" /&gt; &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;span lang="EN-US"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;p style="MARGIN: 0cm 0cm 10pt" class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;&lt;span style="font-size:130%;"&gt;Debugging this issue I found that I was always getting the xmlhttprequest.status code as 0 instead of 200. Now that was weird since the same code works fine in IE 7 &amp;amp; IE 8 but fails in Firefox. Moreover I couldn’t find any &lt;/span&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ms767625(v=VS.85).aspx" target="_blank"&gt;&lt;span style="font-size:130%;"&gt;documentation&lt;/span&gt;&lt;/a&gt;&lt;span style="color:#0000ff;"&gt;&lt;/span&gt;&lt;span style="font-size:130%;"&gt; for the 0 status code. &lt;/span&gt;&lt;p&gt;&lt;span style="font-size:130%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;/span&gt;&lt;p&gt;&lt;span style="font-size:130%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="MARGIN: 0cm 0cm 10pt" class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;&lt;span style="font-size:130%;"&gt;Googling around this issue I found some explanation &lt;/span&gt;&lt;a href="http://books.google.co.in/books?id=VTmXAT702S4C&amp;amp;lpg=PA34&amp;amp;ots=f84CIkyGul&amp;amp;dq=Any%20discussion%20of%20browser-based%20technologies%20wouldn%E2%80%99t%20be%20complete%20without%20mentioning%20security&amp;amp;pg=PA34#v=onepage&amp;amp;q=Any%20discussion%20of%20browser-based%20technologies%20wouldn%E2%80%99t%20be%20complete%20without%20mentioning%20security&amp;amp;f=true" target="_blank"&gt;&lt;span style="font-size:130%;"&gt;here&lt;/span&gt;&lt;/a&gt;&lt;span style="color:#0000ff;"&gt;&lt;/span&gt;&lt;span style="font-size:130%;"&gt; &lt;/span&gt;&lt;p&gt;&lt;span style="font-size:130%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;/span&gt;&lt;p&gt;&lt;span style="font-size:130%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="MARGIN: 0cm 0cm 10pt" class="MsoNormal"&gt;&lt;i style="mso-bidi-font-style: normal"&gt;&lt;span lang="EN-US"&gt;&lt;span style="font-size:130%;"&gt;The XMLHttpRequest object is subjected to the browser’s security “sandbox.” Any resources&lt;br /&gt;requested by the XMLHttpRequest object must reside within the same domain from which the&lt;br /&gt;calling script originated. This security restriction prevents the XMLHttpRequest object from&lt;br /&gt;requesting resources outside the domain from which the script was originally served.&lt;br /&gt;The strength of this security restriction varies by browser. Internet&lt;br /&gt;Explorer shows an alert stating that a potential security risk exists but gives the user a choice&lt;br /&gt;of whether to continue with the request. &lt;b style="mso-bidi-font-weight: normal"&gt;Firefox simply stops the request&lt;/b&gt; and shows an error&lt;br /&gt;message ..." &lt;/span&gt;&lt;p&gt;&lt;span style="font-size:130%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;/span&gt;&lt;/i&gt;&lt;p&gt;&lt;span style="font-size:130%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="MARGIN: 0cm 0cm 10pt" class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;&lt;span style="font-size:130%;"&gt;Cutting the long story short it is no possible to access a web service on another domain/port via XMLHttpRequest object in Firefox. &lt;/span&gt;&lt;p&gt;&lt;span style="font-size:130%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;/span&gt;&lt;p&gt;&lt;span style="font-size:130%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="MARGIN: 0cm 0cm 10pt" class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;&lt;span style="font-size:130%;"&gt;So finally we decided to adopt an alternative of creating a server side proxy (managed code) which would take up the task of communicating with the web service. Further our JavaScript code would remain as is but one change i.e. instead of requesting the web service, the script will issue an XMLHttpRequest to server side proxy who is apparently on the same domain and this approach worked flawlessly. &lt;/span&gt;&lt;p&gt;&lt;span style="font-size:130%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;/span&gt;&lt;p&gt;&lt;span style="font-size:130%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:130%;"&gt;&lt;/span&gt;&lt;p style="MARGIN: 0cm 0cm 10pt" class="MsoNormal"&gt;&lt;span lang="EN-US"  style="font-size:130%;"&gt;Here is how the code behind for the proxy page would look like:&lt;/span&gt;&lt;/p&gt;&lt;p style="MARGIN: 0cm 0cm 10pt" class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;&lt;span style="font-size:130%;"&gt;&lt;img style="BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; DISPLAY: inline; BORDER-TOP: 0px; BORDER-RIGHT: 0px" title="ProxyPage_CodeBehind" border="0" alt="ProxyPage_CodeBehind" src="http://lh6.ggpht.com/_eTkvhTLeDPY/TKgsAgEjTLI/AAAAAAAAAX0/sgV3Vzu1YTc/ProxyPage_CodeBehind%5B6%5D.png?imgmax=800" width="532" height="426" /&gt; &lt;/span&gt;&lt;p&gt;&lt;span style="font-size:130%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;/span&gt;&lt;p&gt;&lt;span style="font-size:130%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:130%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;/span&gt;&lt;/span&gt;&lt;p&gt;&lt;span style="font-size:130%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="MARGIN: 0cm 0cm 10pt" class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;&lt;span style="font-family:Calibri;font-size:130%;"&gt;The above code is initiating the web service object (hellowrldsvc) and calling the required web method (HelloWorld). Further we are writing the result as returned by the web method back to the page response.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;span lang="EN-US"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;p style="MARGIN: 0cm 0cm 10pt" class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;&lt;span style="font-size:130%;"&gt;Here is the updated JavaScript: &lt;/span&gt;&lt;p&gt;&lt;span style="font-size:130%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;/span&gt;&lt;p&gt;&lt;span style="font-size:130%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:130%;"&gt;&lt;img style="BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; DISPLAY: inline; BORDER-TOP: 0px; BORDER-RIGHT: 0px" title="Script_ProxyPageCall" border="0" alt="Script_ProxyPageCall" src="http://lh5.ggpht.com/_eTkvhTLeDPY/TKgsClxeFpI/AAAAAAAAAX4/HGrQJ8Pi8QQ/Script_ProxyPageCall%5B7%5D.png?imgmax=800" width="533" height="408" /&gt; &lt;/span&gt;&lt;/p&gt;&lt;/span&gt;&lt;/span&gt;&lt;p style="MARGIN: 0cm 0cm 10pt" class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;span style="font-size:130%;"&gt;Notice the url (as highlighted) is now pointing to the proxy page and the rest of the code is as is. Further upon executing the same, we get the result in IE and Firefox as shown below. &lt;/span&gt;&lt;p&gt;&lt;span style="font-size:130%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;/span&gt;&lt;/span&gt;&lt;p&gt;&lt;span style="font-size:130%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="MARGIN: 0cm 0cm 10pt" class="MsoNormal"&gt;&lt;span style="mso-no-proof: yes" lang="EN-US"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;span style="font-size:130%;"&gt;In IE: &lt;/span&gt;&lt;p&gt;&lt;span style="font-size:130%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;/span&gt;&lt;/span&gt;&lt;p&gt;&lt;span style="font-size:130%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:130%;"&gt;&lt;img style="BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; DISPLAY: inline; BORDER-TOP: 0px; BORDER-RIGHT: 0px" title="IE_WithProxy" border="0" alt="IE_WithProxy" src="http://lh6.ggpht.com/_eTkvhTLeDPY/TKgsDnen9dI/AAAAAAAAAX8/h9iYLBWLMdA/IE_WithProxy%5B5%5D.png?imgmax=800" width="530" height="314" /&gt; &lt;/span&gt;&lt;/p&gt;&lt;p style="MARGIN: 0cm 0cm 10pt" class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;&lt;span style="font-family:Calibri;font-size:130%;"&gt;In Firefox:&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="MARGIN: 0cm 0cm 10pt" class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;span style="font-size:130%;"&gt;&lt;img style="BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; DISPLAY: inline; BORDER-TOP: 0px; BORDER-RIGHT: 0px" title="FF_WithProxy" border="0" alt="FF_WithProxy" src="http://lh5.ggpht.com/_eTkvhTLeDPY/TKgsE5y9ehI/AAAAAAAAAYA/JU6idD9CQN8/FF_WithProxy%5B6%5D.png?imgmax=800" width="529" height="313" /&gt; &lt;/span&gt;&lt;p&gt;&lt;span style="font-size:130%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;/span&gt;&lt;/span&gt;&lt;p&gt;&lt;span style="font-size:130%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="MARGIN: 0cm 0cm 10pt" class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;&lt;span style="font-family:Calibri;font-size:130%;"&gt;If your web method requires some parameter to execute, then you can pass them in page query string (as shown below) and further in the proxy page code behind read them using Page.Request.QueryString. &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="MARGIN: 0cm 0cm 10pt" class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;span style="font-size:130%;"&gt;&lt;img style="BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; DISPLAY: inline; BORDER-TOP: 0px; BORDER-RIGHT: 0px" title="Script_ProxyPageCall_withQueryString" border="0" alt="Script_ProxyPageCall_withQueryString" src="http://lh6.ggpht.com/_eTkvhTLeDPY/TKgsGEohc-I/AAAAAAAAAYE/QXSTvs0VrHw/Script_ProxyPageCall_withQueryString%5B7%5D.png?imgmax=800" width="521" height="215" /&gt; &lt;/span&gt;&lt;p&gt;&lt;span style="font-size:130%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;/span&gt;&lt;/span&gt;&lt;p&gt;&lt;span style="font-size:130%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="MARGIN: 0cm 0cm 10pt" class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;span style="font-size:130%;"&gt;In case you are dealing with SharePoint, I would recommend you to deploy the proxy page as a Layout page and update the url accordingly. &lt;/span&gt;&lt;p&gt;&lt;span style="font-size:130%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;/span&gt;&lt;/span&gt;&lt;p&gt;&lt;span style="font-size:130%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="MARGIN: 0cm 0cm 10pt" class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;/span&gt;&lt;span style="font-size:130%;"&gt;Hope you will find this post helpful. &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="MARGIN: 0cm 0cm 10pt" class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;span style="font-size:130%;"&gt;The associated code behind and the Visual Studio 2010 project can be downloaded from here: &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;iframe style="PADDING-BOTTOM: 0px; BACKGROUND-COLOR: #fcfcfc; PADDING-LEFT: 0px; WIDTH: 98px; PADDING-RIGHT: 0px; HEIGHT: 115px; PADDING-TOP: 0px" title="Preview" marginheight="0" src="http://cid-3a1504592747cd6e.office.live.com/embedicon.aspx/.Public/SharePoint/Firefox%20XMLHTTPRequest%20Cross%20Site%20Limitation" frameborder="0" marginwidth="0" scrolling="no"&gt;&lt;/iframe&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1377174316200906704-4374683491389655458?l=vivek-soni.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vivek-soni.blogspot.com/feeds/4374683491389655458/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vivek-soni.blogspot.com/2010/10/getting-around-firefox-xmlhttprequest.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1377174316200906704/posts/default/4374683491389655458'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1377174316200906704/posts/default/4374683491389655458'/><link rel='alternate' type='text/html' href='http://vivek-soni.blogspot.com/2010/10/getting-around-firefox-xmlhttprequest.html' title='Getting around the Firefox XMLHTTPRequest Cross Site Limitation'/><author><name>Vivek</name><uri>http://www.blogger.com/profile/08310180297325901240</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_eTkvhTLeDPY/SnWbyjRk2rI/AAAAAAAAAQs/ElwvgOOCnfM/S220/DSC01417.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh6.ggpht.com/_eTkvhTLeDPY/TKgr9Bn14AI/AAAAAAAAAXo/Dr1zzZtx_rI/s72-c/Script_WebServiceCall%5B7%5D.png?imgmax=800' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1377174316200906704.post-5401701003455282557</id><published>2010-09-12T09:49:00.001-07:00</published><updated>2010-09-12T10:03:27.119-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Workflows'/><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio 2010'/><category scheme='http://www.blogger.com/atom/ns#' term='SharePoint 2010'/><category scheme='http://www.blogger.com/atom/ns#' term='Pluggable Workflow Service'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>SharePoint 2010 Pluggable Workflow Services – Part 2</title><content type='html'>&lt;p&gt;&lt;span lang="EN-US"&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;This is the second post in the series SharePoint 2010 Pluggable Workflow Services. In the &lt;a href="http://vivek-soni.blogspot.com/2010/09/sharepoint-2010-pluggable-workflow_12.html" target="_blank"&gt;first post&lt;/a&gt; I demonstrated creating a very basic sequential workflow and exposing a business object which we’ll be leveraging to communicate the information from the workflow. In this post we will dive into the nitty-gritties of a Pluggable Workflow Service.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="MARGIN: 0cm 0cm 10pt" class="MsoNormal"&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;span lang="EN-US"&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;Creating a Pluggable Workflow Service &lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="MARGIN: 0cm 0cm 10pt" class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;Here comes the crux of this post of as how we can create pluggable workflow service. &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="TEXT-INDENT: -18pt; MARGIN: 0cm 0cm 0pt 36pt; mso-list: l0 level1 lfo1" class="MsoListParagraphCxSpFirst"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;span style="mso-bidi-: minor-latin;font-family:calibri;" lang="EN-US" &gt;&lt;span style="mso-list: ignore"&gt;1.&lt;span style="FONT: 7pt 'Times New Roman'"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span lang="EN-US"&gt;We will add new class file to our project and name is &lt;strong&gt;OrderTrackingService&lt;/strong&gt;. &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="TEXT-INDENT: -18pt; MARGIN: 0cm 0cm 10pt 36pt; mso-list: l0 level1 lfo1" class="MsoListParagraphCxSpLast"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;span style="mso-bidi-: minor-latin;font-family:calibri;" lang="EN-US" &gt;&lt;span style="mso-list: ignore"&gt;2.&lt;span style="FONT: 7pt 'Times New Roman'"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span lang="EN-US"&gt;Add the following namespace deceleration to the class.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="PADDING-BOTTOM: 0px; PADDING-LEFT: 0px; WIDTH: 296px; PADDING-RIGHT: 0px; DISPLAY: block; FLOAT: none; MARGIN-LEFT: auto; MARGIN-RIGHT: auto; PADDING-TOP: 0px" id="scid:f32c3428-b7e9-4f15-a8ea-c502c7ff2e88:c35957b4-aa94-451b-8752-c4572c57e129" class="wlWriterEditableSmartContent"&gt;&lt;pre class="brush: c#;"&gt;using System.Workflow.Activities;&lt;br /&gt;using Microsoft.SharePoint.Workflow;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;3. Now we will declare an interface &lt;strong&gt;IOrdertrackingService&lt;/strong&gt; and add the following to the body of the interface.&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style="PADDING-BOTTOM: 0px; PADDING-LEFT: 0px; WIDTH: 560px; PADDING-RIGHT: 0px; DISPLAY: block; FLOAT: none; MARGIN-LEFT: auto; MARGIN-RIGHT: auto; PADDING-TOP: 0px" id="scid:f32c3428-b7e9-4f15-a8ea-c502c7ff2e88:65efa438-22b3-4b6b-8cf0-47937829a2eb" class="wlWriterEditableSmartContent"&gt;&lt;pre class="brush: c#;"&gt;[ExternalDataExchange]&lt;br /&gt;    public interface IOrderTrackingService&lt;br /&gt;    {&lt;br /&gt;        event EventHandler&amp;lt;OrderTrackingEventArgs&amp;gt; OrderTrackingEvent;&lt;br /&gt;        void DispatchOrder(Order order);&lt;br /&gt;    }&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;&lt;span lang="EN-US"&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;So what we did above is we defined a method signature &lt;strong&gt;DispatchOrder&lt;/strong&gt; which when implemented on a class would do the needful task of creating an order entry in the database. This method would then be further called from the workflow service &lt;b style="mso-bidi-font-weight: normal"&gt;CallExternalMethod&lt;/b&gt; Activity. Also after executing the &lt;strong&gt;DispatchOrder&lt;/strong&gt; method raises the &lt;strong&gt;OrderTrackingEvent&lt;/strong&gt; to notify the workflow that the service has completed its execution. The &lt;b style="mso-bidi-font-weight: normal"&gt;HandleExternalEvents &lt;/b&gt;workflow&lt;b style="mso-bidi-font-weight: normal"&gt; &lt;/b&gt;activity then takes care of the event arguments as passed by the OrderTrackingEvent. &lt;/span&gt;&lt;/span&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;4. Add the following &lt;strong&gt;OrderTrackingEventArgs&lt;/strong&gt; class.&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style="PADDING-BOTTOM: 0px; PADDING-LEFT: 0px; WIDTH: 504px; PADDING-RIGHT: 0px; DISPLAY: block; FLOAT: none; MARGIN-LEFT: auto; MARGIN-RIGHT: auto; PADDING-TOP: 0px" id="scid:f32c3428-b7e9-4f15-a8ea-c502c7ff2e88:ef6c3937-c128-440b-9392-f90dbb4e0196" class="wlWriterEditableSmartContent"&gt;&lt;pre class="brush: c#;"&gt;[Serializable()]&lt;br /&gt;    public class OrderTrackingEventArgs : ExternalDataEventArgs&lt;br /&gt;    {&lt;br /&gt;        public OrderTrackingEventArgs(Guid id) : base(id) { }&lt;br /&gt;        public string DeliveryStatus;&lt;br /&gt;    }&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;&lt;p style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt 36pt; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;span lang="EN-US"&gt;The above code indicates that we will be passing &lt;strong&gt;DeliveryStatus&lt;/strong&gt; as an argument to &lt;b style="mso-bidi-font-weight: normal"&gt;HandleExternalEvents &lt;/b&gt;activity back in the workflow&lt;b style="mso-bidi-font-weight: normal"&gt;.&lt;/b&gt;&lt;/span&gt;&lt;span lang="EN-US"   style="font-family:consolas;font-size:9;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;5. Next on our OrderTrackingService class we will implement &lt;strong&gt;SPWorkflowExternalDataExchangeService &lt;/strong&gt;and &lt;strong&gt;IOrderTrackingService&lt;/strong&gt; interface.&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style="PADDING-BOTTOM: 0px; PADDING-LEFT: 0px; WIDTH: 640px; PADDING-RIGHT: 0px; DISPLAY: block; FLOAT: none; MARGIN-LEFT: auto; MARGIN-RIGHT: auto; PADDING-TOP: 0px" id="scid:f32c3428-b7e9-4f15-a8ea-c502c7ff2e88:a60dfff3-77a2-4ae5-88b9-c05b949c85cf" class="wlWriterEditableSmartContent"&gt;&lt;pre class="brush: c#;"&gt;class OrderTrackingService : SPWorkflowExternalDataExchangeService,IOrderTrackingService&lt;br /&gt;    {&lt;br /&gt;&lt;br /&gt;        public event EventHandler&amp;lt;OrderTrackingEventArgs&amp;gt; OrderTrackingEvent;&lt;br /&gt;&lt;br /&gt;        public void DispatchOrder(Order order)&lt;br /&gt;        {&lt;br /&gt;            throw new NotImplementedException();&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        public override void CallEventHandler(Type eventType, string eventName, object[] eventData, SPWorkflow workflow, string identity, System.Workflow.Runtime.IPendingWork workHandler, object workItem)&lt;br /&gt;        {&lt;br /&gt;            throw new NotImplementedException();&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        public override void CreateSubscription(MessageEventSubscription subscription)&lt;br /&gt;        {&lt;br /&gt;            throw new NotImplementedException();&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        public override void DeleteSubscription(Guid subscriptionId)&lt;br /&gt;        {&lt;br /&gt;            throw new NotImplementedException();&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;Now let’s write the logic for &lt;strong&gt;DispatchOrder&lt;/strong&gt; method. Here we will use LINQ to SQL and connect to the local &lt;strong&gt;ContosoOrderTracking&lt;/strong&gt; database which you restored using the db script.&lt;/span&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;6. Add a new item to the project of the type LINQ to SQL class and name is &lt;strong&gt;ContosoOrders&lt;/strong&gt;.&lt;img style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: block; FLOAT: none; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; MARGIN-LEFT: auto; BORDER-LEFT-WIDTH: 0px; MARGIN-RIGHT: auto" title="LinqToSqlClass" border="0" alt="LinqToSqlClass" src="http://lh6.ggpht.com/_eTkvhTLeDPY/TI0EZJj8yGI/AAAAAAAAAW4/mZ-fyOqVaHU/LinqToSqlClass%5B6%5D.png?imgmax=800" width="340" height="217" /&gt; &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;7. Using the server explorer create a connection to the &lt;strong&gt;ContosoOrderTracking&lt;/strong&gt; db.&lt;img style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: block; FLOAT: none; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; MARGIN-LEFT: auto; BORDER-LEFT-WIDTH: 0px; MARGIN-RIGHT: auto" title="ServerExpplorer" border="0" alt="ServerExpplorer" src="http://lh5.ggpht.com/_eTkvhTLeDPY/TI0EZ6ycc0I/AAAAAAAAAW8/vwqugTprwTM/ServerExpplorer%5B8%5D.png?imgmax=800" width="240" height="200" /&gt; &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;8. Drag and drop the &lt;strong&gt;ContosoOrder&lt;/strong&gt; db table to the design surface.&lt;img style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: block; FLOAT: none; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; MARGIN-LEFT: auto; BORDER-LEFT-WIDTH: 0px; MARGIN-RIGHT: auto" title="ContosoOrderTable" border="0" alt="ContosoOrderTable" src="http://lh4.ggpht.com/_eTkvhTLeDPY/TI0Ea8EvovI/AAAAAAAAAXA/XtADexcYiXY/ContosoOrderTable%5B5%5D.png?imgmax=800" width="215" height="184" /&gt; &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;9. Back in the &lt;strong&gt;OrderTrackingService&lt;/strong&gt; class, update the &lt;strong&gt;DispatchOrder&lt;/strong&gt; method to like this.&lt;/span&gt;&lt;/p&gt;&lt;div style="PADDING-BOTTOM: 0px; PADDING-LEFT: 0px; WIDTH: 664px; PADDING-RIGHT: 0px; DISPLAY: block; FLOAT: none; MARGIN-LEFT: auto; MARGIN-RIGHT: auto; PADDING-TOP: 0px" id="scid:f32c3428-b7e9-4f15-a8ea-c502c7ff2e88:414f1c65-eb29-4eaa-8872-d6955b984940" class="wlWriterEditableSmartContent"&gt;&lt;pre class="brush: c#;"&gt;public void DispatchOrder(Order order)&lt;br /&gt;        {&lt;br /&gt;            const string connection = @"Data Source=SHAREPOINT2010;Initial Catalog=ContosoOrderTracking;Integrated Security=True";&lt;br /&gt;&lt;br /&gt;            using (ContosoOrdersDataContext contosoDataCntxt = new ContosoOrdersDataContext(connection))&lt;br /&gt;            {&lt;br /&gt;                try&lt;br /&gt;                {&lt;br /&gt;                    ContosoOrder corder = new ContosoOrder();&lt;br /&gt;                    corder.Title = order.Title;&lt;br /&gt;                    corder.Quantity = order.Quantity;&lt;br /&gt;                    corder.Amount = order.Amount;&lt;br /&gt;                    corder.CutomerName = order.CustomerName;&lt;br /&gt;                    corder.ID = new Guid(order.ID);&lt;br /&gt;&lt;br /&gt;                    contosoDataCntxt.ContosoOrders.InsertOnSubmit(corder);&lt;br /&gt;                    contosoDataCntxt.SubmitChanges();&lt;br /&gt;&lt;br /&gt;                    order.DeliveryStatus = "Delivered";&lt;br /&gt;                }&lt;br /&gt;                catch&lt;br /&gt;                {&lt;br /&gt;                    order.DeliveryStatus = "Returned";&lt;br /&gt;                }&lt;br /&gt;            }&lt;br /&gt;&lt;br /&gt;            RaiseEvent(this.CurrentWorkflow.ParentWeb, this.CurrentWorkflow.InstanceId,&lt;br /&gt;               typeof(IOrderTrackingService), "OrderTrackingEvent", new object[] { order.DeliveryStatus });&lt;br /&gt;        }&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;&lt;p style="MARGIN: 0cm 0cm 0pt 36pt" class="MsoListParagraphCxSpFirst"&gt;&lt;span lang="EN-US"&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;In the above code, we leveraged the LINQ to SQL to create a new entry in the ContosoOrder database. The order object as used in the above code would be supplied by the calling workflow. Also we are setting the DeliveryStatus property of the order object to Delivered if the database entry is created successfully else we set it to Returned indicating a failure. &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="MARGIN: 0cm 0cm 10pt 36pt" class="MsoListParagraphCxSpLast"&gt;&lt;span lang="EN-US"&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;At the end we call the RaiseEvent method to notify the calling workflow of the completion of the service activity.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;10. The final piece to complete this puzzle is to implement the CallEventHandler method as follows.&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style="PADDING-BOTTOM: 0px; PADDING-LEFT: 0px; WIDTH: 648px; PADDING-RIGHT: 0px; DISPLAY: block; FLOAT: none; MARGIN-LEFT: auto; MARGIN-RIGHT: auto; PADDING-TOP: 0px" id="scid:f32c3428-b7e9-4f15-a8ea-c502c7ff2e88:c2040886-700b-44dc-a4b0-c981b1bb8d2f" class="wlWriterEditableSmartContent"&gt;&lt;pre class="brush: c#;"&gt;public override void CallEventHandler(Type eventType, string eventName, object[] eventData, SPWorkflow workflow, string identity, System.Workflow.Runtime.IPendingWork workHandler, object workItem)&lt;br /&gt;        {&lt;br /&gt;            if (string.Equals(eventName, "OrderTrackingEvent", StringComparison.OrdinalIgnoreCase))&lt;br /&gt;            {&lt;br /&gt;                var args = new OrderTrackingEventArgs(workflow.InstanceId);&lt;br /&gt;                args.DeliveryStatus = eventData[0].ToString();&lt;br /&gt;                this.OrderTrackingEvent(null, args);&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;&lt;p style="MARGIN: 0cm 0cm 10pt 36pt" class="MsoListParagraph"&gt;&lt;span lang="EN-US"&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;The &lt;strong&gt;CallEventHandler&lt;/strong&gt; method gets called each time when the workflow service requests an event. Here we create the &lt;strong&gt;OrderTrackingEventArgs&lt;/strong&gt; instance and pass in the workflow's instance ID to so the event knows which workflow it's invoking the event with. We next pass in the status message from the event receiver and finally invoke the event.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="MARGIN: 0cm 0cm 10pt" class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;This completes the workflow service here. Now we need to make our Order Tracking workflow be able to call this service.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;span lang="EN-US"&gt;&lt;p style="MARGIN: 0cm 0cm 10pt" class="MsoNormal"&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;span lang="EN-US"&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;Updating the Workflow to call Pluggable Workflow Service&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;span lang="EN-US"&gt;&lt;p style="TEXT-INDENT: -18pt; MARGIN: 0cm 0cm 10pt 36pt; mso-list: l0 level1 lfo1" class="MsoListParagraph"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;span style="mso-bidi-: minor-latin;font-family:calibri;" lang="EN-US" &gt;&lt;span style="mso-list: ignore"&gt;1.&lt;span style="FONT: 7pt 'Times New Roman'"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span lang="EN-US"&gt;Back in our Order Tracking workflow design surface; add the following activities as shown after logTOHistoryActivity1.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="TEXT-INDENT: -18pt; MARGIN: 0cm 0cm 10pt 36pt; mso-list: l0 level1 lfo1" class="MsoListParagraph"&gt;&lt;span lang="EN-US"&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;&lt;img style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: block; FLOAT: none; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; MARGIN-LEFT: auto; BORDER-LEFT-WIDTH: 0px; MARGIN-RIGHT: auto" title="WorkflowDesign" border="0" alt="WorkflowDesign" src="http://lh5.ggpht.com/_eTkvhTLeDPY/TI0EcQV-80I/AAAAAAAAAXE/8G93DwVwBgg/WorkflowDesign%5B7%5D.png?imgmax=800" width="150" height="467" /&gt; &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;/span&gt;&lt;/span&gt;&lt;p&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;2. After adding the above activities, select &lt;strong&gt;callExternalMethodActivity1&lt;/strong&gt; and set the following properties in the property pane as shown below.&lt;/span&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;&lt;img style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: block; FLOAT: none; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; MARGIN-LEFT: auto; BORDER-LEFT-WIDTH: 0px; MARGIN-RIGHT: auto" title="callExternalMethodActivity_1" border="0" alt="callExternalMethodActivity_1" src="http://lh6.ggpht.com/_eTkvhTLeDPY/TI0EdU-7waI/AAAAAAAAAXI/tLXQ4VK9KWM/callExternalMethodActivity_1%5B7%5D.png?imgmax=800" width="340" height="142" /&gt; &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;3. Now right click &lt;strong&gt;handleExternalEventActivity1&lt;/strong&gt; and Generate Handlers. Also set the properties as shown below.&lt;img style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: block; FLOAT: none; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; MARGIN-LEFT: auto; BORDER-LEFT-WIDTH: 0px; MARGIN-RIGHT: auto" title="handleExternalEventActivity1" border="0" alt="handleExternalEventActivity1" src="http://lh6.ggpht.com/_eTkvhTLeDPY/TI0EeIAYNwI/AAAAAAAAAXM/CDecgodpCsU/handleExternalEventActivity1%5B6%5D.png?imgmax=800" width="300" height="134" /&gt; &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;4. For the property with the name &lt;strong&gt;e&lt;/strong&gt;, we will bind it to a new activity field.&lt;/span&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;&lt;img style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: block; FLOAT: none; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; MARGIN-LEFT: auto; BORDER-LEFT-WIDTH: 0px; MARGIN-RIGHT: auto" title="bind_e" border="0" alt="bind_e" src="http://lh3.ggpht.com/_eTkvhTLeDPY/TI0EfPZBXLI/AAAAAAAAAXQ/6MMqgT_m4lQ/bind_e%5B6%5D.png?imgmax=800" width="340" height="266" /&gt; &lt;/span&gt;&lt;/p&gt;&lt;p style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;Back in the &lt;strong&gt;OrderTracking&lt;/strong&gt;.cs&lt;span style="mso-spacerun: yes"&gt; &lt;/span&gt;file we will remove the highlighted code.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;&lt;img style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: block; FLOAT: none; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; MARGIN-LEFT: auto; BORDER-LEFT-WIDTH: 0px; MARGIN-RIGHT: auto" title="removecode" border="0" alt="removecode" src="http://lh3.ggpht.com/_eTkvhTLeDPY/TI0EgPa5qnI/AAAAAAAAAXU/K52mcyzxOEo/removecode%5B7%5D.png?imgmax=800" width="600" height="18" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;5. Update the &lt;strong&gt;handleExternalEventActivity1_Invoked&lt;/strong&gt; as shown below.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;/p&gt;&lt;div style="PADDING-BOTTOM: 0px; PADDING-LEFT: 0px; WIDTH: 640px; PADDING-RIGHT: 0px; DISPLAY: block; FLOAT: none; MARGIN-LEFT: auto; MARGIN-RIGHT: auto; PADDING-TOP: 0px" id="scid:f32c3428-b7e9-4f15-a8ea-c502c7ff2e88:40d03c88-d414-406a-bb8c-2223a21fce64" class="wlWriterEditableSmartContent"&gt;&lt;pre class="brush: c#;"&gt;public OrderTrackingEventArgs handleExternalEventActivity1_e1;&lt;br /&gt;        private void handleExternalEventActivity1_Invoked(object sender, ExternalDataEventArgs e)&lt;br /&gt;        {&lt;br /&gt;            logToHistoryListActivity2.HistoryDescription = string.Format("Order delivered to the customer sucessfully.");&lt;br /&gt;        }&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;&lt;p style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;6. Back in our Order Tracking workflow design surface, right click codeActivity2 and click Generate Handlers.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;7. Update the &lt;strong&gt;codeActivity2_ExecuteCode &lt;/strong&gt;method as follows.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="PADDING-BOTTOM: 0px; PADDING-LEFT: 0px; WIDTH: 616px; PADDING-RIGHT: 0px; DISPLAY: block; FLOAT: none; MARGIN-LEFT: auto; MARGIN-RIGHT: auto; PADDING-TOP: 0px" id="scid:f32c3428-b7e9-4f15-a8ea-c502c7ff2e88:970133fc-ff81-4e8e-a343-91a1bb573fe0" class="wlWriterEditableSmartContent"&gt;&lt;pre class="brush: c#;"&gt;private void codeActivity2_ExecuteCode(object sender, EventArgs e)&lt;br /&gt;        {&lt;br /&gt;            SPListItem item = workflowProperties.Item;&lt;br /&gt;            item["DeliveryStatus"] = handleExternalEventActivity1_e1.DeliveryStatus;&lt;br /&gt;            if (String.Equals(handleExternalEventActivity1_e1.DeliveryStatus,&lt;br /&gt;                "Delivered", StringComparison.OrdinalIgnoreCase))&lt;br /&gt;            {&lt;br /&gt;                item["InvoiceStatus"] = "Invoiced";&lt;br /&gt;            }&lt;br /&gt;            item.Update();&lt;br /&gt;        }&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;blockquote&gt;&lt;br /&gt;&lt;p style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;&lt;/span&gt;&lt;span lang="EN-US"&gt;&lt;span lang="EN-US"&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;In the above code, we have used the value of the event arguments DeliveryStatus property to set list item’s delivery status field. Also we are checking if the order was delivered then raise the invoice to the customer. &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;p style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;8. The final step in this entire flow is to add some configurations to the target web applications web.config file to make the web application aware of our pluggable workflow service.&lt;br /&gt;&lt;br /&gt;Add the entries below to the &lt;strong&gt;WorkflowServices&lt;/strong&gt; tag under SharePoint section in the target web application.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-LEFT: 0px; PADDING-RIGHT: 0px; DISPLAY: inline; FLOAT: none; PADDING-TOP: 0px" id="scid:f32c3428-b7e9-4f15-a8ea-c502c7ff2e88:20da601f-dd8c-4303-ae1f-5d21315f81d8" class="wlWriterEditableSmartContent"&gt;&lt;pre class="brush: c#;"&gt;&amp;lt;WorkflowService Assembly="OrderTrackingSystem, Version=1.0.0.0, Culture=neutral, PublicKeyToken=YOUR_ASSEMLBLY_PKT" Class="OrderTrackingSystem.OrderTrackingService"&amp;gt;&lt;br /&gt;      &amp;lt;/WorkflowService&amp;gt;&lt;/pre&gt;&lt;/div&gt;&lt;span lang="EN-US"&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;&lt;img style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: block; FLOAT: none; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; MARGIN-LEFT: auto; BORDER-LEFT-WIDTH: 0px; MARGIN-RIGHT: auto" title="webconfigchanges" border="0" alt="webconfigchanges" src="http://lh5.ggpht.com/_eTkvhTLeDPY/TI0EhEpb5YI/AAAAAAAAAXY/wE8eHh2JDXI/webconfigchanges%5B8%5D.png?imgmax=800" width="740" height="155" /&gt;&lt;br /&gt;9. Hit F5 and deploy the solution.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;pre&gt;&lt;/pre&gt;&lt;p style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;10. Running the workflow on the item we created previously.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;&lt;img style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: block; FLOAT: none; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; MARGIN-LEFT: auto; BORDER-LEFT-WIDTH: 0px; MARGIN-RIGHT: auto" title="ItemStatus_final" border="0" alt="ItemStatus_final" src="http://lh4.ggpht.com/_eTkvhTLeDPY/TI0Eh0N7XhI/AAAAAAAAAXc/zo15iIz86QM/ItemStatus_final%5B7%5D.png?imgmax=800" width="640" height="37" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;The history list shows the following updates.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;&lt;img style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: block; FLOAT: none; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; MARGIN-LEFT: auto; BORDER-LEFT-WIDTH: 0px; MARGIN-RIGHT: auto" title="workflowhistoryupdate" border="0" alt="workflowhistoryupdate" src="http://lh3.ggpht.com/_eTkvhTLeDPY/TI0EihCHKxI/AAAAAAAAAXg/r1MwwrAlcLs/workflowhistoryupdate%5B6%5D.png?imgmax=800" width="640" height="115" /&gt; The Database receives a new entry via the Pluggable Workflow Service&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;&lt;img style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: block; FLOAT: none; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; MARGIN-LEFT: auto; BORDER-LEFT-WIDTH: 0px; MARGIN-RIGHT: auto" title="DatabaseEntry" border="0" alt="DatabaseEntry" src="http://lh3.ggpht.com/_eTkvhTLeDPY/TI0EjVQwwSI/AAAAAAAAAXk/65qeVFS6nQE/DatabaseEntry%5B6%5D.png?imgmax=800" width="640" height="91" /&gt; &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;/p&gt;&lt;p style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;Hope this series helped you to understand some basic concepts of creating a Pluggable Workflow Services.&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;span style="font-family:Calibri;"&gt;The associated code and other resources can be downloaded from here:&lt;/span&gt;&lt;br /&gt;&lt;iframe style="PADDING-BOTTOM: 0px; BACKGROUND-COLOR: #fcfcfc; PADDING-LEFT: 0px; WIDTH: 98px; PADDING-RIGHT: 0px; HEIGHT: 115px; PADDING-TOP: 0px" title="Preview" marginheight="0" src="http://cid-3a1504592747cd6e.office.live.com/embedicon.aspx/.Public/SharePoint/Pluggable%20Workflow%20Services" frameborder="0" marginwidth="0" scrolling="no"&gt;&lt;/iframe&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1377174316200906704-5401701003455282557?l=vivek-soni.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vivek-soni.blogspot.com/feeds/5401701003455282557/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vivek-soni.blogspot.com/2010/09/sharepoint-2010-pluggable-workflow_499.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1377174316200906704/posts/default/5401701003455282557'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1377174316200906704/posts/default/5401701003455282557'/><link rel='alternate' type='text/html' href='http://vivek-soni.blogspot.com/2010/09/sharepoint-2010-pluggable-workflow_499.html' title='SharePoint 2010 Pluggable Workflow Services – Part 2'/><author><name>Vivek</name><uri>http://www.blogger.com/profile/08310180297325901240</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_eTkvhTLeDPY/SnWbyjRk2rI/AAAAAAAAAQs/ElwvgOOCnfM/S220/DSC01417.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh6.ggpht.com/_eTkvhTLeDPY/TI0EZJj8yGI/AAAAAAAAAW4/mZ-fyOqVaHU/s72-c/LinqToSqlClass%5B6%5D.png?imgmax=800' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1377174316200906704.post-7874245098804205450</id><published>2010-09-12T05:17:00.001-07:00</published><updated>2010-09-12T10:29:06.085-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Workflows'/><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio 2010'/><category scheme='http://www.blogger.com/atom/ns#' term='SharePoint 2010'/><category scheme='http://www.blogger.com/atom/ns#' term='Pluggable Workflow Service'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>SharePoint 2010 Pluggable Workflow Services – Part 1</title><content type='html'>&lt;p style="MARGIN: 0cm 0cm 10pt" class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;Along with the many advancements and new features, SharePoint 2010 introduces a yet another important feature of Pluggable Workflow Services. While Pluggable Workflow Services have been around since Windows Workflow Foundation in .Net 3.5, its support was missing in SharePoint 2007. But now the SharePoint 2010 workflow engine supports it. &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="MARGIN: 0cm 0cm 10pt" class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;So what’s a Pluggable Workflow Service all about? &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="MARGIN: 0cm 0cm 10pt" class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;Here is what &lt;a href="http://msdn.microsoft.com/en-us/library/ee534969.aspx" target="_blank"&gt;MSDN&lt;/a&gt; says: &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="MARGIN: 0cm 0cm 10pt" class="MsoNormal"&gt;&lt;i style="mso-bidi-font-style: normal"&gt;&lt;span style="LINE-HEIGHT: 115%;font-family:'Segoe UI','sans-serif';font-size:9;color:black;" lang="EN-US"   &gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;Pluggable workflow services provide a mechanism that allows external applications or components to programmatically communicate with workflow instances currently running on the server. &lt;/span&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="MARGIN: 0cm 0cm 10pt" class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;This means that workflows in SharePoint 2010 now can interact with a wide variety of external events and allows a developer to control up to which point the workflow gets executed and waits for information from an external process. &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="MARGIN: 0cm 0cm 10pt" class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;Now when you say that the workflow instance&lt;i style="mso-bidi-font-style: normal"&gt; waits for information from an external process, &lt;/i&gt;it doesn’t mean that the workflow instance needs to wait in an active state and consume server resources (like CPU, RAM etc.) till the time it gets the response back. The workflow instance would be &lt;i style="mso-bidi-font-style: normal"&gt;dehydrated&lt;/i&gt; (aka the state of the workflow instance would be written to the database) and &lt;i style="mso-bidi-font-style: normal"&gt;rehydrated&lt;/i&gt; back (aka workflow instance state read back from the database) once the external activity gets completed. &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="MARGIN: 0cm 0cm 10pt" class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;In this post I will attempt to explain a simple pluggable workflow service taking an order tracking system as an example. The order tracking system implements a sequential workflow which gets started as soon as a new order request is created. This workflow tracks the delivery status and the invoice status for a particular order. &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="MARGIN: 0cm 0cm 10pt" class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;When a new order request is created (via SharePoint list), the workflow calls a pluggable workflow service which tracks whether the order was delivered to the customer or not (creating a new database table entry) and accordingly updates the workflow about this information. &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="MARGIN: 0cm 0cm 10pt" class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;For running this example, you would need to&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;span lang="EN-US"&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;Restore ContosoOrderTracking.sql script for creating the ContosoOrderTracking database. &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span lang="EN-US"&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;Create an Orders list using the Orders.stp list definition.&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;span lang="EN-US"&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;span lang="EN-US"&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;Create a Sequential Workflow &lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;ol&gt;&lt;li&gt;&lt;span style="font-family:Calibri;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span lang="EN-US"&gt;Open visual Studio 2010, Select New-&amp;gt;Project.&lt;/span&gt; &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span lang="EN-US"&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;Under the installed templates, select the SharePoint -&amp;gt; 2010. &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span lang="EN-US"&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;Select the Empty SharePoint Project Template and enter the project name as &lt;strong&gt;OrderTrackingSystem&lt;/strong&gt; and click OK. &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span lang="EN-US"&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;Enter the target site collection name for debugging purpose. Now, since we are going to create a Visual Studio workflow, we need to deploy this solution as a farm solution. &lt;/span&gt;&lt;/span&gt;&lt;span lang="EN-US"&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;&lt;img style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: block; FLOAT: none; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; MARGIN-LEFT: auto; BORDER-LEFT-WIDTH: 0px; MARGIN-RIGHT: auto" title="DeploymentType" border="0" alt="DeploymentType" src="http://lh4.ggpht.com/_eTkvhTLeDPY/TIzEq16gj2I/AAAAAAAAAWM/M8cTS_BaGGI/DeploymentType30.png?imgmax=800" width="340" height="242" /&gt; &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;&lt;span lang="EN-US"&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span lang="EN-US"&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span lang="EN-US"&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span lang="EN-US"&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span lang="EN-US"&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span lang="EN-US"&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span lang="EN-US"&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span lang="EN-US"&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;5. Click Finish&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span lang="EN-US"&gt;&lt;/span&gt;&lt;span lang="EN-US"&gt;&lt;span lang="EN-US"&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;At this point we have a bare metal SharePoint solution ready. Now we will add a new Sequential Workflow SPI (SharePoint Items) to this solution.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Calibri;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span lang="EN-US"&gt;&lt;span lang="EN-US"&gt;6. &lt;/span&gt;&lt;/span&gt;&lt;span lang="EN-US"&gt;&lt;span lang="EN-US"&gt;&lt;span lang="EN-US"&gt;Add a new item and select Sequential Workflow and name it &lt;b style="mso-bidi-font-weight: normal"&gt;OrderTracking.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;&lt;span lang="EN-US"&gt;&lt;span lang="EN-US"&gt;&lt;span lang="EN-US"&gt;&lt;img style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: block; FLOAT: none; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; MARGIN-LEFT: auto; BORDER-LEFT-WIDTH: 0px; MARGIN-RIGHT: auto" title="AddSequentialWF" border="0" alt="AddSequentialWF" src="http://lh5.ggpht.com/_eTkvhTLeDPY/TIzErnHuwqI/AAAAAAAAAWQ/IPjOjTrezbw/AddSequentialWF5.png?imgmax=800" width="340" height="217" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="mso-bidi-: minor-latin;font-family:calibri;" lang="EN-US" &gt;&lt;span style="mso-list: ignore"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;7. Click Add.&lt;br /&gt;8. Name the workflow as &lt;strong&gt;Order Tracking &lt;/strong&gt;and leave the workflow type as List Workflow.&lt;img style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: block; FLOAT: none; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; MARGIN-LEFT: auto; BORDER-LEFT-WIDTH: 0px; MARGIN-RIGHT: auto" title="WorkFlowType" border="0" alt="WorkFlowType" src="http://lh5.ggpht.com/_eTkvhTLeDPY/TIzEsehz6pI/AAAAAAAAAWU/Gz_24RL-Eqw/WorkFlowType5.png?imgmax=800" width="340" height="242" /&gt; &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;9. Click Next.&lt;br /&gt;10. From the library or list dropdown, select the Orders list (as shown below) which you created using the attached stp file and leave the other selections as is.&lt;img style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: block; FLOAT: none; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; MARGIN-LEFT: auto; BORDER-LEFT-WIDTH: 0px; MARGIN-RIGHT: auto" title="SelectList" border="0" alt="SelectList" src="http://lh5.ggpht.com/_eTkvhTLeDPY/TIzEtcIvXBI/AAAAAAAAAWY/mdx3ZWifV9E/SelectList5.png?imgmax=800" width="340" height="242" /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;11. Click Next.&lt;br /&gt;12. We want this workflow to get started on new item creation as well as manually. Leave the current selections default and click Finish.&lt;img style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: block; FLOAT: none; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; MARGIN-LEFT: auto; BORDER-LEFT-WIDTH: 0px; MARGIN-RIGHT: auto" title="ConditionToStart" border="0" alt="ConditionToStart" src="http://lh4.ggpht.com/_eTkvhTLeDPY/TIzEuBw7c5I/AAAAAAAAAWc/vKsAqlny-5Q/ConditionToStart5.png?imgmax=800" width="340" height="242" /&gt; &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Calibri;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span lang="EN-US"&gt;At this point our solution should look like as shown below. Before we move ahead, we would need to make some changes to this solution for consistency.&lt;/span&gt;&lt;img style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: block; FLOAT: none; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; MARGIN-LEFT: auto; BORDER-LEFT-WIDTH: 0px; MARGIN-RIGHT: auto" title="SolutionStructure" border="0" alt="SolutionStructure" src="http://lh5.ggpht.com/_eTkvhTLeDPY/TIzEuhkGlrI/AAAAAAAAAWg/PxmoeJNSUCk/SolutionStructure4.png?imgmax=800" width="240" height="187" /&gt;&lt;br /&gt;&lt;br /&gt;13. Rename the Feature1 to a sensible name as &lt;strong&gt;OrderTrackingWorkflow&lt;/strong&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="MARGIN: 0cm 0cm 10pt" class="MsoNormal"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span lang="EN-US"&gt;At this point we are done creating a very basic SharePoint sequential workflow solution. You can optionally hit F5 to ensure that everything is fine which I am sure it would be &lt;/span&gt;&lt;span style="FONT-FAMILY: wingdings; mso-ascii-font-family: calibri; mso-hansi-font-family: calibri; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-char-type: symbolfont-family:wingdings;" lang="EN-US" &gt;&lt;span style="mso-char-type: symbol;font-family:wingdings;" &gt;J&lt;/span&gt;&lt;/span&gt;&lt;span lang="EN-US"&gt;. &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="MARGIN: 0cm 0cm 10pt" class="MsoNormal"&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;span lang="EN-US"&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;Creating a Business Object &lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="MARGIN: 0cm 0cm 10pt" class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;Now we will need a custom business object “&lt;b style="mso-bidi-font-weight: normal"&gt;Order&lt;/b&gt;” which can encapsulate the order information and makes it easy for us to communicate with our workflow and the Pluggable Workflow Service. &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;ol&gt;&lt;li&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;Add a new class Order to our workflow solution. &lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;We will add 6 properties to our order class representing the attributes of an order namely ID, Title, Quantity, Amount, Customer, DeliveryStatus. &lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;Since we are dealing with a workflow where persisting the object state is a must, we would need to make Order class Serializable by implementing ISerializable interface and decorate it with Serializable attribute. &lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;Also we would need to implement the GetObjectData method for serializing the object and the default constructer to deserialize it.&lt;br /&gt;At this point the Order class should look like this. &lt;/span&gt;&lt;/li&gt;&lt;div style="PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-LEFT: 0px; PADDING-RIGHT: 0px; DISPLAY: inline; FLOAT: none; PADDING-TOP: 0px" id="scid:f32c3428-b7e9-4f15-a8ea-c502c7ff2e88:9f138662-592b-43c2-897b-c027a0db49c0" class="wlWriterEditableSmartContent"&gt;&lt;pre class="brush: c#;gutter:false;"&gt;using System;&lt;br /&gt;using System.Runtime.Serialization;&lt;br /&gt;&lt;br /&gt;[Serializable()]&lt;br /&gt;    public class Order : ISerializable&lt;br /&gt;    {&lt;br /&gt;        public string ID { get; set; }&lt;br /&gt;        public string Title { get; set; }&lt;br /&gt;        public string Quantity { get; set; }&lt;br /&gt;        public string CustomerName { get; set; }&lt;br /&gt;        public string Amount { get; set; }&lt;br /&gt;        public string DeliveryStatus { get; set; }&lt;br /&gt;&lt;br /&gt;        public Order()&lt;br /&gt;        {}&lt;br /&gt;&lt;br /&gt;        public Order(SerializationInfo info, StreamingContext context)&lt;br /&gt;        {&lt;br /&gt;            ID = (string)info.GetValue("ID", typeof(string));&lt;br /&gt;            Title = (string)info.GetValue("Title", typeof(string));&lt;br /&gt;            Quantity = (string)info.GetValue("Quantity", typeof(string));&lt;br /&gt;            CustomerName = (string)info.GetValue("CustomerName", typeof(string));&lt;br /&gt;            Amount = (string)info.GetValue("Amount", typeof(string));&lt;br /&gt;            DeliveryStatus = (string)info.GetValue("DeliveryStatus", typeof(string));&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        public void GetObjectData(SerializationInfo info, StreamingContext context)&lt;br /&gt;        {&lt;br /&gt;            info.AddValue("ID", ID);&lt;br /&gt;            info.AddValue("Title", Title);&lt;br /&gt;            info.AddValue("Quantity", Quantity);&lt;br /&gt;            info.AddValue("CustomerName", CustomerName);&lt;br /&gt;            info.AddValue("Amount", Amount);&lt;br /&gt;            info.AddValue("DeliveryStatus", DeliveryStatus);&lt;br /&gt;        }&lt;br /&gt;    }&lt;/pre&gt;&lt;/div&gt;&lt;/ol&gt;&lt;p&gt;&lt;span lang="EN-US"   style="font-family:consolas;font-size:9;"&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;span lang="EN-US"&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;Adding Life to thee Workflow &lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span lang="EN-US"   style="font-family:consolas;font-size:9;"&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;span lang="EN-US"&gt;&lt;/span&gt;&lt;/b&gt;&lt;span lang="EN-US"&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;Now we will add some activities to the sequential workflow we created above.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; &lt;ol&gt;&lt;li&gt;&lt;div style="MARGIN: 0cm 0cm 10pt 36pt" class="MsoListParagraph"&gt;&lt;span lang="EN-US"&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;Switch to the workflow design view and drag and drop a Code and &lt;strong&gt;LogToHistoryList&lt;/strong&gt; activity on the design surface.&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Calibri;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span lang="EN-US"&gt;&lt;img style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: block; FLOAT: none; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; MARGIN-LEFT: auto; BORDER-LEFT-WIDTH: 0px; MARGIN-RIGHT: auto" title="WorkflowDesign_part1" border="0" alt="WorkflowDesign_part1" src="http://lh5.ggpht.com/_eTkvhTLeDPY/TIzEvQBDijI/AAAAAAAAAWk/OZeLg_PvD9g/WorkflowDesign_part15.png?imgmax=800" width="169" height="240" /&gt;&lt;/span&gt;&lt;span lang="EN-US"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt 36pt; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span lang="EN-US"   style="font-family:consolas;font-size:9;"&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;2. Right click in &lt;strong&gt;codeActivity1 &lt;/strong&gt;and click &lt;strong&gt;Generate Handlers &lt;/strong&gt;from the menu. This will add a code behind method for this activity.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt 36pt; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span lang="EN-US"   style="font-family:consolas;font-size:9;"&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;3. Back in the code create in instance of the Order class.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style="PADDING-BOTTOM: 0px; PADDING-LEFT: 0px; WIDTH: 450px; PADDING-RIGHT: 0px; DISPLAY: block; FLOAT: none; HEIGHT: 14px; MARGIN-LEFT: auto; MARGIN-RIGHT: auto; PADDING-TOP: 0px" id="scid:f32c3428-b7e9-4f15-a8ea-c502c7ff2e88:c344ec17-ea2f-4d51-857e-62e0c3eafbe8" class="wlWriterEditableSmartContent"&gt;&lt;pre class="brush: text;"&gt;public Order order = new OrderTrackingSystem.Order();&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;&lt;p style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt 36pt; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span lang="EN-US"   style="font-family:consolas;font-size:9;"&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;4. Also the following code to the &lt;strong&gt;codeActivity1_ExecuteCode &lt;/strong&gt;method.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt 36pt; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;In the code below we are taking the current list item on which the workflow is running and initializing the order object with the required properties. Also we are updating the list item DeliveryStaus choice field to Dispatched indicating that the order has been dispatched to the customer.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="PADDING-BOTTOM: 0px; PADDING-LEFT: 0px; WIDTH: 528px; PADDING-RIGHT: 0px; DISPLAY: block; FLOAT: none; MARGIN-LEFT: auto; MARGIN-RIGHT: auto; PADDING-TOP: 0px" id="scid:f32c3428-b7e9-4f15-a8ea-c502c7ff2e88:cb029f6e-aac5-44a3-ac79-025f90689224" class="wlWriterEditableSmartContent"&gt;&lt;pre class="brush: text;"&gt;private void codeActivity1_ExecuteCode(object sender, EventArgs e)&lt;br /&gt;        {&lt;br /&gt;            SPListItem item = workflowProperties.Item;&lt;br /&gt;            order.Title = item.Title;&lt;br /&gt;            order.ID = item.UniqueId.ToString();&lt;br /&gt;            order.Quantity = item["Quantity"].ToString();&lt;br /&gt;            order.Amount = item["Amount"].ToString();&lt;br /&gt;            order.CustomerName = item["CustomerName"].ToString();&lt;br /&gt;&lt;br /&gt;            item["DeliveryStatus"] = "Dispatched";&lt;br /&gt;            item.Update();&lt;br /&gt;        }&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt 36pt; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span lang="EN-US"   style="font-family:consolas;font-size:9;"&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;5. At this point it would be a good idea to update the workflow history list with a status message. Repeat #2 to generate handlers for logToHistoryListActivity1 and add the following code.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style="PADDING-BOTTOM: 0px; PADDING-LEFT: 0px; WIDTH: 648px; PADDING-RIGHT: 0px; DISPLAY: block; FLOAT: none; MARGIN-LEFT: auto; MARGIN-RIGHT: auto; PADDING-TOP: 0px" id="scid:f32c3428-b7e9-4f15-a8ea-c502c7ff2e88:f7c57fcc-46ef-4403-ade0-26828599489e" class="wlWriterEditableSmartContent"&gt;&lt;pre class="brush: html;collapse:true;"&gt;private void logToHistoryListActivity1_MethodInvoking(object sender, EventArgs e)&lt;br /&gt;        {&lt;br /&gt;            logToHistoryListActivity1.HistoryDescription = "Order dispatched to the customer.";&lt;br /&gt;        }&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;&lt;p style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt 36pt; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span lang="EN-US"   style="font-family:consolas;font-size:9;"&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;style type="text/css"&gt;&lt;br /&gt;.csharpcode, .csharpcode pre&lt;br /&gt;{&lt;br /&gt; font-size: small;&lt;br /&gt; color: black;&lt;br /&gt; font-family: consolas, "Courier New", courier, monospace;&lt;br /&gt; background-color: #ffffff;&lt;br /&gt; /*white-space: pre;*/&lt;br /&gt;}&lt;br /&gt;.csharpcode pre { margin: 0em; }&lt;br /&gt;.csharpcode .rem { color: #008000; }&lt;br /&gt;.csharpcode .kwrd { color: #0000ff; }&lt;br /&gt;.csharpcode .str { color: #006080; }&lt;br /&gt;.csharpcode .op { color: #0000c0; }&lt;br /&gt;.csharpcode .preproc { color: #cc6633; }&lt;br /&gt;.csharpcode .asp { background-color: #ffff00; }&lt;br /&gt;.csharpcode .html { color: #800000; }&lt;br /&gt;.csharpcode .attr { color: #ff0000; }&lt;br /&gt;.csharpcode .alt&lt;br /&gt;{&lt;br /&gt; background-color: #f4f4f4;&lt;br /&gt; width: 100%;&lt;br /&gt; margin: 0em;&lt;br /&gt;}&lt;br /&gt;.csharpcode .lnum { color: #606060; }&lt;/style&gt;&lt;br /&gt;&lt;p style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt 36pt; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span lang="EN-US"   style="font-family:consolas;font-size:9;"&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt 36pt; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span lang="EN-US"   style="font-family:consolas;font-size:9;"&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;6. Put a break point in &lt;strong&gt;codeActivity1_ExecuteCode &lt;/strong&gt;hit F5 to deploy and debug the solution.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt 36pt; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span lang="EN-US"   style="font-family:consolas;font-size:9;"&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;span lang="EN-US"   style="font-family:consolas;font-size:9;"&gt;&lt;p style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span lang="EN-US"   style="font-family:consolas;font-size:9;"&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span lang="EN-US"   style="font-family:consolas;font-size:9;"&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;Now let’s add a new item to the Orders list and see if the workflow is functioning properly. &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;&lt;/span&gt;&lt;span lang="EN-US"   style="font-family:consolas;font-size:9;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;&lt;img style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: block; FLOAT: none; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; MARGIN-LEFT: auto; BORDER-LEFT-WIDTH: 0px; MARGIN-RIGHT: auto" title="NewItem" border="0" alt="NewItem" src="http://lh5.ggpht.com/_eTkvhTLeDPY/TIzEwDVAu4I/AAAAAAAAAWo/TGSn1ocMz20/NewItem6.png?imgmax=800" width="340" height="265" /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;As soon as you save the above item, the break point in our workflow gets hit where you can further play around and see the runtime properties of the objects. Further hit F5 to come out of debugging mode.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;&lt;/span&gt;&lt;span lang="EN-US"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;&lt;img style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: block; FLOAT: none; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; MARGIN-LEFT: auto; BORDER-LEFT-WIDTH: 0px; MARGIN-RIGHT: auto" title="DebugCode" border="0" alt="DebugCode" src="http://lh6.ggpht.com/_eTkvhTLeDPY/TIzEw6zSMfI/AAAAAAAAAWs/y7hMr7AdJu0/DebugCode6.png?imgmax=800" width="340" height="118" /&gt; &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;span lang="EN-US"&gt;&lt;p&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;This will complete you workflow on the item you created above and now the DeliveryStatus field shows Dispatched. Also the workflow status field show Completed.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;&lt;/span&gt;&lt;span lang="EN-US"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;&lt;img style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: block; FLOAT: none; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; MARGIN-LEFT: auto; BORDER-LEFT-WIDTH: 0px; MARGIN-RIGHT: auto" title="ItemStatus" border="0" alt="ItemStatus" src="http://lh6.ggpht.com/_eTkvhTLeDPY/TIzEyEM9e-I/AAAAAAAAAWw/_qasUMhuvRc/ItemStatus6.png?imgmax=800" width="640" height="40" /&gt; &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;/span&gt;&lt;p style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;Also clicking on this &lt;strong&gt;Completed&lt;/strong&gt; link will navigate you to page below where you can see the status page of the workflow where we can see the comments in workflow history.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;&lt;/span&gt;&lt;span lang="EN-US"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;&lt;img style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: block; FLOAT: none; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; MARGIN-LEFT: auto; BORDER-LEFT-WIDTH: 0px; MARGIN-RIGHT: auto" title="WorkflowStatus" border="0" alt="WorkflowStatus" src="http://lh3.ggpht.com/_eTkvhTLeDPY/TIzEzOfGwDI/AAAAAAAAAW0/803RI6QIYdo/WorkflowStatus6.png?imgmax=800" width="640" height="351" /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;/span&gt;&lt;p&gt;&lt;span style="font-family:Calibri;"&gt;In the &lt;a href="http://vivek-soni.blogspot.com/2010/09/sharepoint-2010-pluggable-workflow_499.html"&gt;next post &lt;/a&gt;we will dive into the details of creating a Pluggable Workflow Service.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Calibri;"&gt;The associated code and other resources can be downloaded from here:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;iframe style="PADDING-BOTTOM: 0px; BACKGROUND-COLOR: #fcfcfc; PADDING-LEFT: 0px; WIDTH: 98px; PADDING-RIGHT: 0px; HEIGHT: 115px; PADDING-TOP: 0px" title="Preview" marginheight="0" src="http://cid-3a1504592747cd6e.office.live.com/embedicon.aspx/.Public/SharePoint/Pluggable%20Workflow%20Services" frameborder="0" marginwidth="0" scrolling="no"&gt;&lt;/iframe&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1377174316200906704-7874245098804205450?l=vivek-soni.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vivek-soni.blogspot.com/feeds/7874245098804205450/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vivek-soni.blogspot.com/2010/09/sharepoint-2010-pluggable-workflow_12.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1377174316200906704/posts/default/7874245098804205450'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1377174316200906704/posts/default/7874245098804205450'/><link rel='alternate' type='text/html' href='http://vivek-soni.blogspot.com/2010/09/sharepoint-2010-pluggable-workflow_12.html' title='SharePoint 2010 Pluggable Workflow Services – Part 1'/><author><name>Vivek</name><uri>http://www.blogger.com/profile/08310180297325901240</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_eTkvhTLeDPY/SnWbyjRk2rI/AAAAAAAAAQs/ElwvgOOCnfM/S220/DSC01417.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh4.ggpht.com/_eTkvhTLeDPY/TIzEq16gj2I/AAAAAAAAAWM/M8cTS_BaGGI/s72-c/DeploymentType30.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1377174316200906704.post-4602714427008447044</id><published>2010-08-01T07:51:00.000-07:00</published><updated>2010-08-01T07:52:10.321-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SharePoint Publishing'/><category scheme='http://www.blogger.com/atom/ns#' term='SharePoint 2007'/><category scheme='http://www.blogger.com/atom/ns#' term='SharePoint Feature'/><title type='text'>Duplicate name error while creating SharePoint publishing page instance</title><content type='html'>&lt;p style="line-height: normal; margin: 0cm 0cm 0pt" class="MsoNormal"&gt;&lt;span style="color: #1f497d; mso-ascii-font-family: calibri; mso-fareast-font-family: &amp;#39;Times New Roman&amp;#39;; mso-hansi-font-family: calibri; mso-bidi-font-family: calibri; mso-fareast-language: en-in" lang="EN-US"&gt;&lt;font face="Calibri"&gt;&lt;font size="3"&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height: normal; margin: 0cm 0cm 0pt" class="MsoNormal"&gt;&lt;span style="color: #1f497d; mso-ascii-font-family: calibri; mso-fareast-font-family: &amp;#39;Times New Roman&amp;#39;; mso-hansi-font-family: calibri; mso-bidi-font-family: calibri; mso-fareast-language: en-in" lang="EN-US"&gt;&lt;font color="#000000" size="3" face="Calibri"&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height: normal; margin: 0cm 0cm 0pt" class="MsoNormal"&gt;&lt;span style="color: #1f497d; mso-ascii-font-family: calibri; mso-fareast-font-family: &amp;#39;Times New Roman&amp;#39;; mso-hansi-font-family: calibri; mso-bidi-font-family: calibri; mso-fareast-language: en-in" lang="EN-US"&gt;&lt;font color="#000000" size="3" face="Calibri"&gt;Most of the time you would always find some or the other issues while deploying your solution components from dev environment to any other environment like authoring or staging. &lt;/font&gt;&lt;/span&gt;&lt;span style="color: #1f497d; mso-ascii-font-family: calibri; mso-fareast-font-family: &amp;#39;Times New Roman&amp;#39;; mso-hansi-font-family: calibri; mso-bidi-font-family: calibri; mso-fareast-language: en-in" lang="EN-US"&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="3" face="Calibri"&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="line-height: normal; margin: 0cm 0cm 0pt" class="MsoNormal"&gt;&lt;span style="color: #1f497d; mso-ascii-font-family: calibri; mso-fareast-font-family: &amp;#39;Times New Roman&amp;#39;; mso-hansi-font-family: calibri; mso-bidi-font-family: calibri; mso-fareast-language: en-in" lang="EN-US"&gt;&lt;font color="#000000" size="3" face="Calibri"&gt;A couple of days before, we encountered one such issue while creating page instances using our custom content types on authoring environment. The error we encountered was &lt;/font&gt;&lt;/span&gt;&lt;span style="color: #1f497d; mso-ascii-font-family: calibri; mso-fareast-font-family: &amp;#39;Times New Roman&amp;#39;; mso-hansi-font-family: calibri; mso-bidi-font-family: calibri; mso-fareast-language: en-in" lang="EN-US"&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="3" face="Calibri"&gt;&lt;/font&gt;&lt;/p&gt;  &lt;blockquote&gt;   &lt;p style="line-height: normal; margin: 0cm 0cm 0pt" class="MsoNormal"&gt;&lt;font color="#000000" size="3" face="Calibri"&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;i style="mso-bidi-font-style: normal"&gt;&lt;span style="color: #e36c0a; mso-ascii-font-family: calibri; mso-fareast-font-family: &amp;#39;Times New Roman&amp;#39;; mso-hansi-font-family: calibri; mso-bidi-font-family: calibri; mso-fareast-language: en-in; mso-themecolor: accent6; mso-themeshade: 191" lang="EN-US"&gt;A duplicate name “YOUR CONTENT TYPE NAME” was found. at Microsoft.SharePoint.Publishing.Internal.Codebehind.CreatePagePage.HandleUnexpectedException(PublishingPage newPage, Exception exception)….&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;/font&gt;&lt;/p&gt;    &lt;p&gt;&lt;font color="#e36c0a" size="3" face="Calibri"&gt;&lt;/font&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p style="line-height: normal; margin: 0cm 0cm 0pt" class="MsoNormal"&gt;&lt;font color="#000000"&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;&lt;span style="color: #1f497d; mso-ascii-font-family: calibri; mso-fareast-font-family: &amp;#39;Times New Roman&amp;#39;; mso-hansi-font-family: calibri; mso-bidi-font-family: calibri; mso-fareast-language: en-in" lang="EN-US"&gt;&lt;font color="#000000"&gt;Also this error also wouldn’t even let the content deployment job to succeed&lt;/font&gt;.&lt;/span&gt;&lt;span style="color: black; font-size: 12pt; mso-ascii-font-family: calibri; mso-fareast-font-family: &amp;#39;Times New Roman&amp;#39;; mso-hansi-font-family: calibri; mso-bidi-font-family: calibri; mso-fareast-language: en-in" lang="EN-US"&gt;&lt;/span&gt; &lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="3" face="Calibri"&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="3" face="Calibri"&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="3" face="Calibri"&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="line-height: normal; margin: 0cm 0cm 0pt" class="MsoNormal"&gt;&lt;span style="color: black; font-size: 12pt; mso-ascii-font-family: calibri; mso-fareast-font-family: &amp;#39;Times New Roman&amp;#39;; mso-hansi-font-family: calibri; mso-bidi-font-family: calibri; mso-ansi-language: en-in; mso-fareast-language: en-in; mso-no-proof: yes"&gt;&lt;shapetype id="_x0000_t75" coordsize="21600,21600" o:spt="75" o:preferrelative="t" path="m@4@5l@4@11@9@11@9@5xe" filled="f" stroked="f"&gt;&lt;stroke joinstyle="miter"&gt;&lt;/stroke&gt;&lt;formulas&gt;&lt;f eqn="if lineDrawn pixelLineWidth 0"&gt;&lt;/f&gt;&lt;f eqn="sum @0 1 0"&gt;&lt;/f&gt;&lt;f eqn="sum 0 0 @1"&gt;&lt;/f&gt;&lt;f eqn="prod @2 1 2"&gt;&lt;/f&gt;&lt;f eqn="prod @3 21600 pixelWidth"&gt;&lt;/f&gt;&lt;f eqn="prod @3 21600 pixelHeight"&gt;&lt;/f&gt;&lt;f eqn="sum @0 0 1"&gt;&lt;/f&gt;&lt;f eqn="prod @6 1 2"&gt;&lt;/f&gt;&lt;f eqn="prod @7 21600 pixelWidth"&gt;&lt;/f&gt;&lt;f eqn="sum @8 21600 0"&gt;&lt;/f&gt;&lt;f eqn="prod @7 21600 pixelHeight"&gt;&lt;/f&gt;&lt;f eqn="sum @10 21600 0"&gt;&lt;/f&gt;&lt;/formulas&gt;&lt;path o:extrusionok="f" gradientshapeok="t" o:connecttype="rect"&gt;&lt;/path&gt;&lt;lock v:ext="edit" aspectratio="t"&gt;&lt;/lock&gt;&lt;/shapetype&gt;&lt;shape style="width: 451.5pt; height: 180pt; visibility: visible; mso-wrap-style: square" id="Picture_x0020_5" o:spid="_x0000_i1025" type="#_x0000_t75"&gt;&lt;imagedata src="file:///C:\Users\Vivek\AppData\Local\Temp\msohtmlclip1\01\clip_image001.png" o:title="o:title"&gt;&lt;/imagedata&gt;&lt;/shape&gt;&lt;font size="3" face="Calibri"&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color: black; font-size: 12pt; mso-ascii-font-family: calibri; mso-fareast-font-family: &amp;#39;Times New Roman&amp;#39;; mso-hansi-font-family: calibri; mso-bidi-font-family: calibri; mso-fareast-language: en-in" lang="EN-US"&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="3" face="Calibri"&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="3" face="Calibri"&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="3" face="Calibri"&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="line-height: normal; margin: 0cm 0cm 0pt" class="MsoNormal"&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;&lt;font color="#000000"&gt;&lt;span style="color: #1f497d; mso-ascii-font-family: calibri; mso-fareast-font-family: &amp;#39;Times New Roman&amp;#39;; mso-hansi-font-family: calibri; mso-bidi-font-family: calibri; mso-fareast-language: en-in" lang="EN-US"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="pageinstanceerror" border="0" alt="pageinstanceerror" src="http://lh6.ggpht.com/_eTkvhTLeDPY/TFOq3wPboeI/AAAAAAAAAVk/aFrz-Dhgk-U/pageinstanceerror%5B6%5D.png?imgmax=800" width="667" height="266" /&gt; &lt;/span&gt;&lt;span style="color: black; font-size: 12pt; mso-ascii-font-family: calibri; mso-fareast-font-family: &amp;#39;Times New Roman&amp;#39;; mso-hansi-font-family: calibri; mso-bidi-font-family: calibri; mso-fareast-language: en-in" lang="EN-US"&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="3" face="Calibri"&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="3" face="Calibri"&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="3" face="Calibri"&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="line-height: normal; margin: 0cm 0cm 0pt" class="MsoNormal"&gt;&lt;span style="color: #1f497d; mso-ascii-font-family: calibri; mso-fareast-font-family: &amp;#39;Times New Roman&amp;#39;; mso-hansi-font-family: calibri; mso-bidi-font-family: calibri; mso-fareast-language: en-in" lang="EN-US"&gt;&lt;font size="3" face="Calibri"&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height: normal; margin: 0cm 0cm 0pt" class="MsoNormal"&gt;&lt;span style="color: #1f497d; mso-ascii-font-family: calibri; mso-fareast-font-family: &amp;#39;Times New Roman&amp;#39;; mso-hansi-font-family: calibri; mso-bidi-font-family: calibri; mso-fareast-language: en-in" lang="EN-US"&gt;&lt;font color="#000000" size="3" face="Calibri"&gt;After scratching my head for a couple of hours I finally found the issue/resolution and thought to share the same with the community. &lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height: normal; margin: 0cm 0cm 0pt" class="MsoNormal"&gt;&lt;span style="color: #1f497d; mso-ascii-font-family: calibri; mso-fareast-font-family: &amp;#39;Times New Roman&amp;#39;; mso-hansi-font-family: calibri; mso-bidi-font-family: calibri; mso-fareast-language: en-in" lang="EN-US"&gt;&lt;/span&gt;&lt;font color="#000000"&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;&lt;span style="color: #1f497d; mso-ascii-font-family: calibri; mso-fareast-font-family: &amp;#39;Times New Roman&amp;#39;; mso-hansi-font-family: calibri; mso-bidi-font-family: calibri; mso-fareast-language: en-in" lang="EN-US"&gt;&lt;font color="#000000"&gt;The issue circles around the &lt;b&gt;Content Type Association&lt;/b&gt; feature which we leveraged to binds our custom content type instance with the MOSS &lt;b&gt;Pages&lt;/b&gt; library&lt;/font&gt;. &lt;/span&gt;&lt;span style="color: black; font-size: 12pt; mso-ascii-font-family: calibri; mso-fareast-font-family: &amp;#39;Times New Roman&amp;#39;; mso-hansi-font-family: calibri; mso-bidi-font-family: calibri; mso-fareast-language: en-in" lang="EN-US"&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="3" face="Calibri"&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="3" face="Calibri"&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="3" face="Calibri"&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="line-height: normal; margin: 0cm 0cm 0pt" class="MsoNormal"&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;&lt;span style="color: #1f497d; mso-ascii-font-family: calibri; mso-fareast-font-family: &amp;#39;Times New Roman&amp;#39;; mso-hansi-font-family: calibri; mso-bidi-font-family: calibri; mso-fareast-language: en-in" lang="EN-US"&gt;&lt;/span&gt;&lt;span style="color: black; font-size: 12pt; mso-ascii-font-family: calibri; mso-fareast-font-family: &amp;#39;Times New Roman&amp;#39;; mso-hansi-font-family: calibri; mso-bidi-font-family: calibri; mso-fareast-language: en-in" lang="EN-US"&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="3" face="Calibri"&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="3" face="Calibri"&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="3" face="Calibri"&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="line-height: normal; margin: 0cm 0cm 0pt" class="MsoNormal"&gt;&lt;font size="3" face="Calibri"&gt;&lt;b&gt;&lt;span style="color: #984806; mso-ascii-font-family: calibri; mso-fareast-font-family: &amp;#39;Times New Roman&amp;#39;; mso-hansi-font-family: calibri; mso-bidi-font-family: calibri; mso-fareast-language: en-in" lang="EN-US"&gt;Background:&lt;/span&gt;&lt;/b&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="line-height: normal; margin: 0cm 0cm 0pt" class="MsoNormal"&gt;&lt;font size="3"&gt;&lt;b&gt;&lt;span style="color: #984806; mso-ascii-font-family: calibri; mso-fareast-font-family: &amp;#39;Times New Roman&amp;#39;; mso-hansi-font-family: calibri; mso-bidi-font-family: calibri; mso-fareast-language: en-in" lang="EN-US"&gt;&lt;/span&gt;&lt;/b&gt;&lt;/font&gt;&lt;span style="color: #1f497d; mso-ascii-font-family: calibri; mso-fareast-font-family: &amp;#39;Times New Roman&amp;#39;; mso-hansi-font-family: calibri; mso-bidi-font-family: calibri; mso-fareast-language: en-in" lang="EN-US"&gt;&lt;font color="#000000" size="3" face="Calibri"&gt;The content types we created for sprint 1 &lt;span style="mso-bidi-font-weight: bold"&gt;inherited from MOSS&lt;b&gt; Page &lt;/b&gt;content type&lt;/span&gt; and accordingly they we associated them with the designated page layouts, packaged and deployed on authoring environment.&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height: normal; margin: 0cm 0cm 0pt" class="MsoNormal"&gt;&lt;font color="#000000"&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;&lt;span style="color: #1f497d; mso-ascii-font-family: calibri; mso-fareast-font-family: &amp;#39;Times New Roman&amp;#39;; mso-hansi-font-family: calibri; mso-bidi-font-family: calibri; mso-fareast-language: en-in" lang="EN-US"&gt;&lt;i style="mso-bidi-font-style: normal"&gt;&lt;font color="#000000"&gt;Everything worked fine here!!&lt;/font&gt;&lt;/i&gt;&lt;/span&gt;&lt;i style="mso-bidi-font-style: normal"&gt;&lt;span style="color: black; font-size: 12pt; mso-ascii-font-family: calibri; mso-fareast-font-family: &amp;#39;Times New Roman&amp;#39;; mso-hansi-font-family: calibri; mso-bidi-font-family: calibri; mso-fareast-language: en-in" lang="EN-US"&gt; &lt;/span&gt;&lt;/i&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="line-height: normal; margin: 0cm 0cm 0pt" class="MsoNormal"&gt;&lt;font size="3" face="Calibri"&gt;&lt;i style="mso-bidi-font-style: normal"&gt;&lt;span style="color: black; font-size: 12pt; mso-ascii-font-family: calibri; mso-fareast-font-family: &amp;#39;Times New Roman&amp;#39;; mso-hansi-font-family: calibri; mso-bidi-font-family: calibri; mso-fareast-language: en-in" lang="EN-US"&gt;&lt;/span&gt;&lt;/i&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="line-height: normal; margin: 0cm 0cm 0pt" class="MsoNormal"&gt;&lt;i style="mso-bidi-font-style: normal"&gt;&lt;span style="color: black; font-size: 12pt; mso-ascii-font-family: calibri; mso-fareast-font-family: &amp;#39;Times New Roman&amp;#39;; mso-hansi-font-family: calibri; mso-bidi-font-family: calibri; mso-fareast-language: en-in" lang="EN-US"&gt;&lt;/span&gt;&lt;/i&gt;&lt;span style="color: #1f497d; mso-ascii-font-family: calibri; mso-fareast-font-family: &amp;#39;Times New Roman&amp;#39;; mso-hansi-font-family: calibri; mso-bidi-font-family: calibri; mso-fareast-language: en-in" lang="EN-US"&gt;&lt;font color="#000000" size="3" face="Calibri"&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height: normal; margin: 0cm 0cm 0pt" class="MsoNormal"&gt;&lt;span style="color: #1f497d; mso-ascii-font-family: calibri; mso-fareast-font-family: &amp;#39;Times New Roman&amp;#39;; mso-hansi-font-family: calibri; mso-bidi-font-family: calibri; mso-fareast-language: en-in" lang="EN-US"&gt;&lt;font color="#000000" size="3" face="Calibri"&gt;Later in Sprint 2, due to some change in the customer requirement we had to update our custom content types to &lt;span style="mso-bidi-font-weight: bold"&gt;inherit from a different content &lt;/span&gt;type – &lt;b style="mso-bidi-font-weight: normal"&gt;ABC &lt;/b&gt;content type (provided by the customer). So accordingly we updated the IDs for all the content type but rest of the properties (like &lt;b&gt;Name&lt;/b&gt;) remained same. This update was again packaged and &lt;span style="mso-bidi-font-weight: bold"&gt;redeployed&lt;/span&gt; on authoring environment.&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height: normal; margin: 0cm 0cm 0pt" class="MsoNormal"&gt;&lt;span style="color: #1f497d; mso-ascii-font-family: calibri; mso-fareast-font-family: &amp;#39;Times New Roman&amp;#39;; mso-hansi-font-family: calibri; mso-bidi-font-family: calibri; mso-fareast-language: en-in" lang="EN-US"&gt;&lt;/span&gt;&lt;font color="#000000"&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;&lt;i style="mso-bidi-font-style: normal"&gt;&lt;span style="color: #1f497d; mso-ascii-font-family: calibri; mso-fareast-font-family: &amp;#39;Times New Roman&amp;#39;; mso-hansi-font-family: calibri; mso-bidi-font-family: calibri; mso-fareast-language: en-in" lang="EN-US"&gt;&lt;font color="#000000"&gt;The above error occurred!!&lt;/font&gt;&lt;/span&gt;&lt;/i&gt;&lt;span style="color: #1f497d; mso-ascii-font-family: calibri; mso-fareast-font-family: &amp;#39;Times New Roman&amp;#39;; mso-hansi-font-family: calibri; mso-bidi-font-family: calibri; mso-fareast-language: en-in" lang="EN-US"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: black; font-size: 12pt; mso-ascii-font-family: calibri; mso-fareast-font-family: &amp;#39;Times New Roman&amp;#39;; mso-hansi-font-family: calibri; mso-bidi-font-family: calibri; mso-fareast-language: en-in" lang="EN-US"&gt; &lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="3" face="Calibri"&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="3" face="Calibri"&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="3" face="Calibri"&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="line-height: normal; margin: 0cm 0cm 0pt" class="MsoNormal"&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;&lt;b&gt;&lt;span style="color: #984806; mso-ascii-font-family: calibri; mso-fareast-font-family: &amp;#39;Times New Roman&amp;#39;; mso-hansi-font-family: calibri; mso-bidi-font-family: calibri; mso-fareast-language: en-in" lang="EN-US"&gt;Root Cause:&lt;/span&gt;&lt;/b&gt;&lt;span style="color: black; font-size: 12pt; mso-ascii-font-family: calibri; mso-fareast-font-family: &amp;#39;Times New Roman&amp;#39;; mso-hansi-font-family: calibri; mso-bidi-font-family: calibri; mso-fareast-language: en-in" lang="EN-US"&gt; &lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="line-height: normal; margin: 0cm 0cm 0pt" class="MsoNormal"&gt;&lt;span style="color: black; font-size: 12pt; mso-ascii-font-family: calibri; mso-fareast-font-family: &amp;#39;Times New Roman&amp;#39;; mso-hansi-font-family: calibri; mso-bidi-font-family: calibri; mso-fareast-language: en-in" lang="EN-US"&gt;&lt;/span&gt;&lt;font color="#000000"&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;&lt;span style="color: #1f497d; mso-ascii-font-family: calibri; mso-fareast-font-family: &amp;#39;Times New Roman&amp;#39;; mso-hansi-font-family: calibri; mso-bidi-font-family: calibri; mso-fareast-language: en-in" lang="EN-US"&gt;&lt;font color="#000000"&gt;Now once you redeployed a branding WSP, it would first delete the existing site content types and columns and other stuff but!!&lt;b&gt; &lt;/b&gt;it won’t update the content type associations which are already there with the Pages library (at least for the content types having the same names). So our content types instances (apparently stale) in Pages library continued to inherit from Page content type instead of ABC content type. And here we ended up with two versions of content types with&lt;/font&gt; &lt;font color="#000000"&gt;duplicate names&lt;/font&gt;.&lt;/span&gt;&lt;span style="color: black; font-size: 12pt; mso-ascii-font-family: calibri; mso-fareast-font-family: &amp;#39;Times New Roman&amp;#39;; mso-hansi-font-family: calibri; mso-bidi-font-family: calibri; mso-fareast-language: en-in" lang="EN-US"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: black; font-size: 12pt; mso-ascii-font-family: calibri; mso-fareast-font-family: &amp;#39;Times New Roman&amp;#39;; mso-hansi-font-family: calibri; mso-bidi-font-family: calibri; mso-fareast-language: en-in" lang="EN-US"&gt;&amp;#160;&lt;/span&gt; &lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="3" face="Calibri"&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p style="line-height: normal; margin: 0cm 0cm 0pt" class="MsoNormal"&gt;&lt;font face="Calibri"&gt;&lt;font size="3"&gt;&lt;b&gt;&lt;span style="color: #984806; mso-ascii-font-family: calibri; mso-fareast-font-family: &amp;#39;Times New Roman&amp;#39;; mso-hansi-font-family: calibri; mso-bidi-font-family: calibri; mso-fareast-language: en-in" lang="EN-US"&gt;Solution:&lt;/span&gt;&lt;/b&gt;&lt;span style="color: black; font-size: 12pt; mso-ascii-font-family: calibri; mso-fareast-font-family: &amp;#39;Times New Roman&amp;#39;; mso-hansi-font-family: calibri; mso-bidi-font-family: calibri; mso-fareast-language: en-in" lang="EN-US"&gt; &lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="line-height: normal; margin: 0cm 0cm 0pt" class="MsoNormal"&gt;&lt;span style="color: black; font-size: 12pt; mso-ascii-font-family: calibri; mso-fareast-font-family: &amp;#39;Times New Roman&amp;#39;; mso-hansi-font-family: calibri; mso-bidi-font-family: calibri; mso-fareast-language: en-in" lang="EN-US"&gt;&lt;/span&gt;&lt;font color="#000000"&gt;&lt;font size="3"&gt;&lt;span style="color: #1f497d; mso-ascii-font-family: calibri; mso-fareast-font-family: &amp;#39;Times New Roman&amp;#39;; mso-hansi-font-family: calibri; mso-bidi-font-family: calibri; mso-fareast-language: en-in" lang="EN-US"&gt;&lt;font face="Calibri"&gt;&lt;font color="#000000"&gt;Just delete the stale content type instance from the Pages library before you redeploy the new package and everything should work fine. Simple isn’t it&lt;/font&gt; &lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: wingdings; color: #1f497d; mso-fareast-font-family: &amp;#39;Times New Roman&amp;#39;; mso-bidi-font-family: calibri; mso-fareast-language: en-in" lang="EN-US"&gt;&lt;font color="#000000"&gt;J&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1377174316200906704-4602714427008447044?l=vivek-soni.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vivek-soni.blogspot.com/feeds/4602714427008447044/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vivek-soni.blogspot.com/2010/07/duplicate-name-error-while-creating.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1377174316200906704/posts/default/4602714427008447044'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1377174316200906704/posts/default/4602714427008447044'/><link rel='alternate' type='text/html' href='http://vivek-soni.blogspot.com/2010/07/duplicate-name-error-while-creating.html' title='Duplicate name error while creating SharePoint publishing page instance'/><author><name>Vivek</name><uri>http://www.blogger.com/profile/08310180297325901240</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_eTkvhTLeDPY/SnWbyjRk2rI/AAAAAAAAAQs/ElwvgOOCnfM/S220/DSC01417.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh6.ggpht.com/_eTkvhTLeDPY/TFOq3wPboeI/AAAAAAAAAVk/aFrz-Dhgk-U/s72-c/pageinstanceerror%5B6%5D.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1377174316200906704.post-7094378655666366168</id><published>2010-07-23T07:50:00.000-07:00</published><updated>2010-08-01T07:50:45.100-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SharePoint Publishing'/><category scheme='http://www.blogger.com/atom/ns#' term='SharePoint 2010'/><category scheme='http://www.blogger.com/atom/ns#' term='SharePoint 2007'/><category scheme='http://www.blogger.com/atom/ns#' term='SharePoint Feature'/><title type='text'>Duplicate web parts shown in SharePoint publishing page layouts and page instances</title><content type='html'>&lt;br /&gt;  &lt;p style="margin: 0cm 0cm 10pt" class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;&lt;font size="3" face="Calibri"&gt;Recently I came across another interesting issue with SharePoint page layouts. For a project requirement, we created some page layouts with almost the same structure having couple of predefined web part zones. Further each web part zone had a predefined Content Editor Web Part (CEWP). After packaging the same, I deployed the WSP on our test environment.&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 0cm 0cm 10pt" class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;&lt;font size="3" face="Calibri"&gt;As pictures speak more than words, the screen grab below (left most) depicts the issue I encountered. When creating a page instance using any of our custom page layout, every web part zone showed duplicate CEWP web parts instead of just one CEWP.&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;table border="0" cellspacing="0" cellpadding="2" width="742"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="top" width="371"&gt;         &lt;p align="center"&gt;&lt;img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="Page instance in edit mode" border="0" alt="Page instance in edit mode" src="http://lh6.ggpht.com/_eTkvhTLeDPY/TFWH7O_AoyI/AAAAAAAAAVo/3D8K9cTQhis/PageEditMode%5B6%5D.png?imgmax=800" width="365" height="264" /&gt;&lt;/p&gt;       &lt;/td&gt;        &lt;td valign="top" width="6"&gt;&amp;#160;&lt;/td&gt;        &lt;td valign="top" width="363"&gt;&lt;img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="Page layout in SPD" border="0" alt="Page layout in SPD" src="http://lh5.ggpht.com/_eTkvhTLeDPY/TFWH8TeKmhI/AAAAAAAAAVs/qJ_MSGUVbOA/SPDGrab%5B6%5D.png?imgmax=800" width="357" height="262" /&gt; &lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p style="margin: 0cm 0cm 10pt" class="MsoNormal"&gt;&lt;span style="mso-ansi-language: en-in; mso-fareast-language: en-in; mso-no-proof: yes"&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 0cm 0cm 10pt" class="MsoNormal"&gt;&lt;span style="mso-ansi-language: en-in; mso-fareast-language: en-in; mso-no-proof: yes"&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;Inspecting the page layouts in SharePoint Designer (SPD) resulted in the screen grab above (right most). The same duplicate web part appeared on the design mode. &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p style="margin: 0cm 0cm 10pt" class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;&lt;font size="3" face="Calibri"&gt;At first I tried to repackage and redeploy the page layouts a couple of times thinking this would solve my issue, but was disappointed. Again, everything worked fine on the development environment where the page layouts were designed and created. It’s only when I packaged and deployed the page layouts via WSP and features this issue would show up.&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 0cm 0cm 10pt" class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;&lt;font size="3" face="Calibri"&gt;I finally started inspecting the markup of the page layouts and found something interesting. I did a search for the web part zone GUIDs in SPD and below is the result of the query. &lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 0cm 0cm 10pt" class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;&lt;font size="3" face="Calibri"&gt;The result showed 82 occurrences of the same web part zone GUID in our custom page layouts (highlighted in yellow)!!.&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 0cm 0cm 10pt" class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;&lt;/span&gt;&amp;#160;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; margin-left: 0px; border-left-width: 0px; margin-right: 0px" title="SPD GUID search result" border="0" alt="SPD GUID search result" align="left" src="http://lh5.ggpht.com/_eTkvhTLeDPY/TFWH9ml9zLI/AAAAAAAAAVw/ao8SZ1JHqTY/guids_thumb%5B8%5D.png?imgmax=800" width="647" height="271" /&gt;&lt;/p&gt;  &lt;p style="margin: 0cm 0cm 10pt" class="MsoNormal"&gt;&amp;#160;&lt;/p&gt;  &lt;p style="margin: 0cm 0cm 10pt" class="MsoNormal"&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p style="margin: 0cm 0cm 10pt" class="MsoNormal"&gt;&lt;font size="3"&gt;&lt;span lang="EN-US"&gt;&lt;font face="Calibri"&gt;Apparently what happened was the designer had taken the advantage of the fact that all the page layouts had almost the same structure and used the magic keys (CTRL+C &amp;amp; CTRL+V) to create them &lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: wingdings; mso-ascii-font-family: calibri; mso-ascii-theme-font: minor-latin; mso-hansi-font-family: calibri; mso-hansi-theme-font: minor-latin; mso-char-type: symbol; mso-symbol-font-family: wingdings" lang="EN-US"&gt;&lt;span style="mso-char-type: symbol; mso-symbol-font-family: wingdings"&gt;J&lt;/span&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt; &lt;span style="font-family: wingdings; mso-ascii-font-family: calibri; mso-ascii-theme-font: minor-latin; mso-hansi-font-family: calibri; mso-hansi-theme-font: minor-latin; mso-char-type: symbol; mso-symbol-font-family: wingdings" lang="EN-US"&gt;&lt;span style="mso-char-type: symbol; mso-symbol-font-family: wingdings"&gt;     &lt;p style="margin: 0cm 0cm 10pt" class="MsoNormal"&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;span style="line-height: 115%; color: #e36c0a; font-size: 12pt; mso-themecolor: accent6; mso-themeshade: 191" lang="EN-US"&gt;&lt;font face="Calibri"&gt;Issue: &lt;/font&gt;&lt;/span&gt;&lt;/b&gt;        &lt;br /&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;span style="line-height: 115%; color: #e36c0a; font-size: 12pt; mso-themecolor: accent6; mso-themeshade: 191" lang="EN-US"&gt;&lt;/span&gt;&lt;/b&gt;&lt;span lang="EN-US"&gt;&lt;font size="3" face="Calibri"&gt;Using the same web part zone GUID multiple times whether in same page layout or a different &lt;span style="mso-spacerun: yes"&gt;&amp;#160;&lt;/span&gt;page layout would result into the web part being shown&lt;span style="mso-spacerun: yes"&gt; &lt;/span&gt;up multiple times.&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;      &lt;p style="margin: 0cm 0cm 10pt" class="MsoNormal"&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;span style="color: #e36c0a; mso-themecolor: accent6; mso-themeshade: 191" lang="EN-US"&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;Resolution: &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;        &lt;br /&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;span style="color: #e36c0a; mso-themecolor: accent6; mso-themeshade: 191" lang="EN-US"&gt;&lt;/span&gt;&lt;/b&gt;&lt;span lang="EN-US"&gt;&lt;font size="3" face="Calibri"&gt;Ensure that every web part zone and web part in your page layouts have a unique GUID across your site collection.&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/span&gt;&lt;/span&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1377174316200906704-7094378655666366168?l=vivek-soni.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vivek-soni.blogspot.com/feeds/7094378655666366168/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vivek-soni.blogspot.com/2010/08/duplicate-web-parts-shown-in-sharepoint.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1377174316200906704/posts/default/7094378655666366168'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1377174316200906704/posts/default/7094378655666366168'/><link rel='alternate' type='text/html' href='http://vivek-soni.blogspot.com/2010/08/duplicate-web-parts-shown-in-sharepoint.html' title='Duplicate web parts shown in SharePoint publishing page layouts and page instances'/><author><name>Vivek</name><uri>http://www.blogger.com/profile/08310180297325901240</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_eTkvhTLeDPY/SnWbyjRk2rI/AAAAAAAAAQs/ElwvgOOCnfM/S220/DSC01417.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh6.ggpht.com/_eTkvhTLeDPY/TFWH7O_AoyI/AAAAAAAAAVo/3D8K9cTQhis/s72-c/PageEditMode%5B6%5D.png?imgmax=800' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1377174316200906704.post-3761808592110770896</id><published>2010-01-27T05:45:00.001-08:00</published><updated>2010-01-28T01:08:15.537-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio 2010'/><category scheme='http://www.blogger.com/atom/ns#' term='SharePoint 2010 Social Networking'/><category scheme='http://www.blogger.com/atom/ns#' term='SharePoint 2010'/><category scheme='http://www.blogger.com/atom/ns#' term='SharePoint Object Model'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>SharePoint 2010 Social Networking Part 1: Setting the user My Site status message programmatically</title><content type='html'>&lt;p&gt;SharePoint 2010 comes along with a wide range of the social feature like note boards, rating, bookmarking, tagging etc. I’ll be doing a series of blog posts to share some code snippets for managing these cool features programmatically.&lt;/p&gt;  &lt;p&gt;One of the interesting social feature is setting the My Site status message which depicts the mood of the user. In the part 1 of this series I’ll demonstrate a small code snippet to set the My Site status message programmatically.&lt;/p&gt;  &lt;p&gt;So we’ll start by adding the required assembly references to our console application:&lt;/p&gt;  &lt;p&gt;Microsoft.SharePoint.dll    &lt;br /&gt;Microsoft.Office.Server.dll     &lt;br /&gt;Microsoft.Office.Server.UserProfiles.dll     &lt;br /&gt;System.Web&lt;/p&gt;  &lt;p&gt;Followed by the following namespace decelerations:&lt;/p&gt;  &lt;p&gt;using Microsoft.SharePoint;    &lt;br /&gt;using Microsoft.Office.Server;     &lt;br /&gt;using Microsoft.Office.Server.UserProfiles;&lt;/p&gt;  &lt;p&gt;Now one wearied issue that the users with Visual Studio 2010 beta would notice here is as soon as you compile the solution, you’ll probably notice this error followed by a warning:&lt;/p&gt;  &lt;p&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://lh5.ggpht.com/_eTkvhTLeDPY/S2EZ1VSCsZI/AAAAAAAAASw/D6OieKZPGmo/image%5B6%5D.png?imgmax=800" width="718" height="176" /&gt; &lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;I wasted a whole day fighting this issue until I found &lt;a href="http://www.sharepointnutsandbolts.com/2009/12/common-compilation-error-for-sharepoint.html" target="_blank"&gt;this post&lt;/a&gt; by Chris where he points out it as a development issue in VS2010 beta build.&lt;/p&gt;  &lt;p&gt;So essentially we would need to add the reference to System.Web.DataVisualization.dll into our project and we are good to go.&lt;/p&gt;  &lt;p&gt;Now we’ll add the method as shown below to our application:&lt;/p&gt;  &lt;p&gt;&amp;#160; &lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="SetStatusMessage" border="0" alt="SetStatusMessage" src="http://lh3.ggpht.com/_eTkvhTLeDPY/S2FPRD35LbI/AAAAAAAAAS8/jzR0qyRlRt0/image%5B37%5D.png?imgmax=800" width="483" height="292" /&gt; &lt;/p&gt;  &lt;p&gt;Essentially here we are stating by instantiating the SPSite object for a SharePoint site URL (&lt;a href="http://intranet.contoso.com"&gt;http://intranet.contoso.com&lt;/a&gt;). Then we are creating an object of SPServiceContext class which would enable us make a call to the user profile service application.&lt;/p&gt;  &lt;p&gt;Next is to instantiate the &lt;strong&gt;UserProfileManager&lt;/strong&gt; class object for accessing the user profiles and their data stored in the user profile database. The &lt;strong&gt;GetUserProfile&lt;/strong&gt; method of the UserProfileManager class accepts several overloads and returns the user profile for the specified user (in our case the administrator). &lt;/p&gt;  &lt;p&gt;Now among the several OOB user profile properties configured on the server, the property &lt;strong&gt;SPS-StatusNotes &lt;/strong&gt;is the one which we are looking for. Setting the value of this property with a string value would set the the status message for the user. The final step is to commit the changes by calling the &lt;strong&gt;Commit&lt;/strong&gt; method.&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;Now call this method and pass a string message “Status set from code.”. Finally executing our console app would result in setting the status message for administrator as shown in the image below. &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="My Site status." border="0" alt="My Site status." src="http://lh5.ggpht.com/_eTkvhTLeDPY/S2FPSGBzxFI/AAAAAAAAATA/gNOt3ndMRS0/image%5B31%5D.png?imgmax=800" width="746" height="330" /&gt;&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1377174316200906704-3761808592110770896?l=vivek-soni.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vivek-soni.blogspot.com/feeds/3761808592110770896/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vivek-soni.blogspot.com/2010/01/sharepoint-2010-setting-user-my-site.html#comment-form' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1377174316200906704/posts/default/3761808592110770896'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1377174316200906704/posts/default/3761808592110770896'/><link rel='alternate' type='text/html' href='http://vivek-soni.blogspot.com/2010/01/sharepoint-2010-setting-user-my-site.html' title='SharePoint 2010 Social Networking Part 1: Setting the user My Site status message programmatically'/><author><name>Vivek</name><uri>http://www.blogger.com/profile/08310180297325901240</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_eTkvhTLeDPY/SnWbyjRk2rI/AAAAAAAAAQs/ElwvgOOCnfM/S220/DSC01417.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh5.ggpht.com/_eTkvhTLeDPY/S2EZ1VSCsZI/AAAAAAAAASw/D6OieKZPGmo/s72-c/image%5B6%5D.png?imgmax=800' height='72' width='72'/><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1377174316200906704.post-3527123167369140160</id><published>2010-01-12T09:36:00.001-08:00</published><updated>2010-01-17T20:12:49.797-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SharePoint Publishing'/><category scheme='http://www.blogger.com/atom/ns#' term='SharePoint 2010'/><category scheme='http://www.blogger.com/atom/ns#' term='SharePoint 2007'/><category scheme='http://www.blogger.com/atom/ns#' term='SharePoint Feature'/><category scheme='http://www.blogger.com/atom/ns#' term='Tools and Utilities'/><title type='text'>SharePoint WCM Feature Generator</title><content type='html'>&lt;p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"&gt;&lt;span style="mso-ansi-language: en-us" lang="EN-US"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-family:Calibri;"&gt;From my experiences on of SharePoint WCM projects I did so far, I came &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="mso-ansi-language: en-us" lang="EN-US"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-family:Calibri;"&gt;across certain repetitive &amp;amp; time-consuming development tasks. Some of them are listed below:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"&gt;&lt;span style="mso-ansi-language: en-us" lang="EN-US"&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="mso-ansi-language: en-us" lang="EN-US"&gt;&lt;p style="TEXT-INDENT: -18pt; MARGIN: 0cm 0cm 0pt 36pt; mso-list: l0 level1 lfo1" class="MsoListParagraphCxSpFirst"&gt;&lt;span style="mso-bidi-: minor-latin;font-family:calibri;" lang="EN-US" &gt;&lt;span style="mso-list: ignore"&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;1.&lt;/span&gt;&lt;span style="FONT: 7pt 'Times New Roman'"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;span lang="EN-US"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-family:Calibri;"&gt;Creating Site Definition &lt;p&gt;&lt;/p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;p&gt;&lt;/p&gt;&lt;p style="TEXT-INDENT: -18pt; MARGIN: 0cm 0cm 0pt 36pt; mso-list: l0 level1 lfo1" class="MsoListParagraphCxSpMiddle"&gt;&lt;span style="mso-bidi-: minor-latin;font-family:calibri;" lang="EN-US" &gt;&lt;span style="mso-list: ignore"&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;2.&lt;/span&gt;&lt;span style="FONT: 7pt 'Times New Roman'"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;span lang="EN-US"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;span style="font-size:100%;"&gt;Features &lt;p&gt;&lt;/p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;p&gt;&lt;/p&gt;&lt;p style="TEXT-INDENT: -18pt; MARGIN: 0cm 0cm 0pt 72pt; mso-list: l0 level2 lfo1; mso-add-space: auto" class="MsoListParagraphCxSpMiddle"&gt;&lt;span style="FONT-FAMILY: symbol; mso-bidi-font-family: symbolfont-family:symbol;" lang="EN-US" &gt;&lt;span style="mso-list: ignore"&gt;&lt;span style="font-size:100%;"&gt;·&lt;/span&gt;&lt;span style="FONT: 7pt 'Times New Roman'"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span lang="EN-US"&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;Site Columns- Columns used in lists/libraries/page layouts.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="TEXT-INDENT: -18pt; MARGIN: 0cm 0cm 0pt 72pt; mso-list: l0 level2 lfo1; mso-add-space: auto" class="MsoListParagraphCxSpMiddle"&gt;&lt;span style="FONT-FAMILY: symbol; mso-bidi-font-family: symbolfont-family:symbol;" lang="EN-US" &gt;&lt;span style="mso-list: ignore"&gt;&lt;span style="font-size:100%;"&gt;·&lt;/span&gt;&lt;span style="FONT: 7pt 'Times New Roman'"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span lang="EN-US"&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;Content Types- Lists/Page Layout content types. &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="TEXT-INDENT: -18pt; MARGIN: 0cm 0cm 0pt 72pt; mso-list: l0 level2 lfo1; mso-add-space: auto" class="MsoListParagraphCxSpMiddle"&gt;&lt;span style="FONT-FAMILY: symbol; mso-bidi-font-family: symbolfont-family:symbol;" lang="EN-US" &gt;&lt;span style="mso-list: ignore"&gt;&lt;span style="font-size:100%;"&gt;·&lt;/span&gt;&lt;span style="FONT: 7pt 'Times New Roman'"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span lang="EN-US"&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;Content Type Associations- Association of Content Types with the SharePoint list.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="TEXT-INDENT: -18pt; MARGIN: 0cm 0cm 0pt 72pt; mso-list: l0 level2 lfo1; mso-add-space: auto" class="MsoListParagraphCxSpMiddle"&gt;&lt;span style="FONT-FAMILY: symbol; mso-bidi-font-family: symbolfont-family:symbol;" lang="EN-US" &gt;&lt;span style="mso-list: ignore"&gt;&lt;span style="font-size:100%;"&gt;·&lt;/span&gt;&lt;span style="FONT: 7pt 'Times New Roman'"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span lang="EN-US"&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;Master Pages and Page Layouts- Provisioning master pages and layouts on SharePoint master pages library.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="TEXT-INDENT: -18pt; MARGIN: 0cm 0cm 0pt 72pt; mso-list: l0 level2 lfo1; mso-add-space: auto" class="MsoListParagraphCxSpMiddle"&gt;&lt;span style="FONT-FAMILY: symbol; mso-bidi-font-family: symbolfont-family:symbol;" lang="EN-US" &gt;&lt;span style="mso-list: ignore"&gt;&lt;span style="font-size:100%;"&gt;·&lt;/span&gt;&lt;span style="FONT: 7pt 'Times New Roman'"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span lang="EN-US"&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;Provision Files- Provision image, CSS, XAPS and documents on specified SharePoint library. &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="TEXT-INDENT: -18pt; MARGIN: 0cm 0cm 0pt 72pt; mso-list: l0 level2 lfo1; mso-add-space: auto" class="MsoListParagraphCxSpMiddle"&gt;&lt;span style="FONT-FAMILY: symbol; mso-bidi-font-family: symbolfont-family:symbol;" lang="EN-US" &gt;&lt;span style="mso-list: ignore"&gt;&lt;span style="font-size:100%;"&gt;·&lt;/span&gt;&lt;span style="FONT: 7pt 'Times New Roman'"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span lang="EN-US"&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;Feature Staplers- Auto activation of features based on site creation. &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="TEXT-INDENT: -18pt; MARGIN: 0cm 0cm 0pt 36pt; mso-list: l0 level1 lfo1" class="MsoListParagraphCxSpMiddle"&gt;&lt;span style="mso-bidi-: minor-latin;font-family:calibri;" lang="EN-US" &gt;&lt;span style="mso-list: ignore"&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;3.&lt;/span&gt;&lt;span style="FONT: 7pt 'Times New Roman'"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;span lang="EN-US"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-family:Calibri;"&gt;Feature Receivers &lt;p&gt;&lt;/p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;p&gt;&lt;/p&gt;&lt;p style="TEXT-INDENT: -18pt; MARGIN: 0cm 0cm 10pt 36pt; mso-list: l0 level1 lfo1" class="MsoListParagraphCxSpLast"&gt;&lt;span style="mso-bidi-: minor-latin;font-family:calibri;" lang="EN-US" &gt;&lt;span style="mso-list: ignore"&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;4.&lt;/span&gt;&lt;span style="FONT: 7pt 'Times New Roman'"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;span lang="EN-US"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-family:Calibri;"&gt;Custom Controls &lt;p&gt;&lt;/p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;p&gt;&lt;/p&gt;&lt;p style="MARGIN: 0cm 0cm 10pt 18pt" class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;The image below illustrates the Visual Studio 2005/2008 solution for a typical SharePoint WCM project.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"&gt;&lt;/p&gt;&lt;p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"&gt;&lt;span style="mso-ansi-language: en-us" lang="EN-US"&gt;&lt;span style="mso-bidi-: minor-latin;font-family:calibri;" lang="EN-US" &gt;&lt;span style="mso-list: ignore"&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="mso-ansi-language: en-us" lang="EN-US"&gt;&lt;span style="mso-bidi-: minor-latin;font-family:calibri;" lang="EN-US" &gt;&lt;span style="mso-list: ignore"&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;span lang="EN-US"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;p&gt;&lt;/p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;p&gt;&lt;/p&gt;&lt;p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"&gt;&lt;/p&gt;&lt;/span&gt;&lt;/span&gt;&lt;a href="http://lh4.ggpht.com/_eTkvhTLeDPY/S0yzJOYnLqI/AAAAAAAAARk/4njhmN16JhA/s1600-h/VSSolution%5B8%5D.png"&gt;&lt;img style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: block; FLOAT: none; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; MARGIN-LEFT: auto; BORDER-LEFT-WIDTH: 0px; MARGIN-RIGHT: auto" title="VSSolution" border="0" alt="VSSolution" src="http://lh4.ggpht.com/_eTkvhTLeDPY/S0yzKVgaISI/AAAAAAAAARo/VgpdLXM6lDE/VSSolution_thumb%5B6%5D.png?imgmax=800" width="505" height="384" /&gt;&lt;/a&gt; &lt;/span&gt;&lt;p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"&gt;&lt;/p&gt;&lt;p style="MARGIN: 0cm 0cm 10pt" class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;Keeping the same thought in mind, I have developed a utility &lt;b style="mso-bidi-font-weight: normal"&gt;SharePoint WCM Feature Generator &lt;/b&gt;to&lt;b style="mso-bidi-font-weight: normal"&gt; &lt;/b&gt;automate the feature creation for some of the fundamental WCM components in SharePoint like Site Columns, Content Types, Content Type Associations, Provisioning etc (indicated by &lt;span style="color:#008000;"&gt;green &lt;/span&gt;callout).&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/span&gt;&lt;a href="http://cid-3a1504592747cd6e.skydrive.live.com/self.aspx/.Public/Tools%20and%20Utilities/SharePoint%20WCM%20Feature%20Generator/SharePointWCMFeatureGenerator.zip" target="_blank"&gt;&lt;img style="BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; DISPLAY: block; FLOAT: none; MARGIN-LEFT: auto; BORDER-TOP: 0px; MARGIN-RIGHT: auto; BORDER-RIGHT: 0px" title="SharePoint WCM Feature Generator" border="0" alt="SharePoint WCM Feature Generator" src="http://lh5.ggpht.com/_eTkvhTLeDPY/S0yzLfIHkDI/AAAAAAAAARs/6YjE_5ntjZU/SharePoint%20WCM%20Feature%20Generator%5B11%5D.png?imgmax=800" width="609" height="517" /&gt;&lt;/a&gt; &lt;p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"&gt;&lt;span style="mso-ansi-language: en-us" lang="EN-US"&gt;&lt;/span&gt;&lt;p&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;&lt;span style="FONT-FAMILY: 'Calibri','sans-serif'; mso-ansi-language: en-us; mso-fareast-language: en-in; mso-bidi-language: ar-sa; mso-fareast-: minor-latinfont-family:calibri;font-size:11;" lang="EN-US"  &gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;&lt;span style="FONT-FAMILY: 'Calibri','sans-serif'; mso-ansi-language: en-us; mso-fareast-language: en-in; mso-bidi-language: ar-sa; mso-fareast-: minor-latinfont-family:calibri;font-size:11;" lang="EN-US"  &gt;Also this tool well &lt;b&gt;&lt;i&gt;integrate with Visual Studio&lt;/i&gt;&lt;/b&gt; to make things even simpler.&lt;/span&gt; &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;The SharePoint WCM Feature Generator is targeted for both Microsoft Office SharePoint Server 2007 and SharePoint 2010. &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"&gt;&lt;span style="mso-ansi-language: en-us" lang="EN-US"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"&gt;&lt;span style="mso-ansi-language: en-us" lang="EN-US"&gt;&lt;span lang="EN-US"&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;The tool can be downloaded from here: &lt;a href="http://spwcmfeaturegen.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=38932" target="_blank"&gt;SharePoint WCM Feature Generator.exe&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;The user guide can be downloaded from here: &lt;a href="http://spwcmfeaturegen.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=38930" target="_blank"&gt;SharePoint WCM Feature Generator User Guide&lt;/a&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1377174316200906704-3527123167369140160?l=vivek-soni.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vivek-soni.blogspot.com/feeds/3527123167369140160/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vivek-soni.blogspot.com/2010/01/sharepoint-wcm-feature-generator.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1377174316200906704/posts/default/3527123167369140160'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1377174316200906704/posts/default/3527123167369140160'/><link rel='alternate' type='text/html' href='http://vivek-soni.blogspot.com/2010/01/sharepoint-wcm-feature-generator.html' title='SharePoint WCM Feature Generator'/><author><name>Vivek</name><uri>http://www.blogger.com/profile/08310180297325901240</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_eTkvhTLeDPY/SnWbyjRk2rI/AAAAAAAAAQs/ElwvgOOCnfM/S220/DSC01417.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh4.ggpht.com/_eTkvhTLeDPY/S0yzKVgaISI/AAAAAAAAARo/VgpdLXM6lDE/s72-c/VSSolution_thumb%5B6%5D.png?imgmax=800' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1377174316200906704.post-7832704566831193342</id><published>2009-07-15T02:37:00.001-07:00</published><updated>2009-07-15T22:34:20.702-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Exchange Server 2010'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Programmatically creating mailbox for an existing user in Exchange Server 2010</title><content type='html'>&lt;p&gt;&lt;span style="font-family:calibri;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="MARGIN: 0in 0in 10pt" class="MsoNormal"&gt;&lt;span style="font-family:ca;"&gt;&lt;span style="FONT-FAMILY: 'Arial','sans-serif'; mso-ansi-language: en; mso-fareast-language: en-us; mso-bidi-language: ar-sa; mso-fareast-: minor-latinfont-family:calibri;" lang="EN" &gt;In this post I am going to demonstrate how we can leverage &lt;/span&gt;the Exchange Management Shell Commandlets with managed code to accomplish some basic administrative tasks like creating mailbox in Exchange Server 2010 for existing users.&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormalCxSpMiddle"&gt;&lt;span style="font-family:ca;"&gt;Before getting started just ensure that you have &lt;a href="http://msdn.microsoft.com/en-us/library/ms714469(VS.85).aspx" target="_blank"&gt;Windows PowerShell SDK&lt;/a&gt;&lt;/span&gt;&lt;span style="font-family:cla;"&gt;&lt;span style="color:#800080;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:ca;"&gt; installed on your development machine. Developers working on Windows Server 2008 can skip this check because &lt;span style="mso-bidi-font-weight: bold"&gt;Windows PowerShell&lt;/span&gt; is now included as part of &lt;span style="mso-bidi-font-weight: bold"&gt;Windows Server 2008.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="MARGIN: 0in 0in 10pt" class="MsoNormal"&gt;&lt;span style="font-family:ca;"&gt;In your C# project, add reference to &lt;a href="http://msdn.microsoft.com/en-us/library/system.management.automation.cmdlet(VS.85).aspx" target="_blank"&gt;System.Management.Automation.dll&lt;/a&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;span style="color:#ff8000;"&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="LINE-HEIGHT: 115%;font-family:'Verdana','sans-serif';color:black;"  &gt; &lt;span style="font-family:ca;font-size:85%;"&gt;assembly&lt;/span&gt;. &lt;span style="font-size:85%;"&gt;&lt;span style="font-family:ca;"&gt;Once you install &lt;/span&gt;&lt;span style="font-family:c;"&gt;PowerShell, you&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:c;"&gt; will find it on the following path C:\Program Files\Reference Assemblies\Microsoft\WindowsPowerShell\v1.0\ . Somehow I was not able to find this assembly any where in program files folder on my Windows Server 2008 machine. So I manually took the DLL out from GAC and put it in a local folder and referenced it.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:calibri;"&gt;&lt;p style="MARGIN: 0in 0in 10pt" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;Add the following directive statements to your code&lt;/span&gt;&lt;/p&gt;&lt;p style="MARGIN: 0in 0in 10pt" class="MsoNormal"&gt;&lt;span style="font-family:cons;"&gt;&lt;span style="LINE-HEIGHT: 115%; FONT-FAMILY: consolasfont-family:consolas;color:blue;"  &gt;using&lt;/span&gt;&lt;span style="LINE-HEIGHT: 115%; FONT-FAMILY: consolasfont-family:consolas;" &gt; System.Management.Automation.Runspaces;&lt;/span&gt;&lt;br /&gt;&lt;span style="LINE-HEIGHT: 115%; FONT-FAMILY: consolasfont-family:consolas;" &gt;&lt;/span&gt;&lt;span style="LINE-HEIGHT: 115%; FONT-FAMILY: consolasfont-family:consolas;color:blue;"  &gt;using&lt;/span&gt;&lt;span style="LINE-HEIGHT: 115%; FONT-FAMILY: consolasfont-family:consolas;" &gt; System.Management.Automation;&lt;/span&gt;&lt;br /&gt;&lt;span style="LINE-HEIGHT: 115%; FONT-FAMILY: consolasfont-family:consolas;color:blue;"  &gt;using&lt;/span&gt;&lt;span style="LINE-HEIGHT: 115%; FONT-FAMILY: consolasfont-family:consolas;" &gt; System.Collections.ObjectModel;&lt;/span&gt;&lt;br /&gt;&lt;span style="LINE-HEIGHT: 115%; FONT-FAMILY: consolasfont-family:consolas;color:blue;"  &gt;using&lt;/span&gt;&lt;span style="LINE-HEIGHT: 115%; FONT-FAMILY: consolasfont-family:consolas;" &gt; System.Collections;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="MARGIN: 0in 0in 10pt" class="MsoNormal"&gt;&lt;/p&gt;&lt;/span&gt;&lt;p style="MARGIN: 0in 0in 10pt" class="MsoNormal"&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p style="MARGIN: 0in 0in 10pt" class="MsoNormal"&gt;&lt;span style="LINE-HEIGHT: 115%; FONT-FAMILY: consolasfont-family:consolas;" &gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;/span&gt;&lt;p&gt;Next Add the following methods to your code:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;EnableMailbox&lt;/strong&gt;- Creates mailbox for an existing user by using the &lt;a href="http://technet.microsoft.com/en-us/library/aa998251.aspx" target="_blank"&gt;Enable-Mailbox&lt;/a&gt; commandlet. &lt;/li&gt;&lt;/ul&gt;&lt;blockquote&gt;&lt;p&gt;In this method I am creating and opening a &lt;a href="http://msdn.microsoft.com/en-us/library/system.management.automation.runspaces.runspace(VS.85).aspx" target="_blank"&gt;Runspace&lt;/a&gt; that has access to the Exchange Management Shell. Next is to create an object of &lt;a href="http://msdn.microsoft.com/en-us/library/system.management.automation.runspaces.pipeline(VS.85).aspx" target="_blank"&gt;Pipeline&lt;/a&gt; class by using this runspace. Before creating a mailbox, it’s good to check whether the users already has a mailbox on exchange or not. So here I am calling a method &lt;strong&gt;MailBoxAlreadyExist &lt;/strong&gt;(explained in next section) which checks for the users' mailbox and returns me true or false accordingly. &lt;/p&gt;&lt;/blockquote&gt;&lt;blockquote&gt;&lt;p&gt;Further I am creating an instance of the &lt;a href="http://msdn.microsoft.com/en-us/library/system.management.automation.runspaces.command(VS.85).aspx" target="_blank"&gt;Command&lt;/a&gt; class by using the name of the cmdlet I wish to run (Enable- Mailbox). This cmdlet is then added to the command collection of pipleline object. Invoking the pipeline object would run the command and create a mailbox in exchange.&lt;/p&gt;&lt;/blockquote&gt;&lt;blockquote&gt;&lt;pre class="csharpcode"&gt; &lt;img style="BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; DISPLAY: inline; BORDER-TOP: 0px; BORDER-RIGHT: 0px" title="Enable Mailbox" border="0" alt="Enable Mailbox" src="http://lh5.ggpht.com/_eTkvhTLeDPY/Sl3H8-bEgOI/AAAAAAAAAQg/3Kvp7nMayII/Enable%20Mailbox.png?imgmax=800" width="702" height="506" /&gt; &lt;/pre&gt;&lt;/blockquote&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;MailBoxAlreadyExist&lt;/strong&gt;- Checks whether the mailbox for a give user identity already exists on Exchange Server. Here I am using the &lt;a href="http://technet.microsoft.com/en-us/library/aa996896.aspx" target="_blank"&gt;Get-User&lt;/a&gt; commandlet to get the required user(&lt;a href="http://msdn.microsoft.com/en-us/library/system.management.automation.psobject(VS.85).aspx" target="_blank"&gt;PSObject&lt;/a&gt;). Next using the &lt;a href="http://msdn.microsoft.com/en-us/library/bb397687.aspx" target="_blank"&gt;lambda expressions&lt;/a&gt;, I am checking the value of property ‘&lt;strong&gt;RecipientType’. &lt;/strong&gt;If the user already has a mailbox on Exchange, then this property returns a value &lt;strong&gt;UserMailbox &lt;/strong&gt;else it would return &lt;strong&gt;User&lt;/strong&gt;. &lt;/li&gt;&lt;/ul&gt;&lt;blockquote&gt;&lt;pre class="csharpcode"&gt;&lt;img style="BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; DISPLAY: inline; BORDER-TOP: 0px; BORDER-RIGHT: 0px" title="MailboxAlreadyExists" border="0" alt="MailboxAlreadyExists" src="http://lh5.ggpht.com/_eTkvhTLeDPY/Sl2odhwlMCI/AAAAAAAAAQk/QmCvZrRrYTE/MailboxAlreadyExists%5B1%5D.png?imgmax=800" width="741" height="374" /&gt; &lt;/pre&gt;&lt;/blockquote&gt;The code can be downloaded from here &lt;iframe scrolling="no" marginheight="0" marginwidth="0" frameborder="0" style="width:240px;height:66px;margin:3px;padding:0;border:1px solid #dde5e9;background-color:#ffffff;" src="http://cid-3a1504592747cd6e.skydrive.live.com/embedrowdetail.aspx/.Public/C%7C3/Exchange%20Server%202010/CreateUsers.cs"&gt;&lt;/iframe&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1377174316200906704-7832704566831193342?l=vivek-soni.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vivek-soni.blogspot.com/feeds/7832704566831193342/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vivek-soni.blogspot.com/2009/07/programmatically-creating-mailbox-for.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1377174316200906704/posts/default/7832704566831193342'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1377174316200906704/posts/default/7832704566831193342'/><link rel='alternate' type='text/html' href='http://vivek-soni.blogspot.com/2009/07/programmatically-creating-mailbox-for.html' title='Programmatically creating mailbox for an existing user in Exchange Server 2010'/><author><name>Vivek</name><uri>http://www.blogger.com/profile/08310180297325901240</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_eTkvhTLeDPY/SnWbyjRk2rI/AAAAAAAAAQs/ElwvgOOCnfM/S220/DSC01417.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh5.ggpht.com/_eTkvhTLeDPY/Sl3H8-bEgOI/AAAAAAAAAQg/3Kvp7nMayII/s72-c/Enable%20Mailbox.png?imgmax=800' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1377174316200906704.post-5917225832977332485</id><published>2009-07-04T01:46:00.000-07:00</published><updated>2009-07-15T00:54:42.802-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SharePoint Object Model'/><category scheme='http://www.blogger.com/atom/ns#' term='SharePoint Feature'/><title type='text'>Overwriting Files in SharePoint using Module Element</title><content type='html'>&lt;p&gt;&lt;span class="attr"&gt;&lt;span style="font-family: calibri"&gt;As documented on &lt;a href="http://msdn.microsoft.com/en-us/library/ms459213.aspx" target="_blank"&gt;msdn&lt;/a&gt;, the &lt;a href="http://msdn.microsoft.com/en-us/library/ms459213.aspx" target="_blank"&gt;IgnoreIfAlreadyExists&lt;/a&gt; attribute in the file element &lt;/span&gt;&lt;span style="font-family: calibri"&gt;provisions a file even if it already exists at the specified URL. However it doesn't works as expected. &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span class="attr"&gt;&lt;/span&gt;&lt;span style="font-family: calibri"&gt;&lt;span class="attr"&gt;Searching for solution on the web, &lt;/span&gt;&lt;span class="attr"&gt;I came across a fantastic &lt;a href="http://johanleino.spaces.live.com/blog/cns!6BE273C70C45B5D1!304.entry" target="_blank"&gt;&lt;span style="color: #000000"&gt;blog post&lt;/span&gt;&lt;/a&gt; by &lt;a href="http://johanleino.spaces.live.com/blog/" target="_blank"&gt;&lt;span style="color: #000000"&gt;John Leino&lt;/span&gt;&lt;/a&gt; where he has suggested a programmatic approach to workaround this issue. &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span class="attr"&gt;&lt;span style="font-family: calibri"&gt;John describes creating a feature receiver which upon activation would get all the files along with their properties from the module element. Based on these properties, the files would then be added/overwritten on their target locations.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-family: calibri"&gt;&lt;span class="attr"&gt;I created a small POC using John’s approach and it really worked well !. &lt;/span&gt;&lt;span class="attr"&gt;But his code seems to break under the following conditions:&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;span class="attr"&gt;&lt;/span&gt;&lt;span style="font-family: calibri"&gt;&lt;span class="attr"&gt;If you have multiple modules in your element.xml file.&lt;/span&gt; &lt;/span&gt;&lt;/li&gt;    &lt;li&gt;&lt;span style="font-family: calibri"&gt;&lt;span class="attr"&gt;If the target SharePoint library forces the checking and checkout policy.&lt;/span&gt; &lt;/span&gt;&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;span class="attr"&gt;&lt;span style="font-family: calibri"&gt;So I extended John’s code to address these issues by adding/updating few methods. &lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;span class="attr"&gt;   &lt;p&gt;&lt;span style="font-family: calibri"&gt;Added a &lt;strong&gt;CheckOutStaus&lt;/strong&gt; method to get the file checked out status:&lt;/span&gt;&lt;/p&gt;    &lt;p&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="CheckOutStaus " border="0" alt="CheckOutStaus " src="http://lh4.ggpht.com/_eTkvhTLeDPY/Sk9GytbCTcI/AAAAAAAAAOk/Ypol7gVtWgs/code2%5B5%5D.jpg?imgmax=800" width="485" height="186" /&gt; &lt;/p&gt;    &lt;p&gt;&lt;span style="font-family: calibri"&gt;&lt;/span&gt;&lt;/p&gt;   &lt;style type="text/css"&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;.csharpcode, .csharpcode pre&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;	font-size: small;&lt;br /&gt;&lt;br /&gt;	color: black;&lt;br /&gt;&lt;br /&gt;	font-family: consolas, "Courier New", courier, monospace;&lt;br /&gt;&lt;br /&gt;	background-color: #ffffff;&lt;br /&gt;&lt;br /&gt;	/*white-space: pre;*/&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;.csharpcode pre { margin: 0em; }&lt;br /&gt;&lt;br /&gt;.csharpcode .rem { color: #008000; }&lt;br /&gt;&lt;br /&gt;.csharpcode .kwrd { color: #0000ff; }&lt;br /&gt;&lt;br /&gt;.csharpcode .str { color: #006080; }&lt;br /&gt;&lt;br /&gt;.csharpcode .op { color: #0000c0; }&lt;br /&gt;&lt;br /&gt;.csharpcode .preproc { color: #cc6633; }&lt;br /&gt;&lt;br /&gt;.csharpcode .asp { background-color: #ffff00; }&lt;br /&gt;&lt;br /&gt;.csharpcode .html { color: #800000; }&lt;br /&gt;&lt;br /&gt;.csharpcode .attr { color: #ff0000; }&lt;br /&gt;&lt;br /&gt;.csharpcode .alt&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;	background-color: #f4f4f4;&lt;br /&gt;&lt;br /&gt;	width: 100%;&lt;br /&gt;&lt;br /&gt;	margin: 0em;&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;.csharpcode .lnum { color: #606060; }&lt;/style&gt;    &lt;br /&gt;    &lt;p&gt;&lt;span style="font-family: calibri"&gt;For publishing sites the content needs to be approved before it can be seen by other site users (e.g. on the masterpage library). So I added a method &lt;strong&gt;CheckContentApproval&lt;/strong&gt; to verify that whether content approval is enabled on the target SharePoint library:&lt;/span&gt;&lt;/p&gt;    &lt;p&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="CheckContentApproval " border="0" alt="CheckContentApproval " src="http://lh4.ggpht.com/_eTkvhTLeDPY/Sk9Gzqh-9FI/AAAAAAAAAOo/TtpO5CJ8Dfc/code3%5B11%5D.jpg?imgmax=800" width="594" height="99" /&gt; &lt;/p&gt;    &lt;p&gt;&lt;span style="font-family: calibri"&gt;&lt;/span&gt;&lt;/p&gt; &lt;/span&gt;  &lt;p&gt;&lt;span class="attr"&gt;&lt;span style="font-family: calibri"&gt;Updated the &lt;strong&gt;UpdateFilesInModule &lt;/strong&gt;method to looks like this:&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;img style="border-right-width: 0px; width: 802px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; height: 401px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="UpdateFilesInModule" border="0" alt="UpdateFilesInModule" src="http://lh6.ggpht.com/_eTkvhTLeDPY/Sk9NZ22v5oI/AAAAAAAAAPI/zPJZ7apeH8Y/7-4-2009%205-26-57%20PM%5B12%5D.png?imgmax=800" width="942" height="455" /&gt;&lt;img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="UpdateFilesInModule " border="0" alt="UpdateFilesInModule " src="http://lh3.ggpht.com/_eTkvhTLeDPY/Sk9Na90QzpI/AAAAAAAAAPM/IVdlC8X3uIk/7-4-2009%205-27-55%20PM%5B25%5D.png?imgmax=800" width="944" height="438" /&gt; &lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-family: calibri"&gt;So in the above method after from getting all the files and their properties from the module, we are doing two thing&lt;/span&gt;&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;&lt;span style="font-family: calibri"&gt;Getting the checkout status of the file. &lt;/span&gt;&lt;/li&gt;    &lt;li&gt;&lt;span style="font-family: calibri"&gt;Checking whether content approval is enabled on the target SharePoint library and accordingly approving the file.&lt;/span&gt; &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;&lt;span style="font-family: calibri"&gt;The entire source code can be downloaded from &lt;iframe style="border-bottom: #dde5e9 1px solid; border-left: #dde5e9 1px solid; padding-bottom: 0px; background-color: #ffffff; margin: 3px; padding-left: 0px; width: 240px; padding-right: 0px; height: 66px; border-top: #dde5e9 1px solid; border-right: #dde5e9 1px solid; padding-top: 0px" marginheight="0" src="http://cid-3a1504592747cd6e.skydrive.live.com/embedrowdetail.aspx/.Public/SharePoint/OverWriteFileUsingModuleElement.cs" frameborder="0" marginwidth="0" scrolling="no"&gt;&lt;/iframe&gt;&lt;/span&gt;&lt;span style="font-family: calibri"&gt;.&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-family: calibri"&gt;&lt;/span&gt;&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1377174316200906704-5917225832977332485?l=vivek-soni.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vivek-soni.blogspot.com/feeds/5917225832977332485/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vivek-soni.blogspot.com/2009/07/overwriting-files-using-module-element.html#comment-form' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1377174316200906704/posts/default/5917225832977332485'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1377174316200906704/posts/default/5917225832977332485'/><link rel='alternate' type='text/html' href='http://vivek-soni.blogspot.com/2009/07/overwriting-files-using-module-element.html' title='Overwriting Files in SharePoint using Module Element'/><author><name>Vivek</name><uri>http://www.blogger.com/profile/08310180297325901240</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_eTkvhTLeDPY/SnWbyjRk2rI/AAAAAAAAAQs/ElwvgOOCnfM/S220/DSC01417.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh4.ggpht.com/_eTkvhTLeDPY/Sk9GytbCTcI/AAAAAAAAAOk/Ypol7gVtWgs/s72-c/code2%5B5%5D.jpg?imgmax=800' height='72' width='72'/><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1377174316200906704.post-3652755318645637816</id><published>2009-06-20T02:14:00.001-07:00</published><updated>2009-06-20T09:24:46.343-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SharePoint Publishing'/><category scheme='http://www.blogger.com/atom/ns#' term='SharePoint Silverlight'/><title type='text'>How We Did It: SharePoint.Microsoft.com- So the recipe is out!!</title><content type='html'>&lt;p&gt;Microsoft launched the &lt;a href="http://sharepoint.microsoft.com/Pages/Default.aspx" target="_blank"&gt;SharePoint marketing&lt;/a&gt; Website on SharePoint Server 2007 last month. What’s interesting is the website interfaces a simple and an elegant look and feel, with Silverlight adding a &lt;em&gt;jazz &lt;/em&gt;to the overall user experience.&lt;/p&gt;  &lt;p&gt;&lt;a title="SharePoint.Microsoft.co" href="http://sharepoint.microsoft.com/Pages/Default.aspx" target="_blank"&gt;&lt;img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="SharePoint.Microsoft.com" border="0" alt="SharePoint.Microsoft.com" src="http://lh4.ggpht.com/_eTkvhTLeDPY/Sjyoga6u9OI/AAAAAAAAANg/U-wIBqaugpI/6-20-2009%201-04-18%20PM%5B19%5D.png?imgmax=800" width="244" height="142" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;From the manageability perceptive, the publishing infrastructure allows the content to be published and managed more quickly. &lt;/p&gt;  &lt;p&gt;Our wonderful team &lt;a href="http://www.toddbaginski.com/blog" target="_blank"&gt;Todd&lt;/a&gt;, &lt;a href="http://jomit.blogspot.com/" target="_blank"&gt;Jomit&lt;/a&gt;, Meeta and Ritu and me - worked together to design and developed a whole bunch of components that fulfilled the overall requirements. Microsoft has also published the &lt;a href="http://blogs.msdn.com/sharepoint/archive/2009/06/18/how-we-did-it-sharepoint-microsoft-com.aspx" target="_blank"&gt;How We Did It&lt;/a&gt; article on MSDN highlighting the goals for rebuilding the website, the overall architecture and components used in the Website.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1377174316200906704-3652755318645637816?l=vivek-soni.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vivek-soni.blogspot.com/feeds/3652755318645637816/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vivek-soni.blogspot.com/2009/06/how-we-did-it-sharepointmicrosoftcom-so.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1377174316200906704/posts/default/3652755318645637816'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1377174316200906704/posts/default/3652755318645637816'/><link rel='alternate' type='text/html' href='http://vivek-soni.blogspot.com/2009/06/how-we-did-it-sharepointmicrosoftcom-so.html' title='How We Did It: SharePoint.Microsoft.com- So the recipe is out!!'/><author><name>Vivek</name><uri>http://www.blogger.com/profile/08310180297325901240</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_eTkvhTLeDPY/SnWbyjRk2rI/AAAAAAAAAQs/ElwvgOOCnfM/S220/DSC01417.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh4.ggpht.com/_eTkvhTLeDPY/Sjyoga6u9OI/AAAAAAAAANg/U-wIBqaugpI/s72-c/6-20-2009%201-04-18%20PM%5B19%5D.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1377174316200906704.post-6161018431667421345</id><published>2009-05-02T05:38:00.001-07:00</published><updated>2009-05-02T05:38:59.569-07:00</updated><title type='text'>Microsoft Office 14 for Web</title><content type='html'>&lt;p&gt;Microsoft announced their new component in the Office system ‘The Office Web Applications’ at the PDC 2008. These would be available as a part the next version of Office which would be Office 14. The Office 14 for web is a group of light weight, cross platform, cross browser versions of applications like Word, Excel, PowerPoint, One Note etc. &lt;/p&gt;  &lt;p&gt;Office Web Applications are all about giving people access to their familiar Office applications even when they are away from their desktop. So this does mean that in the next release what you would need to make a proposal document is just a browser.&lt;/p&gt;  &lt;p&gt;Check this cool video where Antoine Leblond from the Office group introduces to some of the features of Office 14 for Web. &lt;/p&gt;  &lt;p&gt;&amp;#160; &lt;div class="wlWriterEditableSmartContent" id="scid:5737277B-5D6D-4f48-ABFC-DD9C333F4C5D:1da4ffe6-d677-479b-a62f-5a5a5a1e7231" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;&lt;div id="4e324b39-6fd6-406a-a449-31b163d0b488" style="margin: 0px; padding: 0px; display: inline;"&gt;&lt;div&gt;&lt;a href="http://www.youtube.com/watch?v=eVQRkhJTqvk" target="_new"&gt;&lt;img src="http://lh4.ggpht.com/_eTkvhTLeDPY/Sfw-wWNKebI/AAAAAAAAANY/sIsQog76kCU/video862c4048c01a%5B6%5D.jpg?imgmax=800" style="border-style: none" galleryimg="no" onload="var downlevelDiv = document.getElementById('4e324b39-6fd6-406a-a449-31b163d0b488'); downlevelDiv.innerHTML = &amp;quot;&amp;lt;div&amp;gt;&amp;lt;object width=\&amp;quot;425\&amp;quot; height=\&amp;quot;355\&amp;quot;&amp;gt;&amp;lt;param name=\&amp;quot;movie\&amp;quot; value=\&amp;quot;http://www.youtube.com/v/eVQRkhJTqvk&amp;amp;hl=en\&amp;quot;&amp;gt;&amp;lt;\/param&amp;gt;&amp;lt;embed src=\&amp;quot;http://www.youtube.com/v/eVQRkhJTqvk&amp;amp;hl=en\&amp;quot; type=\&amp;quot;application/x-shockwave-flash\&amp;quot; width=\&amp;quot;425\&amp;quot; height=\&amp;quot;355\&amp;quot;&amp;gt;&amp;lt;\/embed&amp;gt;&amp;lt;\/object&amp;gt;&amp;lt;\/div&amp;gt;&amp;quot;;" alt=""&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1377174316200906704-6161018431667421345?l=vivek-soni.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vivek-soni.blogspot.com/feeds/6161018431667421345/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vivek-soni.blogspot.com/2009/05/microsoft-office-14-for-web.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1377174316200906704/posts/default/6161018431667421345'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1377174316200906704/posts/default/6161018431667421345'/><link rel='alternate' type='text/html' href='http://vivek-soni.blogspot.com/2009/05/microsoft-office-14-for-web.html' title='Microsoft Office 14 for Web'/><author><name>Vivek</name><uri>http://www.blogger.com/profile/08310180297325901240</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_eTkvhTLeDPY/SnWbyjRk2rI/AAAAAAAAAQs/ElwvgOOCnfM/S220/DSC01417.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh4.ggpht.com/_eTkvhTLeDPY/Sfw-wWNKebI/AAAAAAAAANY/sIsQog76kCU/s72-c/video862c4048c01a%5B6%5D.jpg?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1377174316200906704.post-518121352415822553</id><published>2009-05-01T23:09:00.000-07:00</published><updated>2010-01-12T07:51:33.435-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SharePoint Silverlight'/><category scheme='http://www.blogger.com/atom/ns#' term='Tools and Utilities'/><title type='text'>Making your SharePoint environment ready for Silverlight development</title><content type='html'>&lt;span style="font-family: arial; font-size: 85%"&gt;&lt;font size="2"&gt;SharePoint and Silverlight can be integrated together to provide an interactive user experience. The data within SharePoint and various LOBs can be delivered to the end user in a compelling manner using Silverlight.      &lt;br /&gt;      &lt;br /&gt;But making SharePoint Server 2007 environment ready for Silverlight development is a bit challenging and a time consuming process. There are several updates and components needed on the development machine before you can actually begin Silverlight development. For instance, to see a Silverlight application in action on a SharePoint Web page proper configurations need to be made in the web.config of the Web application.       &lt;br /&gt;      &lt;br /&gt;To address the same challenges, &lt;/font&gt;&lt;/span&gt;&lt;a href="http://www.advaiya.com/"&gt;&lt;span style="font-family: arial; font-size: 85%"&gt;&lt;font size="2"&gt;Advaiya&lt;/font&gt;&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family: arial; font-size: 85%"&gt;&lt;font size="2"&gt; has developed a tool &lt;/font&gt;&lt;/span&gt;&lt;a href="http://www.platformvision.com/downloads/default.aspx"&gt;&lt;span style="font-family: arial; font-size: 85%"&gt;&lt;font size="2"&gt;Advaiya Development Scanner&lt;/font&gt;&lt;/span&gt;&lt;/a&gt;&lt;font size="2"&gt;&lt;span style="font-family: arial; font-size: 85%"&gt; &lt;font size="2"&gt;which analyzes a target machine for the necessary components, and reports what is already installed and what needs to be installed or updated in order to support Silverlight 2.0 development. Along with this it also makes the necessary web config modifications on the targeted Web applications.&lt;/font&gt;&lt;/span&gt;     &lt;br /&gt;&lt;/font&gt;&lt;span style="font-family: arial; font-size: 85%"&gt;   &lt;br /&gt;&lt;font size="2"&gt;The demo of the tool can be seen &lt;/font&gt;&lt;/span&gt;&lt;a href="http://www.platformvision.com/downloads/scannerdemo.aspx"&gt;&lt;span style="font-family: arial; font-size: 85%"&gt;&lt;font size="2"&gt;here&lt;/font&gt;&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family: arial; font-size: 85%"&gt;&lt;font size="2"&gt; in action.&lt;/font&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1377174316200906704-518121352415822553?l=vivek-soni.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vivek-soni.blogspot.com/feeds/518121352415822553/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vivek-soni.blogspot.com/2009/05/making-your-sharepoint-environment.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1377174316200906704/posts/default/518121352415822553'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1377174316200906704/posts/default/518121352415822553'/><link rel='alternate' type='text/html' href='http://vivek-soni.blogspot.com/2009/05/making-your-sharepoint-environment.html' title='Making your SharePoint environment ready for Silverlight development'/><author><name>Vivek</name><uri>http://www.blogger.com/profile/08310180297325901240</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_eTkvhTLeDPY/SnWbyjRk2rI/AAAAAAAAAQs/ElwvgOOCnfM/S220/DSC01417.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1377174316200906704.post-8934061131090097985</id><published>2009-05-01T05:26:00.000-07:00</published><updated>2009-06-20T06:17:43.436-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SharePoint Publishing'/><title type='text'>OOB publishing image field with hyperlink bug: Resolved</title><content type='html'>&lt;p&gt;&lt;span style="font-family:calibri;"&gt;&lt;span style="font-family:arial;"&gt;Couple of times SharePoint presents an odd behavior. I came across one of such behaviors recently where the publishing image field was getting rendered incorrectly when seen in the display mode. Instead of showing the image the publishing field shows the IMG tags.&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-family:calibri;"&gt;Searching around the internet I found other people reporting the same issue followed by a workaround given by Stefan Gossner on his &lt;/span&gt;&lt;/span&gt;&lt;a href="http://blogs.technet.com/stefan_gossner/archive/2007/03/29/how-to-overcome-glitches-with-the-standard-field-controls-shipped-with-moss-2007.aspx"&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-family:calibri;"&gt;blog&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family:calibri;"&gt;&lt;span style="font-family:arial;"&gt;.&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-family:calibri;"&gt;The workaround he suggested includes creating a custom field control which inherits from the RichImageField class.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-family:calibri;"&gt;After implementing the same I was able to get rid of this issue, but soon i discovered one more bug :-( . It was if you assign a hyperlink (e.g. &lt;/span&gt;&lt;/span&gt;&lt;a href="http://www.microsoft.com/" rel="nofollow" target="_new"&gt;&lt;u&gt;&lt;span style="font-family:arial;color:#0066cc;"&gt;&lt;span style="font-family:calibri;"&gt;http://www.microsoft.com&lt;/span&gt;&lt;/span&gt;&lt;/u&gt;&lt;/a&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-family:calibri;"&gt;) to an image, then the publishing image field also renders the hyperlink along with the image.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:calibri;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-family:calibri;"&gt;This occurs specifically in case when the hyperlinks include the protocol with them (http or https etc.).&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-family:calibri;"&gt;After inspecting this issue I found that it was all due to the malformed anchor tag.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-family:calibri;"&gt;A well formed HTML output should be:&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-family:calibri;"&gt;&amp;lt;span dir=""&amp;gt;&amp;lt;a href="&lt;/span&gt;&lt;/span&gt;&lt;a href="http://www.microsoft.com/" rel="nofollow" target="_new"&gt;&lt;u&gt;&lt;span style="font-family:arial;color:#0066cc;"&gt;&lt;span style="font-family:calibri;"&gt;http://www.microsoft.com&lt;/span&gt;&lt;/span&gt;&lt;/u&gt;&lt;/a&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-family:calibri;"&gt;"&amp;gt;&amp;lt;img alt="" border="0" src="/PublishingImages/ add.gif" style="BORDER: 0px solid; "&amp;gt;&amp;lt;/a&amp;gt;&amp;lt;/span&amp;gt; &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-family:calibri;"&gt;But with the issue it was:&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-family:calibri;"&gt;&amp;lt;span dir=""&amp;gt;&amp;lt;a href="&amp;lt;a href="http://www.microsoft.com "&amp;gt;http://www.microsoft.com &amp;lt;/a&amp;gt;" target="_blank"&amp;gt;&amp;lt;img alt="" border="0" src="/PublishingImages/add.gif" style="BORDER: 0px solid; "&amp;gt;&amp;lt;/a&amp;gt;&amp;lt;/span&amp;gt; &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-family:calibri;"&gt;To rectify this issue i took Steffan’s approach as the baseline and modified the code to look like this:&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;pre class="csharpcode"&gt;&lt;span style="font-family:calibri;"&gt;&lt;span style="color:#333333;"&gt;&lt;span class="kwrd"  style="color:#000099;"&gt;using&lt;/span&gt; System;&lt;br /&gt;&lt;span class="kwrd"  style="color:#000099;"&gt;using&lt;/span&gt; System.Collections.Generic;&lt;br /&gt;&lt;span class="kwrd"  style="color:#000099;"&gt;using&lt;/span&gt; System.Globalization;&lt;br /&gt;&lt;span class="kwrd"  style="color:#000099;"&gt;using&lt;/span&gt; System.Text;&lt;br /&gt;&lt;span class="kwrd"  style="color:#000099;"&gt;using&lt;/span&gt; System.IO;&lt;br /&gt;&lt;span class="kwrd"  style="color:#000099;"&gt;using&lt;/span&gt; System.Web;&lt;br /&gt;&lt;span class="kwrd"  style="color:#000099;"&gt;using&lt;/span&gt; System.Web.UI;&lt;br /&gt;&lt;span class="kwrd"  style="color:#000099;"&gt;using&lt;/span&gt; Microsoft.SharePoint.Publishing.WebControls;&lt;br /&gt;&lt;br /&gt;&lt;span class="kwrd"  style="color:#000099;"&gt;namespace&lt;/span&gt; CustomPublishingField&lt;br /&gt;{&lt;br /&gt;    &lt;span style="color:#000099;"&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt;&lt;/span&gt; RichImageFieldControl: RichImageField&lt;br /&gt;    {&lt;br /&gt;        &lt;span style="color:#000099;"&gt; &lt;span class="kwrd"&gt;protected&lt;/span&gt; &lt;span class="kwrd"&gt;override&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt;&lt;/span&gt; RenderFieldForDisplay(HtmlTextWriter output)&lt;br /&gt;         {&lt;br /&gt;             &lt;span class="kwrd"  style="color:#000099;"&gt;if&lt;/span&gt; (&lt;span class="kwrd"  style="color:#000099;"&gt;this&lt;/span&gt;.ListItemFieldValue != &lt;span class="kwrd"  style="color:#000099;"&gt;null&lt;/span&gt;)&lt;br /&gt;             {&lt;br /&gt;                 &lt;span style="color:#339999;"&gt;StringBuilder&lt;/span&gt; item = &lt;span class="kwrd"&gt;new&lt;/span&gt; &lt;span style="color:#339999;"&gt;StringBuilder&lt;/span&gt;();&lt;br /&gt;                 item.Append(&lt;span class="str"&gt;"&lt;span style="color:#ff0000;"&gt;&amp;lt;span dir=''&amp;gt;&lt;/span&gt;"&lt;/span&gt;);&lt;br /&gt;                 item.Append(&lt;span class="kwrd"  style="color:#000099;"&gt;this&lt;/span&gt;.ListItemFieldValue.ToString());&lt;br /&gt;                 item.Append(&lt;span class="str"&gt;"&lt;span style="color:#ff0000;"&gt;&amp;lt;/span&amp;gt;&lt;/span&gt;"&lt;/span&gt;);&lt;br /&gt;                 output.Write(item.ToString());&lt;br /&gt;             }&lt;br /&gt;         }&lt;br /&gt;    }&lt;br /&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:arial;color:#333333;"&gt;So what I did here is pretty simple. I am taking the value of the ListItemFieldvalue property of the control and wrapping it under span tags. &lt;/span&gt;&lt;span style="font-family:arial;color:#333333;"&gt;This generates the correct html and as a result the image gets properly rendered with hyperlinks.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#333333;"&gt; &lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1377174316200906704-8934061131090097985?l=vivek-soni.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vivek-soni.blogspot.com/feeds/8934061131090097985/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vivek-soni.blogspot.com/2009/05/oob-publishing-image-field-with.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1377174316200906704/posts/default/8934061131090097985'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1377174316200906704/posts/default/8934061131090097985'/><link rel='alternate' type='text/html' href='http://vivek-soni.blogspot.com/2009/05/oob-publishing-image-field-with.html' title='OOB publishing image field with hyperlink bug: Resolved'/><author><name>Vivek</name><uri>http://www.blogger.com/profile/08310180297325901240</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_eTkvhTLeDPY/SnWbyjRk2rI/AAAAAAAAAQs/ElwvgOOCnfM/S220/DSC01417.JPG'/></author><thr:total>0</thr:total></entry></feed>
