<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/atom.xsl" media="screen"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-US"><title type="html">The Activity Designer</title><subtitle type="html">Not actually a WF 4.0 blog any more :)</subtitle><id>http://blogs.msdn.com/b/tilovell/atom.aspx</id><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/tilovell/" /><link rel="self" type="application/atom+xml" href="http://blogs.msdn.com/b/tilovell/atom.aspx" /><generator uri="http://telligent.com" version="5.6.50428.7875">Telligent Evolution Platform Developer Build (Build: 5.6.50428.7875)</generator><updated>2012-07-17T21:53:00Z</updated><entry><title>Note to self - how to stop VS 2012 menus being all caps</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/tilovell/archive/2013/05/21/note-to-self-how-to-stop-vs-2012-menus-being-all-caps.aspx" /><id>http://blogs.msdn.com/b/tilovell/archive/2013/05/21/note-to-self-how-to-stop-vs-2012-menus-being-all-caps.aspx</id><published>2013-05-21T20:49:14Z</published><updated>2013-05-21T20:49:14Z</updated><content type="html">&lt;p&gt;reg ADD "HKCU\Software\Microsoft\VisualStudio\11.0\General" /v "SuppressUpperCaseConversion" /t REG_DWORD /d 1&lt;/p&gt;
&lt;p&gt;I just thought I'd put this here in case I ever lose the info again. :)&lt;/p&gt;
&lt;p&gt;Isn't setting up a new machine fun.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10420411" width="1" height="1"&gt;</content><author><name>tilovell09</name><uri>http://blogs.msdn.com/tilovell/ProfileUrlRedirect.ashx</uri></author><category term="visualstudio" scheme="http://blogs.msdn.com/b/tilovell/archive/tags/visualstudio/" /><category term="CAPS" scheme="http://blogs.msdn.com/b/tilovell/archive/tags/CAPS/" /><category term="Menus" scheme="http://blogs.msdn.com/b/tilovell/archive/tags/Menus/" /></entry><entry><title>The mystery of the missing URL validation</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/tilovell/archive/2013/05/08/the-mystery-of-the-missing-url-validation.aspx" /><id>http://blogs.msdn.com/b/tilovell/archive/2013/05/08/the-mystery-of-the-missing-url-validation.aspx</id><published>2013-05-08T22:22:00Z</published><updated>2013-05-08T22:22:00Z</updated><content type="html">&lt;p&gt;Further to my adventures with unobtrusive validation of yesterday, I found myself very stuck while implementing&amp;nbsp;a new form for this new editable metadata feature for the NuGet Gallery. And Yet again the cause of all my pain appears to be this evil combination of UnobtrusiveValidation (2.0.30116.0) and JQuery.Validation (1.8.1). (I know it's not meant to be an evil combination, but believe me, it really starts to feel that way.))&lt;/p&gt;
&lt;p&gt;For the sake of discussion, a feature I'm trying to add is the ability to edit your package's project url, and logo icon url on nuget.org. Since I'm trying to follow the established patterns of the codebase, I decided to use a RequestModel object to represent the editing form. So naturally I do this inside my request model:&lt;/p&gt;
&lt;p&gt;[StringLength(256)]&lt;br /&gt;[Display(Name = "Icon URL")]&lt;br /&gt;[DataType(DataType.ImageUrl)]&lt;br /&gt;public string IconUrl { get; set; }&lt;/p&gt;
&lt;p&gt;[StringLength(256)]&lt;br /&gt;[Display(Name = "Project Homepage URL")]&lt;br /&gt;[DataType(DataType.Url)]&lt;br /&gt;public string ProjectUrl { get; set; }&lt;/p&gt;
&lt;p&gt;Unfortunately, when it comes to validation of this model, woe is me. If you enter a string which is not a valid URL and doesn't even start with https, you get no indication you've done something stupid.&lt;br /&gt;&lt;br /&gt;Perhaps naturally, perhaps not, I had assumed that adding these DataType attributes is going to do something good for me and do URL validation. Why would it be a natural assumption? Well, I say that because UnobtrusiveValidation appears to understand &lt;strong&gt;DataType&lt;/strong&gt;&lt;strong&gt;.Url&lt;/strong&gt; in the following ways:&lt;br /&gt;&lt;br /&gt;[Updated: Gee thanks a lot blogs.msdn.com for corrupting my post. Now don't do it again!]&lt;/p&gt;
&lt;p&gt;1) It adds a type="Url" attribute to your form INPUT element&lt;br /&gt;2) It has code inside that tries to add an &lt;em&gt;adapter&lt;/em&gt; which understands URL typed input elements and apply the jquery.validate URL validation to them. At least that's what I &lt;em&gt;think&lt;/em&gt; it's meant to do. Because it doesn't actually work in practice.&lt;/p&gt;
&lt;p&gt;I tried to work around this by adding regex validation to my model, thinking that could replace the non-functioning URL validation. Sadly that doesn't work either!&lt;/p&gt;
&lt;p&gt;[RegularExpression(Constants.UrlValidationRegEx, ErrorMessage = "This doesn't appear to be a valid URL")]&lt;/p&gt;
&lt;p&gt;Some hours of debugging eventually reveals that the reason neither regexes nor URLs are working is because I chose to do [DataType.Url] prevents the focusout delegate from being registered as a validation hook upon the input element&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;function delegate(event) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;var validator = $.data(this[0].form, "validator"),&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;eventType = "on" + event.type.replace(/^validate/, "");&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;validator.settings[eventType] &amp;amp;&amp;amp; validator.settings[eventType].call(validator, this[0] );&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;$(this.currentForm)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;.validateDelegate(":text, :password, :file, select, textarea", "focusin focusout keyup", delegate)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;.validateDelegate(":radio, :checkbox, select, option", "click", delegate);&lt;/p&gt;
&lt;p&gt;yes... jquery.validate will only add focusout handlers for stuff it knows about.&lt;br /&gt;And it gives you no way of customizing this. Grrr. Yuck.&lt;/p&gt;
&lt;p&gt;Best option for working around this seems to be &lt;strong&gt;don't use DataType.Url.&lt;/strong&gt; But [update #2] unfortunately that will require me to modify my css styling which was based on detecting the url datatype.&lt;br /&gt;So second good option is to write some (obtrusive!) script to add the missing focusout event handlers. This was yet another good 'learning exercise'.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $(function () {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var form = $('form[action="/packages/PoliteCaptcha/Edit/"]').toArray()[0];&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $("input[type=url]").bind("focusin focusout keyup", function (event) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var target = $(event.target);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var validator = $.data(form, "validator"),&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; eventType = "on" + event.type.replace(/^validate/, "");&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; validator.settings[eventType] &amp;amp;&amp;amp; validator.settings[eventType].call(validator, event.target);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; });&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; });&lt;/p&gt;
&lt;p&gt;Things that were annoying to get right here:&lt;br /&gt;-Figuring out that for whatever reason I can't just do $.bind() like jquery.validate does. I have to bind to a proper jquery element&amp;nbsp;(collection).&lt;br /&gt;-For the longest time $.data was returning me null and I couldn't figure out why until with the javascript debugger&amp;nbsp;I realized there were two different definitions of the function at the different points in time because I was including jquery.min.js after jquery.js and jquery.validate.js. Owch!&lt;br /&gt;-figuring out that the object to pass to the validator.settings[eventType] func was event.target also took me a while.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10417151" width="1" height="1"&gt;</content><author><name>tilovell09</name><uri>http://blogs.msdn.com/tilovell/ProfileUrlRedirect.ashx</uri></author><category term="javascript" scheme="http://blogs.msdn.com/b/tilovell/archive/tags/javascript/" /><category term="UnobtrusiveValidation" scheme="http://blogs.msdn.com/b/tilovell/archive/tags/UnobtrusiveValidation/" /><category term="validation" scheme="http://blogs.msdn.com/b/tilovell/archive/tags/validation/" /><category term="jquery.validation" scheme="http://blogs.msdn.com/b/tilovell/archive/tags/jquery-validation/" /><category term="url" scheme="http://blogs.msdn.com/b/tilovell/archive/tags/url/" /><category term="DataType" scheme="http://blogs.msdn.com/b/tilovell/archive/tags/DataType/" /></entry><entry><title>Regular expressions are different in javascript! And Unintrusive Validation.</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/tilovell/archive/2013/05/08/regular-expressions-are-different-in-javascript-and-unintrusive-validation.aspx" /><id>http://blogs.msdn.com/b/tilovell/archive/2013/05/08/regular-expressions-are-different-in-javascript-and-unintrusive-validation.aspx</id><published>2013-05-08T02:59:29Z</published><updated>2013-05-08T02:59:29Z</updated><content type="html">&lt;p&gt;Today while trying to implement some new code, and cutting my teeth on javascript validation, I disbelievingly realized that ALL of our client-side validation had stopped working. Like a month ago. And, nobody had noticed or complained!&amp;nbsp; (As a brief reminder I now work on the NuGet Gallery.)&lt;/p&gt;
&lt;p&gt;Perhaps that just goes to show how little real value client-side form validation is providing our nuget.org users, who are a smart bunch. Especially when Server side validation is there (it's always going to be there)&amp;nbsp;and it gets the job done. Anyway, regardless of the true value of client side validation, I'm fully mentally and emotionally committed to doing some client side validation for our new features. So let's move ahead!&lt;/p&gt;
&lt;p&gt;The original thing turned out to be a minor and easy thing to debug and fix, and didn't require me to understand the validation framework much at all. The script tag for&amp;nbsp;jquery.validate.unobtrusive had&amp;nbsp;accidentally gone missing when my compatriate made some innocent looking performance enhancements to the site. And without that script tag, you'll never see any validation. So problem solved. The way the tag went missing, honestly, was just one of those accidental things that you would think wouldn't be so easy to do. If you look at our code (yes, it's so frickin' cool that I can link to our code since it's open source)&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/NuGet/NuGetGallery/blob/master/Website/App_Start/AppActivator.cs"&gt;https://github.com/NuGet/NuGetGallery/blob/master/Website/App_Start/AppActivator.cs&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;you'll see that we're doing script bundling.&lt;/p&gt;
&lt;p&gt;&lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;scriptBundle&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="n"&gt;ScriptBundle&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"~/bundles/js"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;/p&gt;
&lt;div id="LC63" class="line"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Include&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"~/Scripts/jquery-{version}.js"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div id="LC64" class="line"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Include&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"~/Scripts/jquery.validate.js"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div id="LC65" class="line"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Include&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"~/Scripts/jquery.validate.unobtrusive.js"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&lt;/div&gt;
&lt;div id="LC66" class="line"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="n"&gt;BundleTable&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Bundles&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;scriptBundle&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&lt;/div&gt;
&lt;p&gt;And it turned out that we were bundling a script that didn't exist (we only had jquery.validate.unobtrusive.&lt;strong&gt;min.&lt;/strong&gt;js). Of course we never ever see an error even though we are bundling something that &lt;em&gt;doesn't exist..&lt;/em&gt;. Oh well. If you were thinking of playing with script bundling, you have &lt;em&gt;now been warned&lt;/em&gt;. :)&lt;/p&gt;
&lt;p&gt;But digressions, digressions. The real point of this post was that even after turning on unobtrusive validation, it became apparent that our email address and username validation on the user registration page were still not working. I could type in 'foo#blarg#blah' as an email address and all was well with the webby world. But why?&lt;/p&gt;
&lt;p&gt;Well, let's see. What's &lt;em&gt;supposed&lt;/em&gt; to happen is that we set a [RegularExpressionAttribute] on our property, like so:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Required]&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [StringLength(64)]&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [RegularExpression(@"(?i)[a-z0-9][a-z0-9_.-]+[a-z0-9]",&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ErrorMessage =&amp;nbsp;"User names must start and end with a letter or number, and may only contain letters, numbers, underscores, periods, and hyphens in between.")]&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Hint("Choose something unique so others will know which contributions are yours.")]&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public string Username { get; set; }&amp;nbsp;&lt;/p&gt;
&lt;p&gt;And this will cause some funky HTML to get generated, like so:&lt;/p&gt;
&lt;p&gt;&amp;lt;&lt;span style="color: #a31515; font-size: x-small;"&gt;&lt;span style="color: #a31515; font-size: x-small;"&gt;input&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #ff0000; font-size: x-small;"&gt;&lt;span style="color: #ff0000; font-size: x-small;"&gt;class&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #0000ff; font-size: x-small;"&gt;&lt;span style="color: #0000ff; font-size: x-small;"&gt;="text-box single-line"&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #ff0000; font-size: x-small;"&gt;&lt;span style="color: #ff0000; font-size: x-small;"&gt;data-val&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #0000ff; font-size: x-small;"&gt;&lt;span style="color: #0000ff; font-size: x-small;"&gt;="true"&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #ff0000; font-size: x-small;"&gt;&lt;span style="color: #ff0000; font-size: x-small;"&gt;data-val-length&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #0000ff; font-size: x-small;"&gt;&lt;span style="color: #0000ff; font-size: x-small;"&gt;="The field Username must be a string with a maximum length of 64."&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #ff0000; font-size: x-small;"&gt;&lt;span style="color: #ff0000; font-size: x-small;"&gt;data-val-length-max&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #0000ff; font-size: x-small;"&gt;&lt;span style="color: #0000ff; font-size: x-small;"&gt;="64"&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #ff0000; font-size: x-small;"&gt;&lt;span style="color: #ff0000; font-size: x-small;"&gt;data-val-regex&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #0000ff; font-size: x-small;"&gt;&lt;span style="color: #0000ff; font-size: x-small;"&gt;="User names must start and end with a letter or number, and may only contain letters, numbers, underscores, periods, and hyphens in between."&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #ff0000; font-size: x-small;"&gt;&lt;span style="color: #ff0000; font-size: x-small;"&gt;data-val-regex-insensitive&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #0000ff; font-size: x-small;"&gt;&lt;span style="color: #0000ff; font-size: x-small;"&gt;="True"&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #ff0000; font-size: x-small;"&gt;&lt;span style="color: #ff0000; font-size: x-small;"&gt;data-val-regex-pattern&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #0000ff; font-size: x-small;"&gt;&lt;span style="color: #0000ff; font-size: x-small;"&gt;="[a-z0-9][a-z0-9_.-]+[a-z0-9]"&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #ff0000; font-size: x-small;"&gt;&lt;span style="color: #ff0000; font-size: x-small;"&gt;data-val-required&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #0000ff; font-size: x-small;"&gt;&lt;span style="color: #0000ff; font-size: x-small;"&gt;="The Username field is required."&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #ff0000; font-size: x-small;"&gt;&lt;span style="color: #ff0000; font-size: x-small;"&gt;id&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #0000ff; font-size: x-small;"&gt;&lt;span style="color: #0000ff; font-size: x-small;"&gt;="Username"&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #ff0000; font-size: x-small;"&gt;&lt;span style="color: #ff0000; font-size: x-small;"&gt;name&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #0000ff; font-size: x-small;"&gt;&lt;span style="color: #0000ff; font-size: x-small;"&gt;="Username"&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #ff0000; font-size: x-small;"&gt;&lt;span style="color: #ff0000; font-size: x-small;"&gt;type&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #0000ff; font-size: x-small;"&gt;&lt;span style="color: #0000ff; font-size: x-small;"&gt;="text"&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #ff0000; font-size: x-small;"&gt;&lt;span style="color: #ff0000; font-size: x-small;"&gt;value&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #0000ff; font-size: x-small;"&gt;&lt;span style="color: #0000ff; font-size: x-small;"&gt;=""&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #0000ff; font-size: x-small;"&gt;&lt;span style="color: #0000ff; font-size: x-small;"&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Which works.&lt;br /&gt;And then there's a little adapter snippet in the unobtrusive validation script file which turns the data-val- attributes into a jquery.validation rule:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $jQval.addMethod("regex", function (value, element,&lt;br /&gt;params) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var match;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (this.optional(element)) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return true;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; match = new RegExp(params).exec(value);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return (match &amp;amp;&amp;amp; (match.index === 0) &amp;amp;&amp;amp;&lt;br /&gt;(match[0].length === value.length));&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; });&lt;/p&gt;
&lt;p&gt;Luckily, the first thing I tried is running this in the JS debugger, and it turns out that 'new RegExp(params)' is what fails. And it fails because (as promised in the title) regular expressions are different in javascript from .Net.&lt;/p&gt;
&lt;p&gt;In .Net, the (?i) syntax is legal as part of the regular expression and tells the regular expression parser that you want to build a case-insensitive regular expression.&lt;/p&gt;
&lt;p&gt;In Javascript, there are two ways of doing a case insensitive regular expression. One is to use a regular expression &lt;em&gt;literal&lt;/em&gt; and suffix it with 'i' like this: /[a-z0-9][a-z0-9_:-]+[a-z0-9]/i&lt;/p&gt;
&lt;p&gt;The other is to pass a second parameter "i" to the new RegExp constructor.&lt;/p&gt;
&lt;p&gt;This leads to a GRRRRRR moment, where I privately curse the creator of the unobtrusive validation library for failing to consider this issue. And also me spending about an hour trying to understand how to solve the problem myself.&lt;/p&gt;
&lt;p&gt;This turns out to be wasted effort, because as is often the case, some bright person has come up with a clever answer on stackoverflow.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://stackoverflow.com/questions/4218836/regularexpressionattribute-how-to-make-it-not-case-sensitive-for-client-side-v"&gt;http://stackoverflow.com/questions/4218836/regularexpressionattribute-how-to-make-it-not-case-sensitive-for-client-side-v&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;That said, I did spend this time coming up with another alternative approach, so might as well record it, and explain how it works. This one works not by introducing a new attribute or new annotation, but by overwriting the existing adapters in the unobtrusive validation pipeline.&lt;br /&gt;The logical pipeline is this:&lt;/p&gt;
&lt;p&gt;1. Data Model &amp;amp; Attributes (e.g. RegularExpressionAttribute) -&amp;gt; &lt;br /&gt;2. DataAnnotationsModelValidatorProvider &amp;amp; Attribute Adapters (e.g. RegularExpressionAttributeAdapter) -&amp;gt;&lt;br /&gt;3. HTML form + &amp;lt;script tags&amp;gt; (e.g. data-val-regex) -&amp;gt;&lt;br /&gt;4. UnobtrusiveValidation Adapters (e.g. "regex" adapter snippet posted above) -&amp;gt;&lt;br /&gt;5. jquery.validation rules - tada!&lt;/p&gt;
&lt;p&gt;We can insert a hacky fix at step 2. in the pipeline:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DataAnnotationsModelValidatorProvider.RegisterAdapter(&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; typeof(RegularExpressionAttribute),&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; typeof(FixedRegularExpressionAttributeAdapter));&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; class FixedRegularExpressionAttributeAdapter : RegularExpressionAttributeAdapter&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; private RegularExpressionAttribute _attribute;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public FixedRegularExpressionAttributeAdapter(&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ModelMetadata metadata, ControllerContext context, RegularExpressionAttribute attribute)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : base(metadata, context, attribute)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _attribute = attribute;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public override System.Collections.Generic.IEnumerable&amp;lt;ModelClientValidationRule&amp;gt; GetClientValidationRules()&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var rules = base.GetClientValidationRules();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var rule = rules.First();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var pattern = (string)rule.ValidationParameters["pattern"];&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (pattern.StartsWith("(?i)"))&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pattern = pattern.Substring(4);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rule.ValidationParameters["pattern"] = pattern;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rule.ValidationParameters["insensitive"] = true;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return rules;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;
&lt;p&gt;this will rewrite our HTML to remove the leading (?i) from the data-val-regex-pattern attribute, and create a new attribute data-val-regex-insensitive="True".&lt;br /&gt;And since it's a script file, we could then modify the code of the unobtrusive validation adapter.&lt;br /&gt;&lt;br /&gt;Well... it sort of gets the job done... but I don't actually feel like this is a very great solution to apply in practice. For one, pattern.StartsWith("(?i)") is hackiness. But for another, making changes to a script file like unobtrusive validation that we get as a nuget package is a headache because updating the nuget package in the future will lose the changes. Not to mention I'm unclear whether licensing permits editing the script files.&lt;/p&gt;
&lt;p&gt;The right thing to do instead seems to be to contribute back to unobtrusive validation, or at least file a bug there, and hope it gets fixed, assuming it's open source. &lt;br /&gt;&lt;br /&gt;It appears that it is open source, but it took me an awfully long time to confirm it is in the asp.net codeplex project&lt;/p&gt;
&lt;p&gt;&lt;a href="http://aspnetwebstack.codeplex.com/SourceControl/changeset/view/ea64fc86b54d#src/System.Web.Mvc/JavaScript/jquery.unobtrusive-ajax.js"&gt;http://aspnetwebstack.codeplex.com/SourceControl/changeset/view/ea64fc86b54d#src/System.Web.Mvc/JavaScript/jquery.unobtrusive-ajax.js&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;where, for now, I've just filed a bug on the issue. As for now it makes more sense to me to workaround it using 'A-Za-z' in the regex&amp;nbsp;than to incorporate a hacky non-future-proof fix, which was an interesting way to learn a bit more about these validation frameworks.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10416860" width="1" height="1"&gt;</content><author><name>tilovell09</name><uri>http://blogs.msdn.com/tilovell/ProfileUrlRedirect.ashx</uri></author><category term="javascript" scheme="http://blogs.msdn.com/b/tilovell/archive/tags/javascript/" /><category term="UnobtrusiveValidation" scheme="http://blogs.msdn.com/b/tilovell/archive/tags/UnobtrusiveValidation/" /><category term="NuGetGallery" scheme="http://blogs.msdn.com/b/tilovell/archive/tags/NuGetGallery/" /><category term="MVC" scheme="http://blogs.msdn.com/b/tilovell/archive/tags/MVC/" /><category term="regex" scheme="http://blogs.msdn.com/b/tilovell/archive/tags/regex/" /></entry><entry><title>The Entity Framework Leaking</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/tilovell/archive/2013/04/03/the-entity-framework-leaking.aspx" /><id>http://blogs.msdn.com/b/tilovell/archive/2013/04/03/the-entity-framework-leaking.aspx</id><published>2013-04-03T04:46:45Z</published><updated>2013-04-03T04:46:45Z</updated><content type="html">&lt;p&gt;'Fluent Interfaces' have been a bit of a buzz for probably long enough that I am not justified in buzzing about them. I was pretty excited when first seeing them applied to databases in form of NHibernate and also kind of excited to see all that code-first-ness come to Entity Framework, which had never really convinced me with the whole 'visual design experience' thing it had when I first looked at it way back in EF 2 or whatever. Those were the days.&lt;/p&gt;
&lt;p&gt;Annnnyway...&lt;/p&gt;
&lt;p&gt;It went a long time between me learning about EF, and actually getting to use it. Now I'm using it day to day. I did initially feel very excited about EF. The promise EF seems to hold me, is that it will simplify my life in pleasant ways:&lt;/p&gt;
&lt;p&gt;1) I won't need to learn SQL syntax. I can just use code style &lt;strong&gt;.Where()&lt;/strong&gt; and &lt;strong&gt;.Select()&lt;/strong&gt; - all that LINQ stuff without the language integratedness which always seemed like a demoware feature to me anyway.&lt;br /&gt;2) I won't have to manage database creation SQL scripts. I can use migrations to manage database creation and updating. The updating can even happen at app startup without me even thinking about it&lt;br /&gt;3) Not only do I not have to learn SQL, I don't even have to know much how SQL works.&lt;/p&gt;
&lt;p&gt;Now I've actually been using EF for 6 months, I find myself beginning to wonder if something is wrong.&lt;/p&gt;
&lt;p&gt;See, I'm gradually learning SQL syntax. Why? Well, sometimes I might do ad-hoc queries on data. But mostly because I want to debug and optimize my EF queries, and the only way of doing that is to see the SQL queries that these EF queries get translated into, and to run them through the SQL execution plan analyzer.&lt;/p&gt;
&lt;p&gt;Which brings me to point number two. I'm gradually learning stuff about how SQL works. Because it turns out that SQL is really good for certain things, and not so good (fast) at others. In fact, it depends a lot on your schema, how you normalize or denormalize, and what indexes you have how fast your queries are going to be. And oh yeah - as well as indexes SQL has these notions of non-nullability and uniqueness which are kind of important. And even string length is important, because it affects what you can put in indexes.&lt;/p&gt;
&lt;p&gt;So there we are. I've realized that Entity Framework is yet another leaky abstraction.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10407131" width="1" height="1"&gt;</content><author><name>tilovell09</name><uri>http://blogs.msdn.com/tilovell/ProfileUrlRedirect.ashx</uri></author><category term="SQL" scheme="http://blogs.msdn.com/b/tilovell/archive/tags/SQL/" /><category term="EntityFramework" scheme="http://blogs.msdn.com/b/tilovell/archive/tags/EntityFramework/" /></entry><entry><title>The joy of Change</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/tilovell/archive/2013/02/05/the-joy-of-change.aspx" /><id>http://blogs.msdn.com/b/tilovell/archive/2013/02/05/the-joy-of-change.aspx</id><published>2013-02-05T23:57:33Z</published><updated>2013-02-05T23:57:33Z</updated><content type="html">&lt;p&gt;Hey, it's been a long time since I updated this blog. Did anybody miss me? Didn't think so. Since the intertubes never stop piping out noise, obviously nobody will have noticed a little silence. In any case it feels nice to give everybody a warm fuzzy 'hello long time no see' post. No wait, don't yet ! There's actually news here, sort of. Well no, not the workflow news you were probably coming here to see. Because, as it turns out, I personally don't work on workflow any more. After years of trying to care deeply and hard about workflow and whether it is good or not, I've realized I&amp;nbsp;needed to stop.&lt;br /&gt;&lt;br /&gt;So what am I doing now? Well, same company, same software development game. But not much else is the same! I've switched from testing code to developing it. And I've switched from trying to care about workflows to trying to care about a completely different beast, i.e.&amp;nbsp;NuGet packages! And remember, it's all open source, so you can join in the fun too!&lt;br /&gt;&lt;br /&gt;If you've not heard of NuGet before don't worry it's not too late! Fire up Visual Studio (I suspect I'm going to be correct in assuming everyone who reads my blog has Visual Studio? :p) and go to the Extension Manager. Search online for an extension called NuGet package manager. But what am I saying, of course you've heard of NuGet package manager! But maybe you, like me,&amp;nbsp;just didn't realize that it's going to be deeply relevent to your life as a developer? Still not convinced? Sigh, OK. I know I will convince you eventually!&lt;/p&gt;
&lt;p&gt;Because, in fact, dear dot net developers - we are the last ones to catch on to this - but packages are pretty much the best way to manage your dependencies. Better than add reference, better than checking dlls into source control,&amp;nbsp;better than install Foo SDK install.exes and&amp;nbsp;maybe even better than shipping great big chunky .net frameworks?&amp;nbsp;Yes there's a couple rough edges, but we're working on that!&lt;/p&gt;
&lt;p&gt;Still not convinced? Until next time then.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10391380" width="1" height="1"&gt;</content><author><name>tilovell09</name><uri>http://blogs.msdn.com/tilovell/ProfileUrlRedirect.ashx</uri></author><category term="News" scheme="http://blogs.msdn.com/b/tilovell/archive/tags/News/" /><category term="NuGet" scheme="http://blogs.msdn.com/b/tilovell/archive/tags/NuGet/" /><category term="About" scheme="http://blogs.msdn.com/b/tilovell/archive/tags/About/" /><category term="Change" scheme="http://blogs.msdn.com/b/tilovell/archive/tags/Change/" /></entry><entry><title>(WF4,VS) WorkflowDesigner Extensions in Visual Studio 2012</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/tilovell/archive/2012/10/04/wf4-vs-workflowdesigner-extensions-in-visual-studio-2012.aspx" /><id>http://blogs.msdn.com/b/tilovell/archive/2012/10/04/wf4-vs-workflowdesigner-extensions-in-visual-studio-2012.aspx</id><published>2012-10-04T21:16:38Z</published><updated>2012-10-04T21:16:38Z</updated><content type="html">&lt;p&gt;&lt;em&gt;(Intro: Sometimes as part of testing I go to silly lengths to try to point out what I think is going to be a bug in a piece of code I have seen. And frequently when I do this, I am basically wrong, for any of various reasons – it’s a bug according to some world view which is not quite aligned with reality, or whatever. Overall I think I tend to frustrate some people when I go through this exercise, but an end result is often that I learn something...)&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;I just emerged from the testing vaults with a lost feature to share. &lt;img style="border-bottom-style: none; border-left-style: none; border-top-style: none; border-right-style: none" class="wlEmoticon wlEmoticon-smile" alt="Smile" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-32-00-metablogapi/0143.wlEmoticon_2D00_smile_5F00_23840D06.png" /&gt;&lt;/p&gt;  &lt;p&gt;In VS 2010 there wasn’t a good customization story for the workflow designer in Visual Studio. What do I mean customization story? Let me try to think of some motivating examples.    &lt;br /&gt;    &lt;br /&gt;Example #1: You want to customize Workflow Designer inside VS, by registering a new custom property editor for a system or custom Type. For sake of example e.g. Nullable&amp;lt;T&amp;gt;.&lt;/p&gt;  &lt;p&gt;Example #2 You want VS to provide a new Service to your custom designers via EditingContext.Services – but the service will actually be hosted in Visual Studio’s main appdomain, and its data will persist throughout a VS session, and be shared with all WorkflowDesigner instances.&lt;/p&gt;  &lt;p&gt;   &lt;br /&gt;These scenarios are not supported in VS &lt;strong&gt;2010&lt;/strong&gt;. However, what I found out so far is that Example #1 and Example #2 appear to be supported in VS 2012. Now I’m calling this a lost feature because I couldn’t find any official docs for this, so these are what I picked up from talking to developer Tony, and disassembling certain assemblies.&lt;/p&gt;  &lt;h3&gt;&lt;font style="font-weight: bold"&gt;The Tip&lt;/font&gt;&lt;/h3&gt;  &lt;h3&gt;Here’s the basic hot tip that set me off on this hunt and summarizes the feature. Apparently there’s a directory you can place workflow designer extension DLLs in, that Visual Studio 2012 will find them somehow. On 64-bit windows OS, you’ll see it’s typically here:&lt;/h3&gt;  &lt;p&gt;C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\Extensions\WorkflowDesigner&lt;/p&gt;  &lt;p&gt;   &lt;br /&gt;Tony also sent me an example code which is just an ordinary C# class with a MEF exported interface:&lt;/p&gt;  &lt;p&gt;[Export(typeof(IEntityInfoService))] // note: IEntityInfoService - this is just some custom type for example, what type really doesn’t matter&lt;/p&gt;  &lt;p&gt;Aside from this, his sample had two features which let me know the class might be hosted in the main VS app domain:&lt;/p&gt;  &lt;p&gt;1) it imports &lt;a href="http://msdn.microsoft.com/en-us/library/envdte.dte.aspx"&gt;DTE&lt;/a&gt;, which is the core Visual Studio programming interface. A DTE object gives you access to many things in VS such as the VS solution tree    &lt;br /&gt;    &lt;br /&gt;[Import]    &lt;br /&gt;public &lt;a href="http://msdn.microsoft.com/en-us/library/envdte.dte.aspx"&gt;DTE&lt;/a&gt; Dte { get; set; }    &lt;br /&gt;&lt;/p&gt;  &lt;p&gt;2) it inherits &lt;a href="http://msdn.microsoft.com/en-us/library/system.marshalbyrefobject.aspx"&gt;MarshalByRefObject&lt;/a&gt; – this means we can hold object references to the object from another domain, and that it will inherit stuff you need for .Net remoting lifetime management: GetLifetimeService, etc.    &lt;br /&gt;    &lt;br /&gt;&lt;strong&gt;Another interesting find, while trying to understand the tip&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;In Microsoft.VisualStudio.Activities.AddIn.WorkflowDesignerAddIn, there is code which uses an internal class (AddInWorkflowDesignerExtensionManager) to discover extensions which implement &lt;strong&gt;IRegisterMetadata&lt;/strong&gt;. You know, &lt;a href="http://blogs.msdn.com/b/tilovell/archive/2011/05/08/iregistermetadata-and-best-practice-associating-workflow-activity-designers.aspx"&gt;that interface for registering custom designer stuff&lt;/a&gt;. For each such extension found, the designer add-in calls Register() straight away.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;     &lt;br /&gt;Last find      &lt;br /&gt;      &lt;br /&gt;&lt;/strong&gt;Further in the ‘how it might work’ category – there’s another internal class that VS uses called WorkflowDesignerExtensionManager, which appears to be there for allowing &lt;a href="http://blogs.msdn.com/b/mwinkle/archive/2009/12/23/inspection-default-services-and-items-wf4-editingcontext-intro-part-6.aspx"&gt;Services (as in EditingContext.Services)&lt;/a&gt; to be discovered by the WorkflowDesigner or custom activity designers. It leverages the MEF API (and DirectoryCatalog in particular) to discover extensions from the directory Tony mentioned! Note, I heard a long time back that MEF was also planned to be key part of the extensibility story for Visual Studio 2012… looks like this sort of fits into that strategy.&lt;/p&gt;  &lt;p&gt;   &lt;br /&gt;&lt;strong&gt;Trying stuff…&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Pieces of the puzzle are falling into place nicely. So it’s time to try some stuff out!   &lt;br /&gt;    &lt;br /&gt;1) Create a custom dll, implement and Export (MEF) the &lt;strong&gt;IRegisterMetadata&lt;/strong&gt; interface, and see if I can get called by Visual Studio. I’m guessing I don’t need MarshalByRefObject in this scenario, since the &lt;a href="http://msdn.microsoft.com/en-us/library/system.activities.presentation.metadata.metadatastore.aspx"&gt;MetadataStore&lt;/a&gt; is generally in &lt;em&gt;the WorkflowDesigner’s &lt;/em&gt;AppDomain.&lt;/p&gt;  &lt;p&gt;2) Create&amp;#160; a custom dll, implement and Export a custom interface, IFooService to a MarshalByRef object. Get and call the service from a custom activity designer, which will be loaded in one of the &lt;a href="http://blogs.msdn.com/b/appfabric/archive/2011/08/14/how-to-create-a-custom-activity-designer-with-windows-workflow-foundation-wf4.aspx"&gt;usual ways&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Since Visual Studio 2010 doesn’t (in my experience) do a very good job of debugging Visual Studio 2012, I’ll be creating my test projects in Visual Studio 2012.&lt;/p&gt;  &lt;table style="border-bottom: medium none; border-left: medium none; border-collapse: collapse; background: #ffff99; border-top: medium none; border-right: medium none; mso-border-alt: solid windowtext .5pt; mso-yfti-tbllook: 1184; mso-padding-alt: 0in 5.4pt 0in 5.4pt" class="MsoTableGrid" border="1" cellspacing="0" cellpadding="0"&gt;&lt;tbody&gt;     &lt;tr style="mso-yfti-irow: 0; mso-yfti-firstrow: yes; mso-yfti-lastrow: yes"&gt;       &lt;td style="border-bottom: windowtext 1pt solid; border-left: windowtext 1pt solid; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; border-top: windowtext 1pt solid; border-right: windowtext 1pt solid; padding-top: 0in; mso-border-alt: solid windowtext .5pt" valign="top" width="638"&gt;         &lt;p style="line-height: normal; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; color: "&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size: 9.5pt"&gt;namespace&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; color: "&gt;&lt;font style="font-size: 9.5pt"&gt; MetadataExtension&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;          &lt;p style="line-height: normal; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span style="font-family: ; color: "&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: 9.5pt"&gt;{&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;          &lt;p style="line-height: normal; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; color: "&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;[&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; color: "&gt;&lt;font color="#2b91af"&gt;Export&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; color: "&gt;(&lt;/span&gt;&lt;span style="font-family: ; color: "&gt;&lt;font color="#0000ff"&gt;typeof&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; color: "&gt;(&lt;/span&gt;&lt;span style="font-family: ; color: "&gt;&lt;font color="#2b91af"&gt;IRegisterMetadata&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; color: "&gt;&lt;font style="font-size: 9.5pt"&gt;))]&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;          &lt;p style="line-height: normal; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; color: "&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; color: "&gt;&lt;font color="#0000ff"&gt;internal&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; color: "&gt; &lt;/span&gt;&lt;span style="font-family: ; color: "&gt;&lt;font color="#0000ff"&gt;class&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; color: "&gt; &lt;/span&gt;&lt;span style="font-family: ; color: "&gt;&lt;font color="#2b91af"&gt;RegisterMetadata&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; color: "&gt; : &lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; color: "&gt;&lt;font style="font-size: 9.5pt" color="#2b91af"&gt;IRegisterMetadata&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; color: "&gt;&lt;/span&gt;&lt;/p&gt;          &lt;p style="line-height: normal; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span style="font-family: ; color: "&gt;&lt;font face="Consolas"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;{&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;          &lt;p style="line-height: normal; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; color: "&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; color: "&gt;&lt;font color="#0000ff"&gt;public&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; color: "&gt;&lt;font style="font-size: 9.5pt"&gt; RegisterMetadata()&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;          &lt;p style="line-height: normal; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span style="font-family: ; color: "&gt;&lt;font face="Consolas"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;{&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;          &lt;p style="line-height: normal; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span style="font-family: ; color: "&gt;&lt;font face="Consolas"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;          &lt;p style="line-height: normal; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span style="font-family: ; color: "&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;          &lt;p style="line-height: normal; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; color: "&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; color: "&gt;&lt;font color="#0000ff"&gt;public&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; color: "&gt; &lt;/span&gt;&lt;span style="font-family: ; color: "&gt;&lt;font color="#0000ff"&gt;void&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; color: "&gt;&lt;font style="font-size: 9.5pt"&gt; Register()&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;          &lt;p style="line-height: normal; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span style="font-family: ; color: "&gt;&lt;font face="Consolas"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;{&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;          &lt;p style="line-height: normal; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; color: "&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; color: "&gt;&lt;font color="#2b91af"&gt;MessageBox&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; color: "&gt;.Show(&lt;/span&gt;&lt;span style="font-family: ; color: "&gt;&lt;font color="#a31515"&gt;&amp;quot;Hello... and goodbye sequence designer&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; color: "&gt;&lt;font style="font-size: 9.5pt"&gt;);&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;          &lt;p style="line-height: normal; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; color: "&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; color: "&gt;&lt;font color="#0000ff"&gt;var&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; color: "&gt; builder = &lt;/span&gt;&lt;span style="font-family: ; color: "&gt;&lt;font color="#0000ff"&gt;new&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; color: "&gt; &lt;/span&gt;&lt;span style="font-family: ; color: "&gt;&lt;font color="#2b91af"&gt;AttributeTableBuilder&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; color: "&gt;&lt;font style="font-size: 9.5pt"&gt;();&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;          &lt;p style="line-height: normal; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; color: "&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;builder.AddCustomAttributes(&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; color: "&gt;&lt;font color="#0000ff"&gt;typeof&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; color: "&gt;(&lt;/span&gt;&lt;span style="font-family: ; color: "&gt;&lt;font color="#2b91af"&gt;Sequence&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; color: "&gt;&lt;font style="font-size: 9.5pt"&gt;), &lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;          &lt;p style="line-height: normal; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; color: "&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&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;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; color: "&gt;&lt;font color="#0000ff"&gt;new&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; color: "&gt; &lt;/span&gt;&lt;span style="font-family: ; color: "&gt;&lt;font color="#2b91af"&gt;DesignerAttribute&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; color: "&gt;(&lt;/span&gt;&lt;span style="font-family: ; color: "&gt;&lt;font color="#0000ff"&gt;typeof&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; color: "&gt;(&lt;/span&gt;&lt;span style="font-family: ; color: "&gt;&lt;font color="#2b91af"&gt;ActivityDesigner&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; color: "&gt;&lt;font style="font-size: 9.5pt"&gt;)));&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;          &lt;p style="line-height: normal; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; color: "&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; color: "&gt;&lt;font color="#2b91af"&gt;MetadataStore&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; color: "&gt;&lt;font style="font-size: 9.5pt"&gt;.AddAttributeTable(builder.CreateTable());&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;          &lt;p style="line-height: normal; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span style="font-family: ; color: "&gt;&lt;font face="Consolas"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;          &lt;p style="line-height: normal; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span style="font-family: ; color: "&gt;&lt;font face="Consolas"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;          &lt;p style="line-height: normal; margin: 0in 0in 0pt" class="MsoNormal"&gt;&lt;span style="font-family: ; color: "&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: 9.5pt"&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;I copy the debug output dll to C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\Extensions\WorkflowDesigner, and launch a new instance of Visual Studio 2012. I create a new workflow activity library project, and … success!&lt;/p&gt;  &lt;p&gt;I have just succeeded in pranking myself – the Sequence activity is now totally unusable:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-32-00-metablogapi/1614.image_5F00_07734E1B.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-32-00-metablogapi/0118.image_5F00_thumb_5F00_7C49C3D0.png" width="410" height="424" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Of course while you could use this trick to prank your WF-using office mates, I don’t recommend it. We’d better think of some more constructive use for that feature. &lt;img style="border-bottom-style: none; border-left-style: none; border-top-style: none; border-right-style: none" class="wlEmoticon wlEmoticon-smile" alt="Smile" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-32-00-metablogapi/0143.wlEmoticon_2D00_smile_5F00_23840D06.png" /&gt;    &lt;br /&gt;Here’s the call stack when the metadata extension gets called. &lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160; METADATAEXTENSION.dll!MetadataExtension.RegisterMetadata.Register() Line 24&amp;#160;&amp;#160;&amp;#160; C#   &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Microsoft.VisualStudio.Activities.Addin.dll!Microsoft.VisualStudio.Activities.AddIn.WorkflowDesignerAddIn.ExecuteRegisterMetadataExtensions() + 0x82 bytes&amp;#160;&amp;#160;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Microsoft.VisualStudio.Activities.AddinAdapter.dll!Microsoft.VisualStudio.Activities.AddInAdapter.IDesignerContractToViewAddInAdapter.ExecuteRegisterMetadataExtensions() + 0xc bytes&amp;#160;&amp;#160;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; mscorlib.dll!System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(System.Runtime.Remoting.Messaging.IMessage msg) + 0x1e7 bytes&amp;#160;&amp;#160;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; […more remoting stuff…]    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; mscorlib.dll!System.Runtime.Remoting.Proxies.RemotingProxy.InternalInvoke(System.Runtime.Remoting.Messaging.IMethodCallMessage reqMcmMsg, bool useDispatchMessage, int callType) + 0x1cc bytes&amp;#160;&amp;#160;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; mscorlib.dll!System.Runtime.Remoting.Proxies.RemotingProxy.Invoke(System.Runtime.Remoting.Messaging.IMessage reqMsg) + 0x66 bytes&amp;#160;&amp;#160;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; mscorlib.dll!System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(ref System.Runtime.Remoting.Proxies.MessageData msgData, int type) + 0xea bytes&amp;#160;&amp;#160;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Microsoft.VisualStudio.Activities.HostAdapter.dll!Microsoft.VisualStudio.Activities.HostAdapter.IDesignerViewToContractHostAdapter.ExecuteRegisterMetadataExtensions() + 0xc bytes&amp;#160;&amp;#160;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Microsoft.VisualStudio.Activities.dll!Microsoft.VisualStudio.Activities.EditorPane.CreateWorkflowDesignerInIsolatedMode() + 0x2cb bytes&amp;#160;&amp;#160;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Microsoft.VisualStudio.Activities.dll!Microsoft.VisualStudio.Activities.EditorPane.Microsoft.VisualStudio.Shell.Interop.IPersistFileFormat.Load(string fileName, uint formatMode, int readOnly) + 0xda bytes&amp;#160;&amp;#160;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Microsoft.VisualStudio.Activities.dll!Microsoft.VisualStudio.Activities.EditorPane.Microsoft.VisualStudio.Shell.Interop.IVsPersistDocData.LoadDocData(string documentName) + 0xd bytes&amp;#160;&amp;#160;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;br /&gt;From this stack we can notice that    &lt;br /&gt;1) our RegisterMetadata extension being called is very early indeed in the process of creating and setting up the Workflow Designer    &lt;br /&gt;2) it’s triggered by Visual Studio which is specifically calling for such extensions to be loaded, so it doesn’t apply for rehosted apps. Which is fine. In a rehosted app we already are able to control and hook into the workflow designer creation process.&lt;/p&gt;  &lt;p&gt;   &lt;br /&gt;The second example is just slightly more work.    &lt;br /&gt;    &lt;br /&gt;Part #1: Define a contract&lt;/p&gt;  &lt;table style="border-bottom: medium none; border-left: medium none; border-collapse: collapse; background: #ffff99; border-top: medium none; border-right: medium none; mso-border-alt: solid windowtext .5pt; mso-yfti-tbllook: 1184; mso-padding-alt: 0in 5.4pt 0in 5.4pt" class="MsoTableGrid" border="1" cellspacing="0" cellpadding="0"&gt;&lt;tbody&gt;     &lt;tr style="mso-yfti-irow: 0; mso-yfti-firstrow: yes; mso-yfti-lastrow: yes"&gt;       &lt;td style="border-bottom: windowtext 1pt solid; border-left: windowtext 1pt solid; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; border-top: windowtext 1pt solid; border-right: windowtext 1pt solid; padding-top: 0in; mso-border-alt: solid windowtext .5pt" valign="top" width="638"&gt;         &lt;p style="line-height: normal; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; color: "&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; color: "&gt;&lt;font color="#0000ff"&gt;public interface&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; color: "&gt; &lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; color: "&gt;&lt;font style="font-size: 9.5pt" color="#2b91af"&gt;ICustomContract&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; color: "&gt;&lt;/span&gt;&lt;/p&gt;          &lt;p style="line-height: normal; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span style="font-family: ; color: "&gt;&lt;font face="Consolas"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;{&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;          &lt;p style="line-height: normal; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; color: "&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; color: "&gt;&lt;font color="#0000ff"&gt;void&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; color: "&gt;&lt;font style="font-size: 9.5pt"&gt; Hello();&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;          &lt;p style="line-height: normal; margin: 0in 0in 0pt" class="MsoNormal"&gt;&lt;span style="font-family: ; color: "&gt;&lt;font face="Consolas"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;Part #2: Define an extension&lt;/p&gt;  &lt;table style="border-bottom: medium none; border-left: medium none; border-collapse: collapse; background: #ffff99; border-top: medium none; border-right: medium none; mso-border-alt: solid windowtext .5pt; mso-yfti-tbllook: 1184; mso-padding-alt: 0in 5.4pt 0in 5.4pt" class="MsoTableGrid" border="1" cellspacing="0" cellpadding="0"&gt;&lt;tbody&gt;     &lt;tr style="mso-yfti-irow: 0; mso-yfti-firstrow: yes; mso-yfti-lastrow: yes"&gt;       &lt;td style="border-bottom: windowtext 1pt solid; border-left: windowtext 1pt solid; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; border-top: windowtext 1pt solid; border-right: windowtext 1pt solid; padding-top: 0in; mso-border-alt: solid windowtext .5pt" valign="top" width="638"&gt;         &lt;p style="line-height: normal; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; color: "&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160; [&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; color: "&gt;&lt;font color="#2b91af"&gt;Export&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; color: "&gt;(&lt;/span&gt;&lt;span style="font-family: ; color: "&gt;&lt;font color="#0000ff"&gt;typeof&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; color: "&gt;(&lt;/span&gt;&lt;span style="font-family: ; color: "&gt;&lt;font color="#2b91af"&gt;ICustomContract&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; color: "&gt;&lt;font style="font-size: 9.5pt"&gt;))]&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;          &lt;p style="line-height: normal; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; color: "&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; color: "&gt;&lt;font color="#0000ff"&gt;public&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; color: "&gt; &lt;/span&gt;&lt;span style="font-family: ; color: "&gt;&lt;font color="#0000ff"&gt;class&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; color: "&gt; &lt;/span&gt;&lt;span style="font-family: ; color: "&gt;&lt;font color="#2b91af"&gt;CustomContractExtension&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; color: "&gt; : &lt;/span&gt;&lt;span style="font-family: ; color: "&gt;&lt;font color="#2b91af"&gt;MarshalByRefObject&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; color: "&gt;, &lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; color: "&gt;&lt;font style="font-size: 9.5pt" color="#2b91af"&gt;ICustomContract&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; color: "&gt;&lt;/span&gt;&lt;/p&gt;          &lt;p style="line-height: normal; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span style="font-family: ; color: "&gt;&lt;font face="Consolas"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;{&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;          &lt;p style="line-height: normal; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; color: "&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; color: "&gt;&lt;font color="#0000ff"&gt;public&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; color: "&gt;&lt;font style="font-size: 9.5pt"&gt; CustomContractExtension()&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;          &lt;p style="line-height: normal; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span style="font-family: ; color: "&gt;&lt;font face="Consolas"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;{&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;          &lt;p style="line-height: normal; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span style="font-family: ; color: "&gt;&lt;font face="Consolas"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;          &lt;p style="line-height: normal; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span style="font-family: ; color: "&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;          &lt;p style="line-height: normal; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; color: "&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; color: "&gt;&lt;font color="#0000ff"&gt;public&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; color: "&gt; &lt;/span&gt;&lt;span style="font-family: ; color: "&gt;&lt;font color="#0000ff"&gt;void&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; color: "&gt;&lt;font style="font-size: 9.5pt"&gt; Hello()&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;          &lt;p style="line-height: normal; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span style="font-family: ; color: "&gt;&lt;font face="Consolas"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;{&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;          &lt;p style="line-height: normal; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; color: "&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; color: "&gt;&lt;font color="#2b91af"&gt;MessageBox&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; color: "&gt;.Show(&lt;/span&gt;&lt;span style="font-family: ; color: "&gt;&lt;font color="#a31515"&gt;&amp;quot;Hello&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; color: "&gt;&lt;font style="font-size: 9.5pt"&gt;);&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;          &lt;p style="line-height: normal; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; color: "&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; color: "&gt;&lt;font color="#2b91af"&gt;MessageBox&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; color: "&gt;.Show(&lt;/span&gt;&lt;span style="font-family: ; color: "&gt;&lt;font color="#a31515"&gt;&amp;quot;Got DTE? &amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; color: "&gt; + (&lt;/span&gt;&lt;span style="font-family: ; color: "&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; color: "&gt;.Dte != &lt;/span&gt;&lt;span style="font-family: ; color: "&gt;&lt;font color="#0000ff"&gt;null&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; color: "&gt;&lt;font style="font-size: 9.5pt"&gt;));&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;          &lt;p style="line-height: normal; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span style="font-family: ; color: "&gt;&lt;font face="Consolas"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;          &lt;p style="line-height: normal; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span style="font-family: ; color: "&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;          &lt;p style="line-height: normal; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; color: "&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;[&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; color: "&gt;&lt;font color="#2b91af"&gt;Import&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; color: "&gt;&lt;font style="font-size: 9.5pt"&gt;]&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;          &lt;p style="line-height: normal; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; color: "&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; color: "&gt;&lt;font color="#0000ff"&gt;public&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; color: "&gt; &lt;/span&gt;&lt;span style="font-family: ; color: "&gt;&lt;font color="#2b91af"&gt;DTE&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; color: "&gt; Dte { &lt;/span&gt;&lt;span style="font-family: ; color: "&gt;&lt;font color="#0000ff"&gt;get&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; color: "&gt;; &lt;/span&gt;&lt;span style="font-family: ; color: "&gt;&lt;font color="#0000ff"&gt;set&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; color: "&gt;&lt;font style="font-size: 9.5pt"&gt;; }&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;         &lt;span style="line-height: 11pt; font-family: ; color: ; mso-fareast-font-family: &amp;#39;MS Mincho&amp;#39;; mso-fareast-theme-font: minor-fareast; mso-ansi-language: en-us; mso-fareast-language: ja; mso-bidi-language: ar-sa"&gt;&lt;font face="Consolas"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;Now we can place our extension dll in the Extensions\WorkflowDesigner directory, fire up a new instance of VS 2012, and see if anything happens.&lt;/p&gt;  &lt;p&gt;This time, nothing happens when we create a new class library. We need a couple more steps.&lt;/p&gt;  &lt;p&gt;1) Add a new code activity&lt;/p&gt;  &lt;p&gt;2) Add a new activity designer&lt;/p&gt;  &lt;p&gt;3) Associate them (today I’ll do it the quickest way, using DesignerAttribute)&lt;/p&gt;  &lt;table style="border-bottom: medium none; border-left: medium none; border-collapse: collapse; background: #ffff99; border-top: medium none; border-right: medium none; mso-border-alt: solid windowtext .5pt; mso-yfti-tbllook: 1184; mso-padding-alt: 0in 5.4pt 0in 5.4pt" class="MsoTableGrid" border="1" cellspacing="0" cellpadding="0"&gt;&lt;tbody&gt;     &lt;tr style="mso-yfti-irow: 0; mso-yfti-firstrow: yes; mso-yfti-lastrow: yes"&gt;       &lt;td style="border-bottom: windowtext 1pt solid; border-left: windowtext 1pt solid; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; border-top: windowtext 1pt solid; border-right: windowtext 1pt solid; padding-top: 0in; mso-border-alt: solid windowtext .5pt" valign="top" width="638"&gt;         &lt;p style="line-height: normal; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; color: "&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;[&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; color: "&gt;&lt;font color="#2b91af"&gt;Designer&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; color: "&gt;(&lt;/span&gt;&lt;span style="font-family: ; color: "&gt;&lt;font color="#0000ff"&gt;typeof&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; color: "&gt;(&lt;/span&gt;&lt;span style="font-family: ; color: "&gt;&lt;font color="#2b91af"&gt;ActivityDesigner1&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; color: "&gt;&lt;font style="font-size: 9.5pt"&gt;))]&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;          &lt;p style="line-height: normal; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; color: "&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; color: "&gt;&lt;font color="#0000ff"&gt;public&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; color: "&gt; &lt;/span&gt;&lt;span style="font-family: ; color: "&gt;&lt;font color="#0000ff"&gt;sealed&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; color: "&gt; &lt;/span&gt;&lt;span style="font-family: ; color: "&gt;&lt;font color="#0000ff"&gt;class&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; color: "&gt; &lt;/span&gt;&lt;span style="font-family: ; color: "&gt;&lt;font color="#2b91af"&gt;CodeActivity1&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; color: "&gt; : &lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; color: "&gt;&lt;font style="font-size: 9.5pt" color="#2b91af"&gt;CodeActivity&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; color: "&gt;&lt;/span&gt;&lt;/p&gt;          &lt;p style="line-height: normal; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span style="font-family: ; color: "&gt;&lt;font face="Consolas"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;{&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;          &lt;p style="line-height: normal; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; color: "&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; color: "&gt;&lt;font color="#0000ff"&gt;protected&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; color: "&gt; &lt;/span&gt;&lt;span style="font-family: ; color: "&gt;&lt;font color="#0000ff"&gt;override&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; color: "&gt; &lt;/span&gt;&lt;span style="font-family: ; color: "&gt;&lt;font color="#0000ff"&gt;void&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; color: "&gt; Execute(&lt;/span&gt;&lt;span style="font-family: ; color: "&gt;&lt;font color="#2b91af"&gt;CodeActivityContext&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; color: "&gt;&lt;font style="font-size: 9.5pt"&gt; context)&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;          &lt;p style="line-height: normal; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span style="font-family: ; color: "&gt;&lt;font face="Consolas"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;{&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;          &lt;p style="line-height: normal; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span style="font-family: ; color: "&gt;&lt;font face="Consolas"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;          &lt;p style="line-height: normal; margin: 0in 0in 0pt" class="MsoNormal"&gt;&lt;span style="font-family: ; color: "&gt;&lt;font face="Consolas"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;4) Add a reference to the DLL where we defined ICustomContract – we can browse it from the Extensions folder&lt;/p&gt;  &lt;p&gt;5) Modify our activity designer slightly, in the .xaml.cs file:&lt;/p&gt;  &lt;table style="border-bottom: medium none; border-left: medium none; border-collapse: collapse; background: #ffff99; border-top: medium none; border-right: medium none; mso-border-alt: solid windowtext .5pt; mso-yfti-tbllook: 1184; mso-padding-alt: 0in 5.4pt 0in 5.4pt" class="MsoTableGrid" border="1" cellspacing="0" cellpadding="0"&gt;&lt;tbody&gt;     &lt;tr style="mso-yfti-irow: 0; mso-yfti-firstrow: yes; mso-yfti-lastrow: yes"&gt;       &lt;td style="border-bottom: windowtext 1pt solid; border-left: windowtext 1pt solid; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; border-top: windowtext 1pt solid; border-right: windowtext 1pt solid; padding-top: 0in; mso-border-alt: solid windowtext .5pt" valign="top" width="638"&gt;         &lt;p style="line-height: normal; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; color: "&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160; public&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; color: "&gt; &lt;/span&gt;&lt;span style="font-family: ; color: "&gt;&lt;font color="#0000ff"&gt;partial&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; color: "&gt; &lt;/span&gt;&lt;span style="font-family: ; color: "&gt;&lt;font color="#0000ff"&gt;class&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; color: "&gt; &lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; color: "&gt;&lt;font style="font-size: 9.5pt" color="#2b91af"&gt;ActivityDesigner1&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; color: "&gt;&lt;/span&gt;&lt;/p&gt;          &lt;p style="line-height: normal; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span style="font-family: ; color: "&gt;&lt;font face="Consolas"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;{&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;          &lt;p style="line-height: normal; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; color: "&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; color: "&gt;&lt;font color="#0000ff"&gt;public&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; color: "&gt;&lt;font style="font-size: 9.5pt"&gt; ActivityDesigner1()&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;          &lt;p style="line-height: normal; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span style="font-family: ; color: "&gt;&lt;font face="Consolas"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;{&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;          &lt;p style="line-height: normal; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span style="font-family: ; color: "&gt;&lt;font face="Consolas"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;InitializeComponent();&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;          &lt;p style="line-height: normal; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span style="font-family: ; color: "&gt;&lt;font face="Consolas"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;          &lt;p style="line-height: normal; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span style="font-family: ; color: "&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;          &lt;p style="line-height: normal; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; color: "&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; color: "&gt;&lt;font color="#0000ff"&gt;protected&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; color: "&gt; &lt;/span&gt;&lt;span style="font-family: ; color: "&gt;&lt;font color="#0000ff"&gt;override&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; color: "&gt; &lt;/span&gt;&lt;span style="font-family: ; color: "&gt;&lt;font color="#0000ff"&gt;void&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; color: "&gt; OnModelItemChanged(&lt;/span&gt;&lt;span style="font-family: ; color: "&gt;&lt;font color="#0000ff"&gt;object&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; color: "&gt;&lt;font style="font-size: 9.5pt"&gt; newItem)&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;          &lt;p style="line-height: normal; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span style="font-family: ; color: "&gt;&lt;font face="Consolas"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;{&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;          &lt;p style="line-height: normal; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; color: "&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; color: "&gt;&lt;font color="#0000ff"&gt;base&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; color: "&gt;&lt;font style="font-size: 9.5pt"&gt;.OnModelItemChanged(newItem);&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;          &lt;p style="line-height: normal; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; color: "&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; color: "&gt;&lt;font color="#0000ff"&gt;if&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; color: "&gt; (newItem &lt;/span&gt;&lt;span style="font-family: ; color: "&gt;&lt;font color="#0000ff"&gt;is&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; color: "&gt; &lt;/span&gt;&lt;span style="font-family: ; color: "&gt;&lt;font color="#2b91af"&gt;ModelItem&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; color: "&gt;&lt;font style="font-size: 9.5pt"&gt;)&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;          &lt;p style="line-height: normal; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span style="font-family: ; color: "&gt;&lt;font face="Consolas"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;{&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;          &lt;p style="line-height: normal; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; color: "&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&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;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; color: "&gt;&lt;font color="#0000ff"&gt;var&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; color: "&gt; cc = (newItem &lt;/span&gt;&lt;span style="font-family: ; color: "&gt;&lt;font color="#0000ff"&gt;as&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; color: "&gt; &lt;/span&gt;&lt;span style="font-family: ; color: "&gt;&lt;font color="#2b91af"&gt;ModelItem&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; color: "&gt;).GetEditingContext().Services.GetService&amp;lt;&lt;/span&gt;&lt;span style="font-family: ; color: "&gt;&lt;font color="#2b91af"&gt;ICustomContract&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; color: "&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;gt;();&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;          &lt;p style="line-height: normal; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; color: "&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&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;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; color: "&gt;&lt;font color="#0000ff"&gt;if&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; color: "&gt; (cc != &lt;/span&gt;&lt;span style="font-family: ; color: "&gt;&lt;font color="#0000ff"&gt;null&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; color: "&gt;&lt;font style="font-size: 9.5pt"&gt;)&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;          &lt;p style="line-height: normal; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span style="font-family: ; color: "&gt;&lt;font face="Consolas"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&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;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;{&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;          &lt;p style="line-height: normal; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span style="font-family: ; color: "&gt;&lt;font face="Consolas"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&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;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;cc.Hello();&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;          &lt;p style="line-height: normal; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span style="font-family: ; color: "&gt;&lt;font face="Consolas"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&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;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;          &lt;p style="line-height: normal; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span style="font-family: ; color: "&gt;&lt;font face="Consolas"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;          &lt;p style="line-height: normal; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span style="font-family: ; color: "&gt;&lt;font face="Consolas"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;          &lt;p style="line-height: normal; margin: 0in 0in 0pt" class="MsoNormal"&gt;&lt;span style="font-family: ; color: "&gt;&lt;font face="Consolas"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;The important point here is that we will call EditingContext.Services.GetService&amp;lt;ICustomContract&amp;gt;() in order to get the custom service created above.&lt;/p&gt;  &lt;p&gt;When we try it out, we will see our popup dialogs:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-32-00-metablogapi/0636.image_5F00_5C2EB713.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-32-00-metablogapi/0131.image_5F00_thumb_5F00_752A8758.png" width="127" height="130" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-32-00-metablogapi/5822.image_5F00_272227E3.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-32-00-metablogapi/8154.image_5F00_thumb_5F00_6E0B4AE0.png" width="127" height="130" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Interesting and important to note - if you set breakpoints in the constructor of CustomContractExtension, then you will see that it is being created lazily, upon demand.&lt;/p&gt;  &lt;p&gt;Also interesting and important to note – the CustomContractExtension is indeed created in the main Visual Studio App Domain. So calls to it will work calling via .Net Remoting. Now it happens that there is no reference to that object in the main VS AppDomain, which leaves it subject to potential garbage collection. Ideally WorkflowDesigner or the EditingContext would create a remoting &lt;a href="http://msdn.microsoft.com/en-us/magazine/cc300474.aspx"&gt;Sponsor in order to extend the life time of the object&lt;/a&gt; to match the lifetime of the EditingContext.Services object. However, in practice this does not happen. Leaving Visual Studio for idle for a few minutes, you can come back, try to use your custom activity again, and get errors such as:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-32-00-metablogapi/6011.image_5F00_4DF03E23.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-32-00-metablogapi/6813.image_5F00_thumb_5F00_2DD53166.png" width="430" height="325" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Unfortunately I haven’t figured out the right way to stop Garbage collection blowing this up yet, but I think there are a couple approaches that could work: 1) sponsorship as mentioned above, 2) forced&amp;#160; reachability to the service itself by ensuring references from a GC root in its home app domain.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10356056" width="1" height="1"&gt;</content><author><name>tilovell09</name><uri>http://blogs.msdn.com/tilovell/ProfileUrlRedirect.ashx</uri></author><category term="WF4" scheme="http://blogs.msdn.com/b/tilovell/archive/tags/WF4/" /><category term="Workflow Designer" scheme="http://blogs.msdn.com/b/tilovell/archive/tags/Workflow+Designer/" /><category term="MEF" scheme="http://blogs.msdn.com/b/tilovell/archive/tags/MEF/" /><category term="Extensions" scheme="http://blogs.msdn.com/b/tilovell/archive/tags/Extensions/" /><category term="Plugins" scheme="http://blogs.msdn.com/b/tilovell/archive/tags/Plugins/" /><category term="Visual Studio" scheme="http://blogs.msdn.com/b/tilovell/archive/tags/Visual+Studio/" /><category term="Extensibility" scheme="http://blogs.msdn.com/b/tilovell/archive/tags/Extensibility/" /></entry><entry><title>(WF4) Link - Using WF4 custom activities to consume OData</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/tilovell/archive/2012/09/13/wf4-link-using-wf4-custom-activities-to-consume-odata.aspx" /><id>http://blogs.msdn.com/b/tilovell/archive/2012/09/13/wf4-link-using-wf4-custom-activities-to-consume-odata.aspx</id><published>2012-09-13T18:32:35Z</published><updated>2012-09-13T18:32:35Z</updated><content type="html">&lt;p&gt;Today I’m just advertising another MSDN blog that got circulated my way. This post may only going to make full sense if you’ve heard of OData already. If you’re heard of OData, and have been wondering what a good way to use it from workflow might be, I think you’ll find it good food for thought.&lt;/p&gt;  &lt;p&gt;&lt;a title="http://blogs.msdn.com/b/derrick_vanarnams_blog/archive/2012/09/06/announcing-the-adventureworks-odata-feed-sample.aspx" href="http://blogs.msdn.com/b/derrick_vanarnams_blog/archive/2012/09/06/announcing-the-adventureworks-odata-feed-sample.aspx"&gt;http://blogs.msdn.com/b/derrick_vanarnams_blog/archive/2012/09/06/announcing-the-adventureworks-odata-feed-sample.aspx&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;a title="http://blogs.msdn.com/b/derrick_vanarnams_blog/archive/2012/09/12/introducing-the-odata-queryfeed-activity.aspx" href="http://blogs.msdn.com/b/derrick_vanarnams_blog/archive/2012/09/12/introducing-the-odata-queryfeed-activity.aspx"&gt;http://blogs.msdn.com/b/derrick_vanarnams_blog/archive/2012/09/12/introducing-the-odata-queryfeed-activity.aspx&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10349187" width="1" height="1"&gt;</content><author><name>tilovell09</name><uri>http://blogs.msdn.com/tilovell/ProfileUrlRedirect.ashx</uri></author><category term="WF4" scheme="http://blogs.msdn.com/b/tilovell/archive/tags/WF4/" /><category term="Links" scheme="http://blogs.msdn.com/b/tilovell/archive/tags/Links/" /><category term="OData" scheme="http://blogs.msdn.com/b/tilovell/archive/tags/OData/" /></entry><entry><title>(Non-WF) Raw Sockets for receiving IP in C#</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/tilovell/archive/2012/09/07/non-wf-raw-sockets-for-receiving-ip-in-c.aspx" /><id>http://blogs.msdn.com/b/tilovell/archive/2012/09/07/non-wf-raw-sockets-for-receiving-ip-in-c.aspx</id><published>2012-09-06T23:27:18Z</published><updated>2012-09-06T23:27:18Z</updated><content type="html">&lt;p&gt;Today, I set off in a quest to refresh my memory and hopefully also learn something new about sockets, IP, TCP protocols, and so on. Which is quite a breath of nostalgia taking me back to COSC 231 Data Communications. Isn’t it great how when working with HTTP you can forget about nearly all of the low level stuff?&lt;/p&gt;  &lt;p&gt;Of course in my current state of C# dependency, the logical way to do this seemed to be to try to write some C# code, so (obviously) what better than to start learning about all the abstractions .Net offers for the&amp;#160; network stack? I had already heard of a few of the beasts of the .Net network stable, such as Socket. Reading through the documentation for &lt;a href="http://msdn.microsoft.com/en-us/library/2b86d684"&gt;Socket&lt;/a&gt; it appears to offer some interesting capabilities, i.e. not just garden variety UDP and TCP, but also including ‘Raw’ mode where you can send and receive the raw IP packets with all their headers. Fun!&lt;/p&gt;  &lt;p&gt;Note it appears this functionality is &lt;a href="http://msdn.microsoft.com/en-us/library/windows/desktop/ms740548(v=vs.85).aspx"&gt;crippled slightly on client operating systems such as Windows 7&lt;/a&gt; so that you can’t do all the stuff that hackers and penetration testers will really want to do like spoof your IP address - but my dev box is server.&lt;/p&gt;  &lt;p&gt;So, from &lt;a href="http://msdn.microsoft.com/en-us/library/attbb8f5"&gt;the .Net docs for Socket&lt;/a&gt; you would think receiving all the IP traffic on my box should be easy as 1, 2, right?&lt;/p&gt;  &lt;p&gt;1) Create a raw socket for the IP addresss family   &lt;br /&gt;2) Receive!&lt;/p&gt;  &lt;p&gt;I’m basing this on the fact that&lt;/p&gt;  &lt;p&gt;“If you are using a connectionless protocol such as UDP, you do not need to listen for connections at all. Call the &lt;a href="http://msdn.microsoft.com/en-us/library/system.net.sockets.socket.receivefrom"&gt;ReceiveFrom&lt;/a&gt; method to accept any incoming datagrams. Use the &lt;a href="http://msdn.microsoft.com/en-us/library/system.net.sockets.socket.sendto"&gt;SendTo&lt;/a&gt; method to send datagrams to a remote host.”&lt;/p&gt;  &lt;p&gt;Obviously at the IP level it’s got to be a connectionless protocol right?   &lt;br /&gt;And IP doesn’t have ports (those are UDP and TCP things) so we wouldn’t have to bind to a port right?    &lt;br /&gt;    &lt;br /&gt;Wait, doubt surfaces, is it 1, 2, 3, would we have to bind to an IP address as step 2? Or specify somehow that we want to accept connections?    &lt;br /&gt;Hm, OK, 1, 2, 3 it is. Let’s try&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; static void Main(string[] args)   &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; Socket s = new Socket(AddressFamily.InterNetwork, SocketType.Raw, ProtocolType.Raw);    &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; IPAddress ipAddress = Dns.GetHostEntry(Dns.GetHostName()).AddressList[0];    &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; s.Bind(new IPEndPoint(ipAddress, 0));    &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; byte[] b = new byte[2000];    &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; int nr = s.Receive(b, SocketFlags.None);    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;  &lt;p&gt;Argh!   &lt;br /&gt;System.Net.Sockets.SocketException was unhandled    &lt;br /&gt;&amp;#160; HResult=-2147467259    &lt;br /&gt;&amp;#160; Message=An address incompatible with the requested protocol was used&lt;/p&gt;  &lt;p&gt;What went wrong? At first I thought this was a sign that .Net was going to hate me and tell me I couldn’t do this. But it turns out that the first DNS entry for my host is actually an IPV6 address.   &lt;br /&gt;So we modify line 4 to:&lt;/p&gt;  &lt;p&gt;IPAddress ipAddress = Dns.GetHostEntry(Dns.GetHostName()).AddressList.Where((addr) =&amp;gt; addr.AddressFamily == AddressFamily.InterNetwork).First();&lt;/p&gt;  &lt;p&gt;And we have a program that runs and…. never receives anything. Hmm. What are we missing? Is it &lt;a href="http://msdn.microsoft.com/en-us/library/windows/desktop/ee309610(v=vs.85).aspx"&gt;IOCTLs&lt;/a&gt;? Not as far as I can tell. I don’t really want to receive all IP traffic, just IP traffic that’s coming to my address would be fine. Wait, what address am I trying to listen on anyway… 127.0.0.1. Is that a valid address to listen on, or do I need to listen on my real network adapter address?&lt;/p&gt;  &lt;p&gt;So, let’s use a real non loopback address.&lt;/p&gt;  &lt;p&gt;And… also let’s try to connect using a client TCP app who will use that same address.&lt;/p&gt;  &lt;p&gt;No connection could be made because the target machine actively refused it.&lt;/p&gt;  &lt;p&gt;Say whaaaaat?&lt;/p&gt;  &lt;p&gt;Hm. Is the problem Receive? ”Receive: Receives data from a bound &lt;a href="http://msdn.microsoft.com/en-us/library/system.net.sockets.socket"&gt;Socket&lt;/a&gt; into a receive buffer… You can call &lt;a href="http://msdn.microsoft.com/en-us/library/system.net.sockets.socket.receive"&gt;Receive&lt;/a&gt; from both connection-oriented and connectionless sockets.” I did bind it, right? How could that not work? Oh wait, further down: “If you are using a connectionless protocol, you can also use the &lt;a href="http://msdn.microsoft.com/en-us/library/system.net.sockets.socket.receivefrom"&gt;ReceiveFrom&lt;/a&gt; method. &lt;a href="http://msdn.microsoft.com/en-us/library/system.net.sockets.socket.receivefrom"&gt;ReceiveFrom&lt;/a&gt; will allow you to receive data arriving from any host.”&lt;/p&gt;  &lt;p&gt;Anyway, hmm… interesting.   &lt;br /&gt;Am I just being screwed up by a firewall? Probably not…&lt;/p&gt;  &lt;p&gt;Aha, I just noticed an interesting line &lt;a href="http://msdn.microsoft.com/en-us/library/ms740548(VS.85).aspx"&gt;here&lt;/a&gt;:&lt;/p&gt;  &lt;p&gt;“Received datagrams are copied into all &lt;strong&gt;SOCK_RAW&lt;/strong&gt; sockets that satisfy the following conditions:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;The protocol number specified in the &lt;em&gt;protocol&lt;/em&gt; parameter when the socket was created should match the protocol number in the IP header of the received datagram.”&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;So I can’t use TCP protocol on the client side and RAW protocol on my listener. Hmm. So what if I want to reimplement TCP in the application level – can I just use SocketType.Raw with ProtocolType.Tcp? Apparently, yes. But still no dice.&lt;/p&gt;  &lt;p&gt;It does seem like Bind is optional though: ”If a local IP address is defined for the socket, it should correspond to the destination address as specified in the IP header of the received datagram. An application may specify the local IP address by calling the &lt;a href="http://msdn.microsoft.com/en-us/library/ms737550(v=vs.85).aspx"&gt;&lt;strong&gt;bind&lt;/strong&gt;&lt;/a&gt; function. If no local IP address is specified for the socket, the datagrams are copied into the socket regardless of the destination IP address in the IP header of the received datagram.”&lt;/p&gt;  &lt;p&gt;What if I also try to bind to the specific TCP port? Hrm… nope, getting nowhere. Conclusion? Programming is sometimes really just an exercise in frustration.&lt;/p&gt;  &lt;p&gt;To the interweb! Here is &lt;a href="http://stackoverflow.com/questions/4840902/unable-to-read-incoming-responses-using-raw-sockets"&gt;some other poor soul&lt;/a&gt; who has got a similar distance to me. &lt;/p&gt;  &lt;p&gt;And… miracle of miracles. There’s an unaccepted answer which appears to be the right one: Set ProtocolType.IP!&lt;/p&gt;  &lt;p&gt;New conclusion: Sometimes you just get lucky.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10347141" width="1" height="1"&gt;</content><author><name>tilovell09</name><uri>http://blogs.msdn.com/tilovell/ProfileUrlRedirect.ashx</uri></author><category term="off-topic" scheme="http://blogs.msdn.com/b/tilovell/archive/tags/off_2D00_topic/" /></entry><entry><title>(WF4) Survey–have you customized FlowDecision?</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/tilovell/archive/2012/09/05/wf4-survey-have-you-customized-flowdecision.aspx" /><id>http://blogs.msdn.com/b/tilovell/archive/2012/09/05/wf4-survey-have-you-customized-flowdecision.aspx</id><published>2012-09-05T18:42:22Z</published><updated>2012-09-05T18:42:22Z</updated><content type="html">&lt;p&gt;Today I was involved in a playful discussion about what would we do different about Workflow Designer if we could, and the question of ‘what do customers want?’ came up. I think there’s a lot that can change, but one of the ideas I can’t stay away from is improving Flowchart.&lt;/p&gt;  &lt;p&gt;For instance, searching the forums for &lt;a href="http://social.msdn.microsoft.com/Search/en-US/vstudio?query=flowdecision&amp;amp;rq=meta:Search.MSForums.ForumID(76ffbd67-f55e-4b7b-bb2b-29bc8637316d)+site:microsoft.com&amp;amp;rn=Windows+Workflow+Foundation+4+Forum"&gt;threads about FlowDecision&lt;/a&gt; turns up a surprising number of posts by people who want to customize FlowDecision and replace it with something a little bit different. So, here are my open questions for readers of the blog:&lt;/p&gt;  &lt;p&gt;If you built a rehosted designer app did you in fact customize FlowDecision (by e.g. overriding the FlowDecision designer)?   &lt;br /&gt;Why did you do it, what did you make better?&lt;/p&gt;  &lt;p&gt;Also interesting - maybe you have not customized FlowDecision, but you really wanted to? Did you investigate, and find it was impractical? What would you ideally have been able to do?   &lt;br /&gt;    &lt;br /&gt;Replies by comment section!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10346685" width="1" height="1"&gt;</content><author><name>tilovell09</name><uri>http://blogs.msdn.com/tilovell/ProfileUrlRedirect.ashx</uri></author><category term="WF4" scheme="http://blogs.msdn.com/b/tilovell/archive/tags/WF4/" /><category term="Flowchart" scheme="http://blogs.msdn.com/b/tilovell/archive/tags/Flowchart/" /><category term="WF Designer" scheme="http://blogs.msdn.com/b/tilovell/archive/tags/WF+Designer/" /></entry><entry><title>(News) Workflow 1.0 Beta</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/tilovell/archive/2012/07/17/news-workflow-1-0-beta.aspx" /><id>http://blogs.msdn.com/b/tilovell/archive/2012/07/17/news-workflow-1-0-beta.aspx</id><published>2012-07-17T20:53:00Z</published><updated>2012-07-17T20:53:00Z</updated><content type="html">&lt;p&gt;Dropping the stealth cloak a little, it&amp;rsquo;s time for some personal news about what I&amp;rsquo;ve been up to for the last year and a bit. And the answer is? Testing what we are calling in our docs &lt;a href="http://msdn.microsoft.com/en-us/library/jj193477(v=azure.10)"&gt;&amp;ldquo;Workflow 1.0 Beta&amp;rdquo;&lt;/a&gt; (name may change) which is Microsoft&amp;rsquo;s new Workflow hosting offering that works with WF. Here&amp;rsquo;s a few quick facts about this piece of software.&lt;/p&gt;
&lt;h3&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;What is this?&lt;/span&gt;&lt;/h3&gt;
&lt;p&gt;&amp;ldquo;Workflow 1.0 Beta&amp;rdquo; is a separate piece of software being released alongside the Office 2013 Beta, but also a requirement for enabling some of Office&amp;rsquo;s Sharepoint Workflow features.&lt;/p&gt;
&lt;p&gt;It is a &amp;lsquo;server&amp;rsquo; application which stores, loads and executes declarative XAML workflow definitions, the same as WF4 XAML authored custom activities.&lt;/p&gt;
&lt;p&gt;&amp;ldquo;Workflow 1.0 Beta&amp;rdquo; is &lt;em&gt;also &lt;/em&gt;an Azure platform service running in the cloud, which will enable you to host long-running workflow in the cloud without requiring VM role subscriptions.&lt;/p&gt;
&lt;p&gt;See also the &lt;a href="http://msdn.microsoft.com/en-us/library/jj193471(v=azure.10)"&gt;longer, official answer&lt;/a&gt;.&lt;/p&gt;
&lt;h3&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Does it cost anything?&lt;/span&gt;&lt;/h3&gt;
&lt;p&gt;Currently nothing at all - it&amp;rsquo;s a free beta, and for the server product, it is also a separate install from Office. Disclaimer: pricing plans may change for future releases. &lt;/p&gt;
&lt;h3&gt;&lt;span style="font-weight: bold;"&gt;What are the &lt;/span&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/jj193487(v=azure.10)"&gt;&lt;span style="font-weight: bold;"&gt;supported platforms&lt;/span&gt;&lt;/a&gt;&lt;span style="font-weight: bold;"&gt;, &lt;/span&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/jj193485(v=azure.10)"&gt;&lt;span style="font-weight: bold;"&gt;prerequisites&lt;/span&gt;&lt;/a&gt;&lt;span style="font-weight: bold;"&gt;, and &lt;/span&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/jj193451(v=azure.10)"&gt;&lt;span style="font-weight: bold;"&gt;system requirements&lt;/span&gt;&lt;/a&gt;&lt;span style="font-weight: bold;"&gt; required to install the server product?&lt;/span&gt;&lt;/h3&gt;
&lt;p&gt;The answers are linked in the line above.&lt;/p&gt;
&lt;h3&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;How is this different to hosting my own WF4 service using existing hosting technologies?&lt;/span&gt;&lt;/h3&gt;
&lt;p&gt;There are many differences.&lt;/p&gt;
&lt;p&gt;One difference is that workflows now get hosted/installed on the server by publishing workflows to the server via REST-style HTTP calls. Of course there is also a user-friendly managed API for publishing workflows that wraps the HTTP if you'd rather just write simple code. As this is a &lt;em&gt;multi-tenant &lt;/em&gt;workflow offering, you can also create multiple &lt;em&gt;tenancies&lt;/em&gt;, and your own customers can use this same client API to upload their workflow definitions to their &lt;em&gt;tenancy &lt;/em&gt;on your central server.&lt;/p&gt;
&lt;p&gt;Another difference that will feel very different to existing WF4 customers is that workflows run in a sandboxed mode which disallows any potentially dangerous types and activities, sort of like running in partial trust, or as a restricted user.&lt;/p&gt;
&lt;p&gt;This may feel like a severe limitation given how used we are to creating custom &lt;em&gt;code&lt;/em&gt; activities. However, if you are running &amp;ldquo;Workflow 1.0 Beta&amp;rdquo; as an on-premise server, there are ways you can configure &amp;ldquo;Workflow 1.0 Beta&amp;rdquo; to allow your own custom code activities which I&amp;rsquo;ll hopefully get to posting some time soon, assuming people are interested!&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;h3&gt;&lt;span style="font-weight: bold;"&gt;Where can I get more information?&lt;/span&gt;&lt;/h3&gt;
&lt;p&gt;It&amp;rsquo;s all starting here! Workflow 1.0 Beta&lt;/p&gt;
&lt;p&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/jj193528(v=azure.10"&gt;http://msdn.microsoft.com/en-us/library/jj193528(v=azure.10&lt;/a&gt;)&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Further questions are welcome in the comments section!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10330835" width="1" height="1"&gt;</content><author><name>tilovell09</name><uri>http://blogs.msdn.com/tilovell/ProfileUrlRedirect.ashx</uri></author><category term="WF4" scheme="http://blogs.msdn.com/b/tilovell/archive/tags/WF4/" /><category term="Announcements" scheme="http://blogs.msdn.com/b/tilovell/archive/tags/Announcements/" /><category term="Azure" scheme="http://blogs.msdn.com/b/tilovell/archive/tags/Azure/" /><category term="News" scheme="http://blogs.msdn.com/b/tilovell/archive/tags/News/" /></entry></feed>