<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Edward Wilde &#187; Edward Wilde</title>
	<atom:link href="http://blogs.edwardwilde.com/author/ewilde/feed/" rel="self" type="application/rss+xml" />
	<link>http://blogs.edwardwilde.com</link>
	<description>.Net &#38; SharePoint Developer / Architect</description>
	<lastBuildDate>Tue, 07 Feb 2012 08:19:19 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='blogs.edwardwilde.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Edward Wilde &#187; Edward Wilde</title>
		<link>http://blogs.edwardwilde.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://blogs.edwardwilde.com/osd.xml" title="Edward Wilde" />
	<atom:link rel='hub' href='http://blogs.edwardwilde.com/?pushpress=hub'/>
		<item>
		<title>Orchard CMS blogging with an iPhone</title>
		<link>http://blogs.edwardwilde.com/2012/02/07/orchard-cms-blogging-with-an-iphone/</link>
		<comments>http://blogs.edwardwilde.com/2012/02/07/orchard-cms-blogging-with-an-iphone/#comments</comments>
		<pubDate>Tue, 07 Feb 2012 08:19:12 +0000</pubDate>
		<dc:creator>Edward Wilde</dc:creator>
				<category><![CDATA[orchard]]></category>
		<category><![CDATA[blogging]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[metaweblogapi]]></category>

		<guid isPermaLink="false">https://edwardwilde.wordpress.com/?p=426</guid>
		<description><![CDATA[I’ve recently been evaluating the Orchard CMS project for an upcoming website I’m building for my award winning London diving club . I thought it would be really useful to be able to blog to the website straight after a days diving whilst the excitement and pictures were still fresh off the press. &#160; Step [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blogs.edwardwilde.com&amp;blog=9417511&amp;post=426&amp;subd=edwardwilde&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I’ve recently been evaluating the <a href="http://orchardproject.net">Orchard CMS project</a> for an upcoming website I’m building for my award winning <a href="http://clidive.org/">London diving club</a> <img style="border-style:none;" class="wlEmoticon wlEmoticon-smile" alt="Smile" src="http://edwardwilde.files.wordpress.com/2012/02/wlemoticon-smile.png?w=500" /> . I thought it would be really useful to be able to blog to the website straight after a days diving whilst the excitement and pictures were still fresh off the press.</p>
<p>&#160;</p>
<h2>Step 1: Create your Orchard blog if it doesn’t exist already</h2>
<p>&#160;</p>
<h2>Step 2: Turn on remote blog publishing</h2>
<p><a href="http://edwardwilde.files.wordpress.com/2012/02/image.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border-width:0;margin:0;" title="image" border="0" alt="image" src="http://edwardwilde.files.wordpress.com/2012/02/image_thumb.png?w=244&#038;h=236" width="244" height="236" /></a></p>
<p>&#160;</p>
<h2>Step 3: Retrieve your blog id</h2>
<p>Ochard’s remote blogging interface implements the <a href="http://xmlrpc.scripting.com/metaWeblogApi.html">MetaWeblog API</a>. Whilst some clients such as windows live writer support self discovery using the <a href="http://cyber.law.harvard.edu/blogs/gems/tech/rsd.html">real simple discovery mechanism</a>. Your blog id is required by some iphone clients</p>
<p>&#160;</p>
<p>Simple navigate to the following url: <a href="http://[path_to_your_blog]/rsd">http://[path_to_your_blog]/rsd</a> for my local development orchard install that was: <a href="http://localhost:30320/OrchardLocal/blog/rsd">http://localhost:30320/OrchardLocal/blog/rsd</a></p>
<p><a href="http://edwardwilde.files.wordpress.com/2012/02/image1.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border-width:0;margin:0;" title="image" border="0" alt="image" src="http://edwardwilde.files.wordpress.com/2012/02/image_thumb1.png?w=244&#038;h=235" width="244" height="235" /></a></p>
<p>Take a note of the blog id which in this case was 24</p>
<p>&#160;</p>
<h2>Step 4: Configure your iphone app</h2>
<p>I was very surprised to find out how few generic iPhone blogging clients there are.&#160; Whilst investigating this task I paid for and tried two apps:</p>
<ol>
<li><a href="http://blogpressapp.com">BlogPress</a> – (very buggy, does not seem to work with Ochard) </li>
<li><a href="http://bloggerplus.xmpp.kr/">BloggerPlus</a> – Does work! </li>
</ol>
<h2>Step 5: Configuring blogger plus to work with orchard</h2>
<p><a href="http://edwardwilde.files.wordpress.com/2012/02/photo.png"><img style="background-image:none;border-bottom:0;border-left:0;padding-left:0;padding-right:0;display:inline;border-top:0;border-right:0;padding-top:0;" title="photo" border="0" alt="photo" src="http://edwardwilde.files.wordpress.com/2012/02/photo_thumb.png?w=164&#038;h=244" width="164" height="244" /></a></p>
<ul>
<li>Enter your blogID from step 3</li>
<li>Note the XMLRPC is <a href="http://[ochardhost]/XmlRpc">http://[ochardhost]/XmlRpc</a></li>
<li>RSS is the same as XMLRPC</li>
</ul>
<h2>Step 6: Patching Orchard is required if v.1.3.10 or &lt;</h2>
<p>As of today 07/02/2012 my patch has not made it to the main Orchard code base, so if you are running Orchard v.1.3.10 or &lt; you need to download this change set <a href="http://orchard.codeplex.com/SourceControl/network/Forks/ewilde/18414/changeset/changes/1bda35a0f8f8">http://orchard.codeplex.com/SourceControl/network/Forks/ewilde/18414/changeset/changes/1bda35a0f8f8</a> and rebuild orchard</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/edwardwilde.wordpress.com/426/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/edwardwilde.wordpress.com/426/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/edwardwilde.wordpress.com/426/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/edwardwilde.wordpress.com/426/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/edwardwilde.wordpress.com/426/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/edwardwilde.wordpress.com/426/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/edwardwilde.wordpress.com/426/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/edwardwilde.wordpress.com/426/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/edwardwilde.wordpress.com/426/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/edwardwilde.wordpress.com/426/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/edwardwilde.wordpress.com/426/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/edwardwilde.wordpress.com/426/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/edwardwilde.wordpress.com/426/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/edwardwilde.wordpress.com/426/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blogs.edwardwilde.com&amp;blog=9417511&amp;post=426&amp;subd=edwardwilde&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blogs.edwardwilde.com/2012/02/07/orchard-cms-blogging-with-an-iphone/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/196d33ea9cdaf7817b98b981afe62c16?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Edward Wilde</media:title>
		</media:content>

		<media:content url="http://edwardwilde.files.wordpress.com/2012/02/wlemoticon-smile.png" medium="image">
			<media:title type="html">Smile</media:title>
		</media:content>

		<media:content url="http://edwardwilde.files.wordpress.com/2012/02/image_thumb.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://edwardwilde.files.wordpress.com/2012/02/image_thumb1.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://edwardwilde.files.wordpress.com/2012/02/photo_thumb.png" medium="image">
			<media:title type="html">photo</media:title>
		</media:content>
	</item>
		<item>
		<title>What is the current state of REST frameworks in .Net 4.0</title>
		<link>http://blogs.edwardwilde.com/2011/07/22/what-is-the-current-state-of-rest-frameworks-in-net-4-0/</link>
		<comments>http://blogs.edwardwilde.com/2011/07/22/what-is-the-current-state-of-rest-frameworks-in-net-4-0/#comments</comments>
		<pubDate>Fri, 22 Jul 2011 14:33:23 +0000</pubDate>
		<dc:creator>Edward Wilde</dc:creator>
				<category><![CDATA[.net]]></category>
		<category><![CDATA[frameworks]]></category>
		<category><![CDATA[rest]]></category>
		<category><![CDATA[wcf]]></category>

		<guid isPermaLink="false">http://blogs.edwardwilde.com/?p=391</guid>
		<description><![CDATA[WCF WebHttp Services in .NET 4 Part of the official .Net 4.0 framework release. WCF WebHttp Services is the flavor of WCF that is most appropriate for developers who need complete control over the URI, format, and protocol when building non-SOAP HTTP services— services that may or may not subscribe to RESTful architectural constraints. Documentation [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blogs.edwardwilde.com&amp;blog=9417511&amp;post=391&amp;subd=edwardwilde&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<h2>WCF WebHttp Services in .NET 4</h2>
<p>Part of the official .Net 4.0 framework release.</p>
<blockquote><p>WCF WebHttp Services is the flavor of WCF that is most appropriate for developers who need complete control over the URI, format, and protocol when building non-SOAP HTTP services— services that may or may not subscribe to RESTful architectural constraints.</p></blockquote>
<h3>Documentation</h3>
<p><a title="WCF WebHttp Service documentation" href="http://msdn.microsoft.com/en-us/library/bb412169.aspx">http://msdn.microsoft.com/en-us/library/bb412169.aspx</a></p>
<h3>Example</h3>
<p>Introducing WCF WebHttp Services in .NET 4:<a title=" http://blogs.msdn.com/b/endpoint/archive/2010/01/06/introducing-wcf-webhttp-services-in-net-4.aspx" href="http://blogs.msdn.com/b/endpoint/archive/2010/01/06/introducing-wcf-webhttp-services-in-net-4.aspx"> http://blogs.msdn.com/b/endpoint/archive/2010/01/06/introducing-wcf-webhttp-services-in-net-4.aspx</a></p>
<h2>WCF WebApi</h2>
<blockquote><p>This project focuses on allowing developers to expose their apis for programmatic access over HTTP by browsers and devices.</p></blockquote>
<p>Essentially this is a continuation of work done on the WCF Rest starter kit, and could be considered as a preview of wcf http services for .net 5.0?</p>
<h2>WCF REST Starter Kit (depreciated)</h2>
<blockquote><p>The new WCF Web Api&#8217;s recently announced at PDC replace the REST Starter Kit and provide significant enhancements including better access to HTTP, more flexibility with representations and support for jQuery. Please go to http://wcf.codeplex.com/ for more information.</p>
<p>Source:<a title="http://aspnet.codeplex.com/wikipage?title=WCF%20REST&amp;ProjectName=aspne" href="http://aspnet.codeplex.com/wikipage?title=WCF%20REST&amp;ProjectName=aspne"> http://aspnet.codeplex.com/wikipage?title=WCF%20REST&amp;ProjectName=aspne</a>t</p></blockquote>
<h2>Open Rasta</h2>
<blockquote><p>OpenRasta is a development framework targeting the Microsoft .NET platform for building web-based applications and services, and distributed under an Open-Source MIT License.</p>
<p>By focusing development around resources and HTTP methods, OpenRasta simplifies the creation of ReST-friendly interfaces.</p></blockquote>
<h3>Example</h3>
<p>How to create a rest service using Open Rasta: <a title="http://blogs.7digital.com/dev/2011/02/02/rest-in-practice-and-openrasta/" href="http://blogs.7digital.com/dev/2011/02/02/rest-in-practice-and-openrasta/">http://blogs.7digital.com/dev/2011/02/02/rest-in-practice-and-openrasta/</a></p>
<h2>RestSharp</h2>
<p><a title="http://restsharp.org/" href="http://restsharp.org/">http://restsharp.org/</a> A client only api for consuming rest services</p>
<blockquote><p>RestSharp is a simple, open source REST client for .NET designed primarily for consuming third-party HTTP APIs. <em>RestSharp is NOT</em>:</p>
<ul>
<li>A REST server framework</li>
<li>A SOAP client</li>
</ul>
</blockquote>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/edwardwilde.wordpress.com/391/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/edwardwilde.wordpress.com/391/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/edwardwilde.wordpress.com/391/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/edwardwilde.wordpress.com/391/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/edwardwilde.wordpress.com/391/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/edwardwilde.wordpress.com/391/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/edwardwilde.wordpress.com/391/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/edwardwilde.wordpress.com/391/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/edwardwilde.wordpress.com/391/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/edwardwilde.wordpress.com/391/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/edwardwilde.wordpress.com/391/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/edwardwilde.wordpress.com/391/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/edwardwilde.wordpress.com/391/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/edwardwilde.wordpress.com/391/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blogs.edwardwilde.com&amp;blog=9417511&amp;post=391&amp;subd=edwardwilde&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blogs.edwardwilde.com/2011/07/22/what-is-the-current-state-of-rest-frameworks-in-net-4-0/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/196d33ea9cdaf7817b98b981afe62c16?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Edward Wilde</media:title>
		</media:content>
	</item>
		<item>
		<title>SQL Server Express 2008 R2 &#8211; Installing on Windows 7 with Visual Studio 2010</title>
		<link>http://blogs.edwardwilde.com/2010/06/04/sql-server-express-2008-r2-installing-on-windows-7-with-visual-studio-2010/</link>
		<comments>http://blogs.edwardwilde.com/2010/06/04/sql-server-express-2008-r2-installing-on-windows-7-with-visual-studio-2010/#comments</comments>
		<pubDate>Fri, 04 Jun 2010 10:07:52 +0000</pubDate>
		<dc:creator>Edward Wilde</dc:creator>
				<category><![CDATA[sql]]></category>

		<guid isPermaLink="false">http://blogs.edwardwilde.com/?p=384</guid>
		<description><![CDATA[Today I was trying to install the latest management tools for SQL Server using SQL Server Express 2008 R2 on a Windows 7 machine with Visual Studio 2010 running the setup up file I got the follow error message: Solution: surprisingly easy just press Continue!<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blogs.edwardwilde.com&amp;blog=9417511&amp;post=384&amp;subd=edwardwilde&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Today I was trying to install the latest management tools for SQL Server using <a href="http://www.microsoft.com/express/Database/InstallOptions.aspx">SQL Server Express 2008 R2</a> on a Windows 7 machine with Visual Studio 2010 running the setup up file I got the follow error message:</p>
<p><pre class="brush: plain;">
System.Configuration.ConfigurationErrorsException: An error occurred creating the configuration section handler for userSettings/Microsoft.SqlServer.Configuration.LandingPage.Properties.Settings: Could not load file or assembly 'System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. The system cannot find the file specified.
</pre></p>
<p><strong>Solution:</strong> surprisingly easy just press <strong>Continue</strong>!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/edwardwilde.wordpress.com/384/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/edwardwilde.wordpress.com/384/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/edwardwilde.wordpress.com/384/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/edwardwilde.wordpress.com/384/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/edwardwilde.wordpress.com/384/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/edwardwilde.wordpress.com/384/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/edwardwilde.wordpress.com/384/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/edwardwilde.wordpress.com/384/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/edwardwilde.wordpress.com/384/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/edwardwilde.wordpress.com/384/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/edwardwilde.wordpress.com/384/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/edwardwilde.wordpress.com/384/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/edwardwilde.wordpress.com/384/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/edwardwilde.wordpress.com/384/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blogs.edwardwilde.com&amp;blog=9417511&amp;post=384&amp;subd=edwardwilde&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blogs.edwardwilde.com/2010/06/04/sql-server-express-2008-r2-installing-on-windows-7-with-visual-studio-2010/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/196d33ea9cdaf7817b98b981afe62c16?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Edward Wilde</media:title>
		</media:content>
	</item>
		<item>
		<title>How to add custom validators to the SharePoint ListFieldIterator</title>
		<link>http://blogs.edwardwilde.com/2010/04/28/how-to-add-custom-validators-to-the-sharepoint-listfielditerator/</link>
		<comments>http://blogs.edwardwilde.com/2010/04/28/how-to-add-custom-validators-to-the-sharepoint-listfielditerator/#comments</comments>
		<pubDate>Wed, 28 Apr 2010 15:29:09 +0000</pubDate>
		<dc:creator>Edward Wilde</dc:creator>
				<category><![CDATA[.net]]></category>
		<category><![CDATA[sharepoint]]></category>
		<category><![CDATA[BaseValidator]]></category>
		<category><![CDATA[sharepoint ListFieldIterator]]></category>

		<guid isPermaLink="false">https://edwardwilde.wordpress.com/?p=376</guid>
		<description><![CDATA[Requirements Today I had the requirement to add custom validation logic to a SharePoint edit form. The edit form is being displayed using a ListFieldIterator. The requirement was to make sure the Date field could not be set to a date in the past. The solution (Other solutions are available and are most probably better!) [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blogs.edwardwilde.com&amp;blog=9417511&amp;post=376&amp;subd=edwardwilde&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<h1>Requirements</h1>
<p>Today I had the requirement to add custom validation logic to a SharePoint edit form. The edit form is being displayed using a ListFieldIterator. The requirement was to make sure the Date field could not be set to a date in the past.</p>
<p>The solution (Other solutions are available and are most probably better!) I came up with involved subclassing ListFieldIterator and attaching ASP.NET validators at run-time.</p>
<h1>Challenge 1</h1>
<p>How do you attach a ASP.NET validation control at run-time.</p>
<ul>
<li>Attach the validator at the correct stage of the page/control life-cycle.  In the case of the ListFieldIterator I wanted to attach it after the control had build it&#8217;s control tree. Override <strong>CreateChildControls</strong>, call base, then attach.</li>
</ul>
<ul>
<li>Find the <strong>FormField </strong>associated with the SharePoint field (SPField) you want to validate.I have an extension method that I use to parse the control hierarchy of a ListFieldIterator as follows:</li>
</ul>
<p>
<b>Usage:</b><br />
<pre class="brush: csharp;">
FormField formField = listFieldIterator.GetFormField(&quot;MyInternalFieldName&quot;);
</pre>
</p>
<p><pre class="brush: csharp;">
public static class ListFieldIteratorExtensions
{
    public static FormField GetFormField(this ListFieldIterator listFieldIterator, string fieldName)
    {
        return GetFormField(listFieldIterator, GetFormFields(listFieldIterator), fieldName);
    }


    public static FormField GetFormField(this ListFieldIterator listFieldIterator, List&lt;FormField&gt; formFields, string fieldName)
    {
        FormField formField = (from form in formFields
                               where form.FieldName.Equals(fieldName, StringComparison.InvariantCultureIgnoreCase)
                               select form).FirstOrDefault();

        if (formField == null)
        {
            throw new GeneralApplicationException(&quot;Could not find form field: &quot; + fieldName);
        }

        return formField;
    }

    public static List&lt;FormField&gt; GetFormFields(this ListFieldIterator listFieldIterator)
    {
        if (listFieldIterator == null)
        {
            return null;
        }

        return FindFieldFormControls(listFieldIterator);
    }        

    private static List&lt;FormField&gt; FindFieldFormControls(System.Web.UI.Control root)
    {
        List&lt;FormField&gt; baseFieldControls = new List&lt;FormField&gt;();

        foreach (System.Web.UI.Control control in root.Controls)
        {
            if (control is FormField &amp;&amp; control.Visible)
            {
                FormField formField = control as FormField;
                if (formField.Field.FieldValueType == typeof(DateTime))
                {
                    HandleDateField(formField);
                }

                baseFieldControls.Add(formField);
            }
            else
            {
                baseFieldControls.AddRange(FindFieldFormControls(control));
            }
        }

        return baseFieldControls;
    }

    private static void HandleDateField(FormField formField)
    {
        if (formField.ControlMode == SPControlMode.Display)
        {
            return;
        }

        Control dateFieldControl = formField.Controls[0];
        if (dateFieldControl.Controls.Count &gt; 0)
        {
            DateTimeControl dateTimeControl = (DateTimeControl) dateFieldControl.Controls[0].Controls[1];
            TextBox dateTimeTextBox = dateTimeControl.Controls[0] as TextBox;
            if (dateTimeTextBox != null)
            {
                if (!string.IsNullOrEmpty(dateTimeTextBox.Text))
                {
                    formField.Value = DateTime.Parse(dateTimeTextBox.Text, CultureInfo.CurrentCulture);
                }
            } 
        }
    }
}
</pre></p>
<ul>
<li>
	Find the <b>Control that is rendered by the FieldControl.Field.FieldRenderingControl</b>. In my specific case a DateTimeField will render a DateTimeControl. Now that we have the form field we grab the rendering control:
</li>
</ul>
<p>
<b>Usage:</b><br />
<pre class="brush: csharp;">
Control renderedControl = GetControl(formField);
</pre>
</p>
<p>
<pre class="brush: csharp;">
private static Control GetControl(FieldMetadata formField)
{
    return formField.FindControlRecursive(x =&gt; x.GetType() == GetChildControlBasedOnFieldType(formField.Field.FieldRenderingControl));
}

private static Type GetChildControlBasedOnFieldType(object field)
{
    if (field is TextField)
    {
        return typeof(TextBox);
    }

    if (field is DropDownChoiceField)
    {
        return typeof(DropDownList);
    }

    if (field is DateTimeField)
    {
        return typeof (DateTimeControl);
    }

    return null;
}

public static Control FindControlRecursive(this Control control, Func&lt;Control, bool&gt; evaluate)
{
    if (evaluate.Invoke(control))
    {
        return control;
    }

    foreach (Control childControl in control.Controls)
    {
        Control foundControl = FindControlRecursive(childControl, evaluate);
        if (foundControl != null)
        {
            return foundControl;
        }
    }

    return null;
} 
</pre>
</p>
<ul>
<li>Now we have found the control we want to validate, we can add the ASP.NET to it&#8217;s parent&#8217;s control collection</li>
</ul>
<p>
<pre class="brush: csharp;">
renderedControl.Parent.Controls.AddAfter(control, validator as Control);
</pre></p>
<p>
Uses another little extension method:
</p>
<p>
<pre class="brush: csharp;">
public static void AddAfter(this ControlCollection collection, Control after, Control control)
{
    int indexFound = -1;
    int currentIndex = 0;
    foreach (Control controlToEvaluate in collection)
    {
        if (controlToEvaluate == after)
        {
            indexFound = currentIndex;
            break;
        }

        currentIndex = currentIndex + 1;
    }

    if (indexFound == -1)
    {
        throw new ArgumentOutOfRangeException(&quot;control&quot;, &quot;Control not found&quot;);
    }

    collection.AddAt(indexFound + 1, control);
}
</pre></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/edwardwilde.wordpress.com/376/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/edwardwilde.wordpress.com/376/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/edwardwilde.wordpress.com/376/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/edwardwilde.wordpress.com/376/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/edwardwilde.wordpress.com/376/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/edwardwilde.wordpress.com/376/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/edwardwilde.wordpress.com/376/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/edwardwilde.wordpress.com/376/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/edwardwilde.wordpress.com/376/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/edwardwilde.wordpress.com/376/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/edwardwilde.wordpress.com/376/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/edwardwilde.wordpress.com/376/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/edwardwilde.wordpress.com/376/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/edwardwilde.wordpress.com/376/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blogs.edwardwilde.com&amp;blog=9417511&amp;post=376&amp;subd=edwardwilde&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blogs.edwardwilde.com/2010/04/28/how-to-add-custom-validators-to-the-sharepoint-listfielditerator/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/196d33ea9cdaf7817b98b981afe62c16?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Edward Wilde</media:title>
		</media:content>
	</item>
		<item>
		<title>How do you update the &#8216;Author&#8217; or &#8216;Created by&#8217; and &#8216;Editor&#8217; or &#8216;Modified By / Last Modified&#8217; fields of a list item (SPListItem)</title>
		<link>http://blogs.edwardwilde.com/2010/04/21/how-do-you-update-the-author-or-created-by-and-editor-or-modified-by-last-modified-fields-of-a-list-item-splistitem/</link>
		<comments>http://blogs.edwardwilde.com/2010/04/21/how-do-you-update-the-author-or-created-by-and-editor-or-modified-by-last-modified-fields-of-a-list-item-splistitem/#comments</comments>
		<pubDate>Wed, 21 Apr 2010 13:49:26 +0000</pubDate>
		<dc:creator>Edward Wilde</dc:creator>
				<category><![CDATA[.net]]></category>
		<category><![CDATA[sharepoint]]></category>
		<category><![CDATA[SPListItem]]></category>
		<category><![CDATA[SPListItem.UpdateOverwriteVersion()]]></category>

		<guid isPermaLink="false">http://edwardwilde.wordpress.com/?p=373</guid>
		<description><![CDATA[Sometimes it&#8217;s useful to overwrite the created by and last modified by fields and get rid of that pesky &#8216;System Account&#8217; ! Created By The internal field name for the person who created a list item is ‘Author’ use SPBuiltInFieldId.Author to access this field. The display name for this field is ‘Created By’ it can [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blogs.edwardwilde.com&amp;blog=9417511&amp;post=373&amp;subd=edwardwilde&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Sometimes it&#8217;s useful to overwrite the created by and last modified by fields and get rid of that pesky &#8216;System Account&#8217; !</p>
<h3>Created By</h3>
<p>The internal field name for the person who created a list item is ‘<strong>Author</strong>’ use SPBuiltInFieldId.Author to access this field. The display name for this field is ‘<strong>Created By</strong>’ it can be seen in the UI circled below:</p>
<p><a href="http://edwardwilde.files.wordpress.com/2010/04/splistitemcreatedbyauthor.png"><img style="display:inline;border:0;" title="SPListItem CreatedBy Author" src="http://edwardwilde.files.wordpress.com/2010/04/splistitemcreatedbyauthor_thumb.png?w=481&#038;h=295" border="0" alt="SPListItem CreatedBy Author" width="481" height="295" /></a></p>
<h3>Last modified</h3>
<p>The internal field name for the person who created a list item is ‘<strong>Editor</strong>’ use SPBuiltInFieldId.Editor to access this field. The display name for this field is ‘<strong>Modified By</strong>’ it can be seen in the UI circled below:</p>
<p><a href="http://edwardwilde.files.wordpress.com/2010/04/splistitemmodifiedbyeditor.png"><img style="display:inline;border:0;" title="SPListItem ModifiedBy Editor" src="http://edwardwilde.files.wordpress.com/2010/04/splistitemmodifiedbyeditor_thumb.png?w=481&#038;h=301" border="0" alt="SPListItem ModifiedBy Editor" width="481" height="301" /></a></p>
<h3>Updating Created By, Modified By</h3>
<p>The trick here is to call <strong>SPListItem.UpdateOverwriteVersion()</strong> instead of SPListItem.Update()</p>
<p><pre class="brush: csharp;">
SPListItem item = list.Items[0];
item[SPBuiltInFieldId.Author] = &quot;1;#Edward Wilde&quot;;
item[SPBuiltInFieldId.Editor] = &quot;1;#Edward Wilde&quot;;
copiedItem.UpdateOverwriteVersion();
</pre></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/edwardwilde.wordpress.com/373/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/edwardwilde.wordpress.com/373/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/edwardwilde.wordpress.com/373/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/edwardwilde.wordpress.com/373/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/edwardwilde.wordpress.com/373/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/edwardwilde.wordpress.com/373/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/edwardwilde.wordpress.com/373/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/edwardwilde.wordpress.com/373/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/edwardwilde.wordpress.com/373/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/edwardwilde.wordpress.com/373/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/edwardwilde.wordpress.com/373/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/edwardwilde.wordpress.com/373/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/edwardwilde.wordpress.com/373/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/edwardwilde.wordpress.com/373/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blogs.edwardwilde.com&amp;blog=9417511&amp;post=373&amp;subd=edwardwilde&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blogs.edwardwilde.com/2010/04/21/how-do-you-update-the-author-or-created-by-and-editor-or-modified-by-last-modified-fields-of-a-list-item-splistitem/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/196d33ea9cdaf7817b98b981afe62c16?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Edward Wilde</media:title>
		</media:content>

		<media:content url="http://edwardwilde.files.wordpress.com/2010/04/splistitemcreatedbyauthor_thumb.png" medium="image">
			<media:title type="html">SPListItem CreatedBy Author</media:title>
		</media:content>

		<media:content url="http://edwardwilde.files.wordpress.com/2010/04/splistitemmodifiedbyeditor_thumb.png" medium="image">
			<media:title type="html">SPListItem ModifiedBy Editor</media:title>
		</media:content>
	</item>
		<item>
		<title>Typemock: System.NotSupportedException: Cannot dynamically create an instance of System.Void.</title>
		<link>http://blogs.edwardwilde.com/2010/04/19/typemock-system-notsupportedexception-cannot-dynamically-create-an-instance-of-system-void/</link>
		<comments>http://blogs.edwardwilde.com/2010/04/19/typemock-system-notsupportedexception-cannot-dynamically-create-an-instance-of-system-void/#comments</comments>
		<pubDate>Mon, 19 Apr 2010 12:21:36 +0000</pubDate>
		<dc:creator>Edward Wilde</dc:creator>
				<category><![CDATA[unit testing]]></category>
		<category><![CDATA[typemock]]></category>

		<guid isPermaLink="false">http://edwardwilde.wordpress.com/?p=362</guid>
		<description><![CDATA[Had a problem mocking a call to SPWorkflowActivationProperties.Item today. Turns out to be a bug in the TypeMock library. Problematic unit test When executed it throws the following exception: Fix: I can work around this issue by replacing the line: With: See thread on Typemock forum<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blogs.edwardwilde.com&amp;blog=9417511&amp;post=362&amp;subd=edwardwilde&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Had a problem mocking a call to SPWorkflowActivationProperties.Item today. Turns out to be a bug in the TypeMock library.</p>
<p><b>Problematic unit test</b><br />
<pre class="brush: csharp;">
[Test, Isolated]
        public void PublishToExternalDocumentLibrary_Calls_CopyTo_Correctly()
        {
            ApprovalWorkflow approvalWorkflow = Isolate.Fake.Instance&lt;ApprovalWorkflow&gt;(Members.CallOriginal, ConstructorWillBe.Called);
            SPWorkflowActivationProperties activationProperties = Isolate.Fake.Instance&lt;SPWorkflowActivationProperties&gt;(Members.CallOriginal, ConstructorWillBe.Called);
            SPListItem item = Isolate.Fake.Instance&lt;SPListItem&gt;();

            Isolate.WhenCalled(() =&gt; approvalWorkflow.PublishWhenComplete).WillReturn(true);
            Isolate.WhenCalled(() =&gt; approvalWorkflow.PublishDocumentLibraryUrl).WillReturn(ExternalDocumentLibraryUrl);
            Isolate.WhenCalled(() =&gt; approvalWorkflow.WorkflowActivationProperties).WillReturn(activationProperties);
            Isolate.WhenCalled(() =&gt; activationProperties.Item).WillReturn(item);
           
            Isolate.WhenCalled(() =&gt; item.Name).WillReturn(&quot;test.docx&quot;);
           
            // Fire the workflow completed event
            Isolate.Invoke.Event(() =&gt; approvalWorkflow.Completed += null, new object[] { this, EventArgs.Empty });

            Isolate.Verify.WasCalledWithExactArguments(() =&gt; item.CopyTo(&quot;http://xdev03.trading.ad.int.corp.local/Policies/test.docx&quot;));
        } 
</pre>
</p>
<p>When executed it throws the following exception:<br />
<pre class="brush: csharp;">
System.NotSupportedException: Cannot dynamically create an instance of System.Void.
at System.RuntimeType.CreateInstanceCheckThis()
at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean fillCache)
at System.RuntimeType.CreateInstanceImpl(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean fillCache)
at System.RuntimeType.CreateInstanceImpl(Boolean publicOnly)
at System.Activator.CreateInstance(Type type, Boolean nonPublic)
at System.Activator.CreateInstance(Type type)
at hi.b(MethodBase A_0)
at hi.a(MethodBase A_0, fk A_1)
at a.a(fk A_0)
at a.c(fk A_0)
at fz.a(fk A_0)
at fz.a(Object A_0, MethodBase A_1, Object[] A_2)
at fz.a(Object A_0, String A_1, String A_2, MethodBase A_3, Object[] A_4, Object A_5)
at Microsoft.SharePoint.Security.SharePointPermissionAttribute.CreatePermission()
at System.Security.PermissionSet.CreateSerialized(Object[] attrs, Boolean serialize, Byte[]&amp; nonCasBlob, PermissionSet&amp; casPset, HostProtectionResource fullTrustOnlyResources)
at Microsoft.SharePoint.Workflow.SPWorkflowActivationProperties.get_Item()
at Total.SharePoint.Approval.Workflow.Test.ApprovalWorkflowFixture.&lt;&gt;c__DisplayClassd.&lt;PublishToExternalDocumentLibrary_Calls_CopyTo_Correctly&gt;b__9() in ApprovalWorkflowFixture.cs: line 44
at TypeMock.MockManager.a(String A_0, String A_1, Object A_2, Object A_3, Boolean A_4, Object[] A_5)
at TypeMock.InternalMockManager.getReturn(Object that, String typeName, String methodName, Object methodParameters, Boolean isInjected)
at Total.SharePoint.Approval.Workflow.Test.ApprovalWorkflowFixture.PublishToExternalDocumentLibrary_Calls_CopyTo_Correctly() in ApprovalWorkflowFixture.cs: line 0 
</pre>
</p>
<p>
<b>Fix:</b><br />
I can work around this issue by replacing the line:<br />
<pre class="brush: csharp;">
Isolate.WhenCalled(() =&gt; activationProperties.Item).WillReturn(item);
</pre></p>
<p>
With:<br />
<pre class="brush: csharp;">
Isolate.NonPublic.WhenCalled(activationProperties, &quot;get_Item&quot;).WillReturn(item); 
</pre>
</p>
<p><a href="http://www.typemock.com/community/viewtopic.php?t=1760&amp;highlight=">See thread on Typemock forum</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/edwardwilde.wordpress.com/362/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/edwardwilde.wordpress.com/362/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/edwardwilde.wordpress.com/362/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/edwardwilde.wordpress.com/362/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/edwardwilde.wordpress.com/362/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/edwardwilde.wordpress.com/362/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/edwardwilde.wordpress.com/362/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/edwardwilde.wordpress.com/362/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/edwardwilde.wordpress.com/362/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/edwardwilde.wordpress.com/362/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/edwardwilde.wordpress.com/362/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/edwardwilde.wordpress.com/362/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/edwardwilde.wordpress.com/362/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/edwardwilde.wordpress.com/362/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blogs.edwardwilde.com&amp;blog=9417511&amp;post=362&amp;subd=edwardwilde&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blogs.edwardwilde.com/2010/04/19/typemock-system-notsupportedexception-cannot-dynamically-create-an-instance-of-system-void/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/196d33ea9cdaf7817b98b981afe62c16?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Edward Wilde</media:title>
		</media:content>
	</item>
		<item>
		<title>InfoPath forms with workflow: &#8216;The form has been closed&#8217; or Exception occurred during request processing. (User: {Domain}\{UserName}, Form Name: , IP: , Request: http://localhost/_layouts/CstWrkflIP.aspx?List={ID}, Form ID: , Type: InfoPathLocalizedException, Exception Message: The specified form cannot be found.)</title>
		<link>http://blogs.edwardwilde.com/2010/04/07/infopath-forms-with-workflow-the-form-has-been-closed-or-exception-occurred-during-request-processing-user-domainusername-form-name-ip-request-httplocalhost_layouts/</link>
		<comments>http://blogs.edwardwilde.com/2010/04/07/infopath-forms-with-workflow-the-form-has-been-closed-or-exception-occurred-during-request-processing-user-domainusername-form-name-ip-request-httplocalhost_layouts/#comments</comments>
		<pubDate>Wed, 07 Apr 2010 15:31:53 +0000</pubDate>
		<dc:creator>Edward Wilde</dc:creator>
				<category><![CDATA[infopath]]></category>
		<category><![CDATA[sharepoint]]></category>

		<guid isPermaLink="false">http://edwardwilde.wordpress.com/2010/04/07/infopath-forms-with-workflow-the-form-has-been-closed-or-exception-occurred-during-request-processing-user-domainusername-form-name-ip-request-httplocalhost_layouts/</guid>
		<description><![CDATA[Okay so today’s error message, totally my fault: was Exception occurred during request processing. (User: DOMAIN\xx, Form Name: , IP: , Request: http://localhost/_layouts/CstWrkflIP.aspx?List={ID}, Form ID: , Type: InfoPathLocalizedException, Exception Message: The specified form cannot be found.) Make sure that: Your feature file has the RegisterFroms property correctly pointing to a folder in your solution package [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blogs.edwardwilde.com&amp;blog=9417511&amp;post=361&amp;subd=edwardwilde&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Okay so today’s error message, totally my fault: was</p>
<blockquote><p>Exception occurred during request processing. (User: DOMAIN\xx, Form Name: , IP: , Request: <a href="http://localhost/_layouts/CstWrkflIP.aspx?List={ID}">http://localhost/_layouts/CstWrkflIP.aspx?List={ID}</a>, Form ID: , Type: InfoPathLocalizedException, Exception Message: The specified form cannot be found.)</p>
</blockquote>
<blockquote></blockquote>
<p><font color="#333333"></font></p>
<p>Make sure that:</p>
<ul>
<li>Your feature file has the RegisterFroms property correctly pointing to a folder in your solution package that contains your infopath forms     </p>
<p><a href="http://edwardwilde.files.wordpress.com/2010/04/windowclipping23.png"><img title="WindowClipping (23)" style="border-right:0;border-top:0;display:inline;border-left:0;border-bottom:0;" height="100" alt="WindowClipping (23)" src="http://edwardwilde.files.wordpress.com/2010/04/windowclipping23_thumb.png?w=541&#038;h=100" width="541" border="0" /></a>       <br />In my example all my info paths forms are contained in a sub directory called ‘Forms’ relative to feature file:      <br /><a href="http://edwardwilde.files.wordpress.com/2010/04/windowclipping24.png"><img title="WindowClipping (24)" style="border-right:0;border-top:0;display:inline;border-left:0;border-bottom:0;" height="381" alt="WindowClipping (24)" src="http://edwardwilde.files.wordpress.com/2010/04/windowclipping24_thumb.png?w=359&#038;h=381" width="359" border="0" /></a>       </li>
<li>Once the feature has been installed using <strong>stsadm –o install feature</strong> check that the forms have been placed in the InfoPath template library.
<p>Central Administration –&gt; <strong>Application Management –&gt; Manage Form Templates</strong>:      </p>
<p><a href="http://edwardwilde.files.wordpress.com/2010/04/windowclipping25.png"><img title="WindowClipping (25)" style="border-right:0;border-top:0;display:inline;border-left:0;border-bottom:0;" height="612" alt="WindowClipping (25)" src="http://edwardwilde.files.wordpress.com/2010/04/windowclipping25_thumb.png?w=642&#038;h=612" width="642" border="0" /></a> </li>
</ul>
</p>
<p>As always, your mileage my vary. If this doesn’t help you could try some of the tips on Lucy’s blog: h<a title="http://blogs.tamtam.nl/lucy/2007/06/08/WorkflowErrors.aspx" href="http://blogs.tamtam.nl/lucy/2007/06/08/WorkflowErrors.aspx">ttp://blogs.tamtam.nl/lucy/2007/06/08/WorkflowErrors.aspx</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/edwardwilde.wordpress.com/361/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/edwardwilde.wordpress.com/361/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/edwardwilde.wordpress.com/361/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/edwardwilde.wordpress.com/361/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/edwardwilde.wordpress.com/361/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/edwardwilde.wordpress.com/361/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/edwardwilde.wordpress.com/361/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/edwardwilde.wordpress.com/361/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/edwardwilde.wordpress.com/361/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/edwardwilde.wordpress.com/361/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/edwardwilde.wordpress.com/361/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/edwardwilde.wordpress.com/361/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/edwardwilde.wordpress.com/361/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/edwardwilde.wordpress.com/361/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blogs.edwardwilde.com&amp;blog=9417511&amp;post=361&amp;subd=edwardwilde&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blogs.edwardwilde.com/2010/04/07/infopath-forms-with-workflow-the-form-has-been-closed-or-exception-occurred-during-request-processing-user-domainusername-form-name-ip-request-httplocalhost_layouts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/196d33ea9cdaf7817b98b981afe62c16?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Edward Wilde</media:title>
		</media:content>

		<media:content url="http://edwardwilde.files.wordpress.com/2010/04/windowclipping23_thumb.png" medium="image">
			<media:title type="html">WindowClipping (23)</media:title>
		</media:content>

		<media:content url="http://edwardwilde.files.wordpress.com/2010/04/windowclipping24_thumb.png" medium="image">
			<media:title type="html">WindowClipping (24)</media:title>
		</media:content>

		<media:content url="http://edwardwilde.files.wordpress.com/2010/04/windowclipping25_thumb.png" medium="image">
			<media:title type="html">WindowClipping (25)</media:title>
		</media:content>
	</item>
		<item>
		<title>Toolbox &#8211;&gt; &quot;Choose items&quot; crashes Visual Studio</title>
		<link>http://blogs.edwardwilde.com/2010/03/02/toolbox-choose-items-crashes-visual-studio/</link>
		<comments>http://blogs.edwardwilde.com/2010/03/02/toolbox-choose-items-crashes-visual-studio/#comments</comments>
		<pubDate>Tue, 02 Mar 2010 13:30:37 +0000</pubDate>
		<dc:creator>Edward Wilde</dc:creator>
				<category><![CDATA[bugs]]></category>
		<category><![CDATA[visual studio]]></category>
		<category><![CDATA[visualstudio bugs]]></category>

		<guid isPermaLink="false">http://edwardwilde.wordpress.com/2010/03/02/toolbox-choose-items-crashes-visual-studio/</guid>
		<description><![CDATA[If you ever encounter a crash when choosing the items to display in Visual Studios toolbox, then try this solution: &#160; Start Visual Studio in safe mode using:&#160; Start-&#62;Run-&#62;devenv /safemode In the Toolbox “Choose items”, accept any error message the appear Restart Visual Studio as per normal and the problem should be fixed.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blogs.edwardwilde.com&amp;blog=9417511&amp;post=354&amp;subd=edwardwilde&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>If you ever encounter a crash when choosing the items to display in Visual Studios toolbox, then try this solution:</p>
<p>&#160;</p>
<ul>
<li>Start Visual Studio in safe mode using:&#160; Start-&gt;Run-&gt;<strong>devenv /safemode</strong></li>
<li>In the Toolbox “Choose items”, accept any error message the appear</li>
<li>Restart Visual Studio as per normal and the problem should be fixed.</li>
</ul>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/edwardwilde.wordpress.com/354/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/edwardwilde.wordpress.com/354/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/edwardwilde.wordpress.com/354/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/edwardwilde.wordpress.com/354/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/edwardwilde.wordpress.com/354/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/edwardwilde.wordpress.com/354/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/edwardwilde.wordpress.com/354/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/edwardwilde.wordpress.com/354/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/edwardwilde.wordpress.com/354/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/edwardwilde.wordpress.com/354/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/edwardwilde.wordpress.com/354/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/edwardwilde.wordpress.com/354/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/edwardwilde.wordpress.com/354/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/edwardwilde.wordpress.com/354/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blogs.edwardwilde.com&amp;blog=9417511&amp;post=354&amp;subd=edwardwilde&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blogs.edwardwilde.com/2010/03/02/toolbox-choose-items-crashes-visual-studio/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/196d33ea9cdaf7817b98b981afe62c16?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Edward Wilde</media:title>
		</media:content>
	</item>
		<item>
		<title>Cannot change the lookup list of the lookup field.</title>
		<link>http://blogs.edwardwilde.com/2010/02/08/cannot-change-the-lookup-list-of-the-lookup-field/</link>
		<comments>http://blogs.edwardwilde.com/2010/02/08/cannot-change-the-lookup-list-of-the-lookup-field/#comments</comments>
		<pubDate>Mon, 08 Feb 2010 17:05:59 +0000</pubDate>
		<dc:creator>Edward Wilde</dc:creator>
				<category><![CDATA[.net]]></category>
		<category><![CDATA[sharepoint]]></category>
		<category><![CDATA[SPFieldLookup]]></category>

		<guid isPermaLink="false">http://blogs.edwardwilde.com/?p=346</guid>
		<description><![CDATA[Ever get this error message SPException &#8220;Cannot change the lookup list of the lookup field.&#8221; Once a lookup field (SPFieldLookup) has had it&#8217;s LookupList and LookupWebId set you can&#8217;t change them. There is a good reason for this if your lookup field is used in multiple lists or already has data entered, you would effectively [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blogs.edwardwilde.com&amp;blog=9417511&amp;post=346&amp;subd=edwardwilde&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Ever get this error message</p>
<p>SPException &#8220;Cannot change the lookup list of the lookup field.&#8221;</p>
<p>Once a lookup field (SPFieldLookup) has had it&#8217;s LookupList and LookupWebId set you can&#8217;t change them.</p>
<p><strong>There is a good reason for this </strong>if your lookup field is used in multiple lists or already has data entered, you would effectively break the referential integrity of the data. So what I&#8217;m showing here as a work-around to this error message should only be used if you are *sure* no lists reference the lookup column or no lists have any data using this column</p>
<p>Okay with the health warning out of the way the work-around is simply to update the Schema property to overwrite the intervalues for List &amp; WebId</p>
<p>I created a handy extension method for dealing with the string manipulation:</p>
<p><strong>Usage:</strong><br />
<pre class="brush: csharp;">
SPFieldLookup field = (SPFieldLookup)site.RootWeb.Fields[MyId];
field.UpdateLookupReferences(newWeb, newList);
</pre></p>
<p><strong>Implementation:</strong><br />
<pre class="brush: csharp;">
public static class SPFieldLookupExtensions
{
    public static void UpdateLookupReferences(this SPFieldLookup lookupField, SPWeb web, SPList list)
    {
        if (string.IsNullOrEmpty(lookupField.LookupList))
        {
            lookupField.LookupWebId = web.ID;
            lookupField.LookupList = list.ID.ToString();
        }
        else
        {
            lookupField.SchemaXml =
                lookupField.SchemaXml
                    .ReplaceXmlAttributeValue(&quot;List&quot;, list.ID.ToString())
                    .ReplaceXmlAttributeValue(&quot;WebId&quot;, web.ID.ToString());
        }

        lookupField.Update(true);
    }
}

public static string ReplaceXmlAttributeValue(this string xml, string attributeName, string value)
{
    if (string.IsNullOrEmpty(xml))
    {
        throw new ArgumentNullException(&quot;xml&quot;);
    }

    if (string.IsNullOrEmpty(value))
    {
        throw new ArgumentNullException(&quot;value&quot;);
    }


    int indexOfAttributeName = xml.IndexOf(attributeName, StringComparison.CurrentCultureIgnoreCase);
    if (indexOfAttributeName == -1)
    {
        throw new ArgumentOutOfRangeException(&quot;attributeName&quot;, string.Format(&quot;Attribute {0} not found in source xml&quot;, attributeName));
    }

    int indexOfAttibuteValueBegin = xml.IndexOf('&quot;', indexOfAttributeName);
    int indexOfAttributeValueEnd = xml.IndexOf('&quot;', indexOfAttibuteValueBegin + 1);

    return xml.Substring(0, indexOfAttibuteValueBegin + 1) + value + xml.Substring(indexOfAttributeValueEnd);
}
</pre></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/edwardwilde.wordpress.com/346/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/edwardwilde.wordpress.com/346/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/edwardwilde.wordpress.com/346/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/edwardwilde.wordpress.com/346/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/edwardwilde.wordpress.com/346/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/edwardwilde.wordpress.com/346/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/edwardwilde.wordpress.com/346/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/edwardwilde.wordpress.com/346/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/edwardwilde.wordpress.com/346/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/edwardwilde.wordpress.com/346/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/edwardwilde.wordpress.com/346/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/edwardwilde.wordpress.com/346/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/edwardwilde.wordpress.com/346/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/edwardwilde.wordpress.com/346/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blogs.edwardwilde.com&amp;blog=9417511&amp;post=346&amp;subd=edwardwilde&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blogs.edwardwilde.com/2010/02/08/cannot-change-the-lookup-list-of-the-lookup-field/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/196d33ea9cdaf7817b98b981afe62c16?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Edward Wilde</media:title>
		</media:content>
	</item>
		<item>
		<title>Engine RunWorkflow: System.Workflow.ComponentModel.Compiler.WorkflowValidationFailedException: The workflow failed validation.</title>
		<link>http://blogs.edwardwilde.com/2010/01/21/engine-runworkflow-system-workflow-componentmodel-compiler-workflowvalidationfailedexception-the-workflow-failed-validation/</link>
		<comments>http://blogs.edwardwilde.com/2010/01/21/engine-runworkflow-system-workflow-componentmodel-compiler-workflowvalidationfailedexception-the-workflow-failed-validation/#comments</comments>
		<pubDate>Thu, 21 Jan 2010 14:42:22 +0000</pubDate>
		<dc:creator>Edward Wilde</dc:creator>
				<category><![CDATA[sharepoint]]></category>
		<category><![CDATA[rules]]></category>
		<category><![CDATA[workflow]]></category>

		<guid isPermaLink="false">http://edwardwilde.wordpress.com/2010/01/21/engine-runworkflow-system-workflow-componentmodel-compiler-workflowvalidationfailedexception-the-workflow-failed-validation/</guid>
		<description><![CDATA[Getting this error message today: Engine RunWorkflow: System.Workflow.ComponentModel.Compiler.WorkflowValidationFailedException: The workflow failed validation.&#160;&#160;&#160;&#160; at System.Workflow.Runtime.WorkflowDefinitionDispenser.ValidateDefinition(Activity root, Boolean isNewType, ITypeProvider typeProvider)&#160;&#160;&#160;&#160; at System.Workflow.Runtime.WorkflowDefinitionDispenser.LoadRootActivity(Type workflowType, Boolean createDefinition, Boolean initForRuntime)&#160;&#160;&#160;&#160; at System.Workflow.Runtime.WorkflowDefinitionDispenser.GetRootActivity(Type workflowType, Boolean createNew, Boolean initForRuntime)&#160;&#160;&#160;&#160; at System.Workflow.Runtime.WorkflowRuntime.InitializeExecutor(Guid instanceId, CreationContext context, WorkflowExecutor executor, WorkflowInstance workflowInstance)&#160;&#160;&#160;&#160; at System.Workflow.Runtime.WorkflowRuntime.Load(Guid key, CreationContext context, WorkflowInstance workflowInstance)&#160;&#160;&#160;&#160; at System.Workflow.Runtime.WorkflowRuntime.GetWorkflowExecutor(Guid instanceId, CreationContext context)&#160;&#160;&#160;&#160; at [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blogs.edwardwilde.com&amp;blog=9417511&amp;post=319&amp;subd=edwardwilde&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Getting this error message today:</p>
<p>Engine RunWorkflow: System.Workflow.ComponentModel.Compiler.WorkflowValidationFailedException: The workflow failed validation.&#160;&#160;&#160;&#160; at System.Workflow.Runtime.WorkflowDefinitionDispenser.ValidateDefinition(Activity root, Boolean isNewType, ITypeProvider typeProvider)&#160;&#160;&#160;&#160; at System.Workflow.Runtime.WorkflowDefinitionDispenser.LoadRootActivity(Type workflowType, Boolean createDefinition, Boolean initForRuntime)&#160;&#160;&#160;&#160; at System.Workflow.Runtime.WorkflowDefinitionDispenser.GetRootActivity(Type workflowType, Boolean createNew, Boolean initForRuntime)&#160;&#160;&#160;&#160; at System.Workflow.Runtime.WorkflowRuntime.InitializeExecutor(Guid instanceId, CreationContext context, WorkflowExecutor executor, WorkflowInstance workflowInstance)&#160;&#160;&#160;&#160; at System.Workflow.Runtime.WorkflowRuntime.Load(Guid key, CreationContext context, WorkflowInstance workflowInstance)&#160;&#160;&#160;&#160; at System.Workflow.Runtime.WorkflowRuntime.GetWorkflowExecutor(Guid instanceId, CreationContext context)&#160;&#160;&#160;&#160; at System.Workflow.Runtime.WorkflowRuntime.InternalCreateWorkflow(CreationContext context, Guid instanceId)&#160;&#160;&#160;&#160; at System.Workflow.Runtime.WorkflowRuntime.CreateWorkflow(Type workflowType, Dictionary`2 namedArgumentValues, Guid instanceId)&#160;&#160;&#160;&#160; at Microsoft.SharePoint.Workflow.SPWinOeHostServices.Send(SPWinOeWorkflow winoeworkflow, SPWorkflowEvent e)&#160;&#160;&#160;&#160; at Microsoft.SharePoint.Workflow.SPWinOeEngine.RunWorkflow(Guid trackingId, SPWorkflowHostService host, SPWorkflow workflow, Collection`1 events, TimeSpan timeOut)</p>
<p>&#160;</p>
<p>If your workflow uses validation rules it might be:</p>
<p>1) A problem with your validation rules, restart Visual Studio re-compile are any errors picked up?</p>
<p>&#160;</p>
<p>2) Missing the .net 3.5 workflow targets in your project file see: <a title="http://blog.hhebnes.no/post/WSPBuilder-Workflow-Failed-On-Start.aspx" href="http://blog.hhebnes.no/post/WSPBuilder-Workflow-Failed-On-Start.aspx">http://blog.hhebnes.no/post/WSPBuilder-Workflow-Failed-On-Start.aspx</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/edwardwilde.wordpress.com/319/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/edwardwilde.wordpress.com/319/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/edwardwilde.wordpress.com/319/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/edwardwilde.wordpress.com/319/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/edwardwilde.wordpress.com/319/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/edwardwilde.wordpress.com/319/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/edwardwilde.wordpress.com/319/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/edwardwilde.wordpress.com/319/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/edwardwilde.wordpress.com/319/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/edwardwilde.wordpress.com/319/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/edwardwilde.wordpress.com/319/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/edwardwilde.wordpress.com/319/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/edwardwilde.wordpress.com/319/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/edwardwilde.wordpress.com/319/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blogs.edwardwilde.com&amp;blog=9417511&amp;post=319&amp;subd=edwardwilde&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blogs.edwardwilde.com/2010/01/21/engine-runworkflow-system-workflow-componentmodel-compiler-workflowvalidationfailedexception-the-workflow-failed-validation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/196d33ea9cdaf7817b98b981afe62c16?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Edward Wilde</media:title>
		</media:content>
	</item>
	</channel>
</rss>
