<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://devlicio.us/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Derik Whittaker : HowTo</title><link>http://devlicio.us/blogs/derik_whittaker/archive/tags/HowTo/default.aspx</link><description>Tags: HowTo</description><dc:language>en</dc:language><generator>CommunityServer 2008.5 SP1 (Build: 31106.3070)</generator><item><title>Setting up Unit Testing w/ Jasmine, Chutzpah and Typescript</title><link>http://devlicio.us/blogs/derik_whittaker/archive/2012/12/23/setting-up-unit-testing-w-jasmine-chutzpah-and-typescript.aspx</link><pubDate>Sun, 23 Dec 2012 12:49:46 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:70731</guid><dc:creator>Derik Whittaker</dc:creator><slash:comments>2</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/derik_whittaker/rsscomments.aspx?PostID=70731</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/derik_whittaker/commentapi.aspx?PostID=70731</wfw:comment><comments>http://devlicio.us/blogs/derik_whittaker/archive/2012/12/23/setting-up-unit-testing-w-jasmine-chutzpah-and-typescript.aspx#comments</comments><description>&lt;p&gt;Recently I got back into writing html/javascript code as part of my day job and boy-o-boy have things changed since the last time i did any of this.&amp;#160; One thing that has not changed for me however was my belief in unit testing, so it was very painful for me to be writing hundreds of lines of javascript (ok really &lt;a&gt;TypeScript&lt;/a&gt;) code with NO tests supporting them.&amp;#160; At first I was able to live with this feeling because I was too busy trying to relearn how to do javascript development.&amp;#160; However, I have not reached a comfort level where the lack of tests is killing me again.&lt;/p&gt;  &lt;p&gt;No of course in client/server land of .Net development getting started testing is dead simple, however in the Javascript/html world things are still in the toddler stage, IMO, and there are many, many options to testing and I had no idea which is the best.&amp;#160; After doing some searching and asking on twitter I settled on Jasmine as my test runner.&amp;#160; &lt;/p&gt;  &lt;p&gt;Now that I picked Jasmine, how did I get started?&amp;#160; Here is what I did (this post is a merging of many, many posts I looked at to get me pointed in the right direction)&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Step 1: Create a new test project&lt;/strong&gt;&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;Open up Visual Studio 2012 and create a basic MVC 4 application (empty)      &lt;br /&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&lt;strong&gt;Step 2: Get &lt;/strong&gt;&lt;a href="http://pivotal.github.com/jasmine/"&gt;&lt;strong&gt;Jasmine&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;Install the Jasmine NuGet Package      &lt;br /&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_28E3288F.png"&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="image" border="0" alt="image" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_thumb_5F00_4CBBDA1C.png" width="751" height="99" /&gt;&lt;/a&gt;       &lt;br /&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&lt;strong&gt;Step 3: Run your application in order to validate that jasmine is running correctly&lt;/strong&gt;&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_5302B0AA.png"&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="image" border="0" alt="image" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_thumb_5F00_3CCC9558.png" width="448" height="309" /&gt;&lt;/a&gt; &lt;/p&gt;    &lt;p&gt;Yup, we are good      &lt;br /&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&lt;strong&gt;Step 4: Get &lt;/strong&gt;&lt;a href="http://chutzpah.codeplex.com/"&gt;&lt;strong&gt;Chutzpah&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;I wanted a way to run my tests inside of Visual Studio and this plugin seemed to do the trick. I opted to install the test adapter which can be found &lt;a href="http://visualstudiogallery.msdn.microsoft.com/f8741f04-bae4-4900-81c7-7c9bfb9ed1fe"&gt;here&lt;/a&gt;       &lt;br /&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&lt;strong&gt;Step 5: Validate that Chutzpah adapter was setup correctly&lt;/strong&gt;&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_69E18226.png"&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="image" border="0" alt="image" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_thumb_5F00_572C886F.png" width="562" height="170" /&gt;&lt;/a&gt; &lt;/p&gt;    &lt;p&gt;As you can see from above, it is setup correctly.&lt;/p&gt;    &lt;p&gt;Now I wanted to be able to author my tests in Typescript and have them run as well.      &lt;br /&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&lt;strong&gt;Step 6: Download the Jasmine &lt;/strong&gt;&lt;a href="https://github.com/borisyankov/DefinitelyTyped/tree/master/jasmine"&gt;&lt;strong&gt;typescript definition file&lt;/strong&gt;&lt;/a&gt;&lt;strong&gt;.&amp;#160; I put this inside my scripts folder as seen below&lt;/strong&gt;&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_1A9489D2.png"&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="image" border="0" alt="image" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_thumb_5F00_27FA9CD8.png" width="245" height="101" /&gt;&lt;/a&gt;       &lt;br /&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&lt;strong&gt;Step 7: Create my Test Spec&lt;/strong&gt;&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;The trick to getting this to work of course is that I need to include the jasmine-1.2.d.ts definition file inside my .ts file as below&lt;/p&gt;    &lt;p&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_206F2D6B.png"&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="image" border="0" alt="image" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_thumb_5F00_2002FA76.png" width="345" height="28" /&gt;&lt;/a&gt; &lt;/p&gt;    &lt;p&gt;I also need to reference my class under test file inside my .ts file as below&lt;/p&gt;    &lt;p&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_389297C6.png"&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="image" border="0" alt="image" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_thumb_5F00_5EF47B11.png" width="289" height="39" /&gt;&lt;/a&gt; &lt;/p&gt;    &lt;p&gt;Once I did both of these I could write my first test as below&lt;/p&gt;    &lt;p&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_05565E5D.png"&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="image" border="0" alt="image" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_thumb_5F00_44B411ED.png" width="322" height="175" /&gt;&lt;/a&gt;&amp;#160;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;Bam, now I have a jasmine test written via Typescript and runnable via the Chutzpah test running.&amp;#160; Of course I am sure there are other ways to get this to work, this is just what worked for me.&lt;/p&gt;  &lt;p&gt;Till next time,&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=70731" width="1" height="1"&gt;</description><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/TDD/default.aspx">TDD</category><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/HowTo/default.aspx">HowTo</category><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/JavaScript/default.aspx">JavaScript</category><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/Typescript/default.aspx">Typescript</category></item><item><title>Deploying Asp.Net 4.5 site to IIS Error: ManagedRuntimeVersion to v.45</title><link>http://devlicio.us/blogs/derik_whittaker/archive/2012/12/18/deploying-asp-net-4-5-site-to-iis-error-managedruntimeversion-to-v-45.aspx</link><pubDate>Tue, 18 Dec 2012 14:28:46 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:70720</guid><dc:creator>Derik Whittaker</dc:creator><slash:comments>3</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/derik_whittaker/rsscomments.aspx?PostID=70720</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/derik_whittaker/commentapi.aspx?PostID=70720</wfw:comment><comments>http://devlicio.us/blogs/derik_whittaker/archive/2012/12/18/deploying-asp-net-4-5-site-to-iis-error-managedruntimeversion-to-v-45.aspx#comments</comments><description>&lt;p&gt;Today I was trying to publish a Asp.net 4.5 site to our server and I received the following error;&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;The Application pool that you are trying to use has the ‘managedRuntimeVersion’ property set to v4.0. This application requires ‘v4.5’&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;I thought this was odd so I went to change the App pool, only to see there is no v4.5 option.&amp;#160; After a bit of Goggling my suspicions about v4.5 not having an app pool as v4.5 of .net is inplace update and does not have a new ‘version’.&lt;/p&gt;  &lt;p&gt;After a bit more Goggling and looking at StackoverFlow answers I found the &lt;a href="http://stackoverflow.com/questions/11057814/deploying-a-net-4-5-website-to-an-iis-7-5-server"&gt;solution&lt;/a&gt;, although it was not the ‘selected’ solution but oh well.&lt;/p&gt;  &lt;p&gt;See I am doing my deploy via a powershell script using &lt;a href="https://github.com/JamesKovacs/psake"&gt;pSake&lt;/a&gt; and my deploy looked something like this&lt;/p&gt;  &lt;p&gt;&amp;amp;$msBuildpath /verbosity:m $projectFileAndPath /T:Rebuild /T:Package /p:&amp;quot;Configuration=$buildMode;Packagelocation=$packageFolder&amp;quot;&amp;#160; &lt;br /&gt;/p:DeployOnBuild=True /p:DeployTarget=MsDeployPublish /p:CreatePackageOnPublish=True     &lt;br /&gt;/p:MSDeployPublishMethod=RemoteAgent /p:MSDeployServiceUrl=$deploymentServer /p:DeployIisAppPath=$deploymentAppPath&amp;#160; &lt;br /&gt;/p:UserName=$deployuser /p:Password=$deploypassword&amp;#160;&amp;#160;&amp;#160; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;What I needed to add was the &lt;code&gt;/P:VisualStudioVersion=11.0 &lt;/code&gt;switch to force the right compiler.&amp;#160; Once I added this switch my deploy was right as rain.&lt;/p&gt;  &lt;p&gt;Till next time,&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=70720" width="1" height="1"&gt;</description><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/asp.net/default.aspx">asp.net</category><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/HowTo/default.aspx">HowTo</category><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/ASP.Net+MVC/default.aspx">ASP.Net MVC</category><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/PSake/default.aspx">PSake</category></item><item><title>Sending In-Application Toast Notifications in WinRT for C#</title><link>http://devlicio.us/blogs/derik_whittaker/archive/2012/11/14/sending-in-application-toast-notifications-in-winrt-for-c.aspx</link><pubDate>Wed, 14 Nov 2012 23:52:35 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:70469</guid><dc:creator>Derik Whittaker</dc:creator><slash:comments>3</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/derik_whittaker/rsscomments.aspx?PostID=70469</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/derik_whittaker/commentapi.aspx?PostID=70469</wfw:comment><comments>http://devlicio.us/blogs/derik_whittaker/archive/2012/11/14/sending-in-application-toast-notifications-in-winrt-for-c.aspx#comments</comments><description>&lt;p&gt;When building a Windows RT application (based on C#) it is pretty common that you will want to notify your user of an event.&amp;#160; It is more common that you are going to want to do this in a way which is not intrusive, aka does not get in the way of the user.&amp;#160; Luckily for you the WinRT team has built a great toast notification engine into the framework.&lt;/p&gt;  &lt;p&gt;In fact this notification engine allows for toasts to be both in-application as well as remote notifications.&amp;#160; It also allows for notifications to be real time (sent when at the time you create them) as well as scheduling them to be sent at some predetermined date/time in the future.&lt;/p&gt;  &lt;p&gt;In this post I am only going to show how to do in-application toasts, I will focus on cloud base toasts in a future posts.&amp;#160; Before we dive into the code, take a second to look at the &lt;a href="http://msdn.microsoft.com/en-us/library/windows/apps/Hh761494.aspx"&gt;Toast Template Catalog&lt;/a&gt; for all the various ways we can layout/format the toast.&lt;/p&gt;  &lt;p&gt;Getting started.&lt;/p&gt;  &lt;p&gt;What does a toast look like?&lt;/p&gt;  &lt;p&gt;&lt;img src="https://encrypted-tbn3.gstatic.com/images?q=tbn:ANd9GcQgJnpJJY7wpL7OrfRyMtaLlCJ3P3zlYDhYUqTXZ9ei-JcrxjOv" width="278" height="181" alt="" /&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;How do create toasts?&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;You must enable toasts via the Package.appxmanifest      &lt;br /&gt;      &lt;br /&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_65754687.png"&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="image" border="0" alt="image" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_thumb_5F00_4E864F3E.png" width="381" height="115" /&gt;&lt;/a&gt;&amp;#160; &lt;br /&gt;      &lt;br /&gt;If you do not enable toasts you will NOT get a toasts, nor will you get an error, it will simply NOT WORK.       &lt;br /&gt;&lt;/li&gt;    &lt;li&gt;Check to see if toasts have been enabled      &lt;pre class="c#" name="code"&gt;            
var notifier = ToastNotificationManager.CreateToastNotifier();
if (notifier.Setting != NotificationSetting.Enabled)
{
	// do something here
}            

	&lt;/pre&gt;

    &lt;p&gt;In the above we are first creating the notifier, then we simply check the Setting property. If it is not enabled you may want to punt or alert the user.&lt;/p&gt;
  &lt;/li&gt;

  &lt;li&gt;Create the code to create the toasts – Real time toasts 
    &lt;pre class="c#" name="code"&gt;            
var notifier = ToastNotificationManager.CreateToastNotifier();
var template = ToastNotificationManager.GetTemplateContent(ToastTemplateType.ToastText02);
            
var element = template.GetElementsByTagName(&amp;quot;text&amp;quot;)[0];
element.AppendChild(template.CreateTextNode(&amp;quot;Line 1 goes here&amp;quot;));

var toast = new ToastNotification(template);
notifier.Show(toast);
	&lt;/pre&gt;

    &lt;p&gt;If you look at the code above one thing should jump out at you right way, the fact you have to drop down to raw XML.&amp;#160; Yea, it sucks.&amp;#160; The toast team decided to NOT wrap this in the same way as the Tile team, but oh well. 
      &lt;br /&gt;

      &lt;br /&gt;In the above we are first creating the notifier, then we will chose the template we want.&amp;#160; Once we do that we just start updating the values as expected.&lt;/p&gt;
  &lt;/li&gt;

  &lt;li&gt;Create to code to create scheduled toasts 
    &lt;pre class="c#" name="code"&gt;            
var notifier = ToastNotificationManager.CreateToastNotifier();
var template = ToastNotificationManager.GetTemplateContent(ToastTemplateType.ToastText02);
            
var element = template.GetElementsByTagName(&amp;quot;text&amp;quot;)[0];
element.AppendChild(template.CreateTextNode(&amp;quot;Line 1 goes here&amp;quot;));

// Schedule the toast to appear 10 seconds from now
var date = DateTimeOffset.Now.AddSeconds(10);
var scheduledToast = new ScheduledToastNotification(template, date);
notifier.AddToSchedule(scheduledToast);
	&lt;/pre&gt;

    &lt;p&gt;If you look at the code above about the only thing that has changed is that we are now creating a ‘ScheduledToastNotification’ instance and adding this to the ToastNotifiier. 
      &lt;br /&gt;&lt;/p&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;As you can see doing in-application toast notifications is very easy and only requires a few lines of code.&lt;/p&gt;

&lt;p&gt;Till next time,&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=70469" width="1" height="1"&gt;</description><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/.Net/default.aspx">.Net</category><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/HowTo/default.aspx">HowTo</category><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/WinRT/default.aspx">WinRT</category><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/Windows+8/default.aspx">Windows 8</category></item><item><title>How we handled our branches during our TFS to Git migration</title><link>http://devlicio.us/blogs/derik_whittaker/archive/2012/11/10/how-we-handled-our-branches-during-our-tfs-to-git-migration.aspx</link><pubDate>Sat, 10 Nov 2012 18:02:03 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:70461</guid><dc:creator>Derik Whittaker</dc:creator><slash:comments>4</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/derik_whittaker/rsscomments.aspx?PostID=70461</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/derik_whittaker/commentapi.aspx?PostID=70461</wfw:comment><comments>http://devlicio.us/blogs/derik_whittaker/archive/2012/11/10/how-we-handled-our-branches-during-our-tfs-to-git-migration.aspx#comments</comments><description>&lt;p&gt;In my &lt;a href="http://devlicio.us/blogs/derik_whittaker/archive/2012/11/07/moving-from-tfs-to-github-what-we-did.aspx"&gt;prior post&lt;/a&gt; I documented the steps and processes that OUR team took to move from hosting our source in a TFS solution to Git/Github (remember, these are SIMPLY our steps).&amp;#160; However, one thing I did not mention is how we moved our feature branches from TFS to Github.&lt;/p&gt;  &lt;p&gt;Given the fact that TFS and GIT treat branches treated 100% differently at the lowest level, we knew we would NOT be able to clone/convert our features branches in any reasonable manor and push those into Git. However, these branches were still active and did need to get them out of TFS and into Git.&lt;/p&gt;  &lt;p&gt;So how did we migrate/push our feature branches from TFS to Git?&amp;#160; Simply xCopy :)&lt;/p&gt;  &lt;p&gt;What we did was the following&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Did a pull from our TFS root into each of the feature branches and resolved any merge issues.&lt;/li&gt;    &lt;li&gt;Created the feature branch in Git via the Windows Github client&lt;/li&gt;    &lt;li&gt;Switched context on our git repository to be that of the new branch&lt;/li&gt;    &lt;li&gt;xCopied our TFS branch files from TFS into the folder of our Git repository&lt;/li&gt;    &lt;li&gt;Let the Windows Github client pick up the changes (I had to restart the Windows client in order for changes to get noticed, but that may not be required for everyone)&lt;/li&gt;    &lt;li&gt;Committed the changes locally&lt;/li&gt;    &lt;li&gt;Synced the changes to Github&lt;/li&gt;    &lt;li&gt;Deleted my old branch&lt;/li&gt;    &lt;li&gt;Had a beer.&lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;As you can see from above, there were a few steps involved, and there may have been a better way.&amp;#160; However, this just worked for us.&lt;/p&gt;  &lt;p&gt;Till next time,&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=70461" width="1" height="1"&gt;</description><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/HowTo/default.aspx">HowTo</category><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/GitHub/default.aspx">GitHub</category><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/Git/default.aspx">Git</category></item><item><title>Code Contracts tab in VS2012 – Odd way to get it enabled</title><link>http://devlicio.us/blogs/derik_whittaker/archive/2012/09/07/code-contracts-tab-in-vs2012-odd-way-to-get-it-enabled.aspx</link><pubDate>Fri, 07 Sep 2012 10:38:19 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:70312</guid><dc:creator>Derik Whittaker</dc:creator><slash:comments>3</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/derik_whittaker/rsscomments.aspx?PostID=70312</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/derik_whittaker/commentapi.aspx?PostID=70312</wfw:comment><comments>http://devlicio.us/blogs/derik_whittaker/archive/2012/09/07/code-contracts-tab-in-vs2012-odd-way-to-get-it-enabled.aspx#comments</comments><description>&lt;p&gt;I am a huge fan of the &lt;a href="http://research.microsoft.com/en-us/projects/contracts/"&gt;Code Contracts&lt;/a&gt; library which is now part of .net, in fact when I setup a new instance of VS it is one of the first plugins I install by default.&amp;#160; However, I was having some issues because even though I had installed the .msi I was not able to get the settings tab to show up in VS2012, in fact it was not in VS2010 either.&amp;#160; This was a bit odd to me because I had never had this issue.&lt;/p&gt;  &lt;p&gt;In order to try to resolve this I decided I should uninstall the .msi and re-install it, so I set out to do this.&amp;#160; However, after doing this I still did not have the tab in either IDE, now I was perplexed.&amp;#160; Of course the first thing I did was to go out and search for the solution for this issue but nothing really popped out as ‘this is how to fix this issue’, however a few people did mention that they had to do a VS Repair install.&amp;#160; I thought this to be a bit extreme so I was not too keen to give this a try.&lt;/p&gt;  &lt;p&gt;However, as fate would have it I was kinda forced to do a Repair a few hours after tabling my efforts to get the tab to show in the IDE (I had some really odd VSMon debugger attachment issues and the error dialog actually suggested I do a repair).&amp;#160; Given that I had 2 different issues both suggesting I do a repair install I figured WTF might as well do it.&lt;/p&gt;  &lt;p&gt;Long story short, I did the repair install and BOTH my issues were resolved.&amp;#160; I had the tab in the IDE and my VSMon debugger issues were gone.&amp;#160; Now I don’t know if the issues were related or if it was just a really good coincidence but either way my issues were resolved.&lt;/p&gt;  &lt;p&gt;So if you find yourself unable to get the Code Contracts tab showing in your IDE after installed the .msi try doing a VS repair install and see if that does the trick.&lt;/p&gt;  &lt;p&gt;Till next time,&lt;/p&gt;  &lt;p&gt;P.S. I have both VS2010 and VS2012 on my box and I installed VS2012 first.&amp;#160; This may have caused some of the issues, not sure.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=70312" width="1" height="1"&gt;</description><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/.Net+IDE/default.aspx">.Net IDE</category><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/HowTo/default.aspx">HowTo</category><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/Code+Contracts/default.aspx">Code Contracts</category></item><item><title>Help my Secondary Tile will not navigate correctly in my Win Phone Application</title><link>http://devlicio.us/blogs/derik_whittaker/archive/2012/08/25/help-my-secondary-tile-will-not-navigate-correctly-in-my-win-phone-application.aspx</link><pubDate>Sun, 26 Aug 2012 01:15:21 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:70294</guid><dc:creator>Derik Whittaker</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/derik_whittaker/rsscomments.aspx?PostID=70294</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/derik_whittaker/commentapi.aspx?PostID=70294</wfw:comment><comments>http://devlicio.us/blogs/derik_whittaker/archive/2012/08/25/help-my-secondary-tile-will-not-navigate-correctly-in-my-win-phone-application.aspx#comments</comments><description>&lt;p&gt;When you are adding the ability to have a Secondary tile to your Windows phone application you may from time to time find the need to debug or mimic the launching of the application via the Secondary tile w/ the correct query string values. Sadly, debugging this via the debugger is not something that I have found out how to do, if it is possible please let me know.&amp;nbsp; However, I have found another way to get the same result and here is how.&lt;/p&gt; &lt;ol&gt; &lt;li&gt;Get the exact tile uri used for the secondary tile.&lt;br /&gt;Example: “/views/events/Landing.xaml?Id=1”&lt;br /&gt;&lt;/li&gt; &lt;li&gt;Open up the WMAppManifest.xml page under resources&lt;/li&gt; &lt;li&gt;Find the line that looks like this:&lt;br /&gt;&amp;lt;DefaultTask Name=&amp;quot;_default&amp;quot; NavigationPage=&amp;quot;MainPage.xaml&amp;quot; /&amp;gt;&lt;br /&gt;&lt;/li&gt; &lt;li&gt;Replace it w/ the URI of your secondary tile like this:&lt;br /&gt;&amp;lt;DefaultTask Name=&amp;quot;_default&amp;quot; NavigationPage=&amp;quot;/views/events/Landing.xaml?Id=1&amp;quot; /&amp;gt;&lt;br /&gt;&lt;/li&gt; &lt;li&gt;Launch the application&lt;/li&gt;&lt;/ol&gt; &lt;p&gt;If you are wired everything correctly your page should load, but if you are trying to debug this it is likely you did not have everything correct.&amp;nbsp; If you did not do things correctly you should get some sort of runtime error.&lt;/p&gt; &lt;p&gt;Hope this helps&lt;/p&gt; &lt;p&gt;Till next time,&lt;/p&gt;&lt;pre&gt;
&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=70294" width="1" height="1"&gt;</description><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/HowTo/default.aspx">HowTo</category><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/WP7/default.aspx">WP7</category><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/WindowsPhone/default.aspx">WindowsPhone</category><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/WP7+Mango/default.aspx">WP7 Mango</category></item><item><title>FileLoadException: Could not load file for Version 2.0.5.0, Portable Class Library</title><link>http://devlicio.us/blogs/derik_whittaker/archive/2012/07/23/fileloadexception-could-not-load-file-for-version-2-0-5-0-portable-class-library.aspx</link><pubDate>Mon, 23 Jul 2012 10:13:33 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:70042</guid><dc:creator>Derik Whittaker</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/derik_whittaker/rsscomments.aspx?PostID=70042</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/derik_whittaker/commentapi.aspx?PostID=70042</wfw:comment><comments>http://devlicio.us/blogs/derik_whittaker/archive/2012/07/23/fileloadexception-could-not-load-file-for-version-2-0-5-0-portable-class-library.aspx#comments</comments><description>&lt;p&gt;Recently while trying to deploy a service to a clean VM (moving this off our main production server onto its own server) I ran into the error below”&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;Unhandled Exception: System.IO.FileLoadException: Could not load file or assembly &amp;#39;System, Version=2.0.5.0, Culture=neutral,     &lt;br /&gt;PublicKeyToken=7cec85d7bea7798e, Retargetable=Yes&amp;#39; or one of its dependencies. The given assembly name or codebase was invali      &lt;br /&gt;d. (Exception from HRESULT: 0x80131047)&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;At first glance I thought it was saying that I did not have .net 2 installed on the server which was odd as it had .NBet 3.5 (which is a superset of 2) and .Net 4.&amp;#160; Of course I quickly set out to Bing the hell out of the message but that did not really lead me to an immediate solution.&amp;#160; However, what I did notice was that v 2.0.5.0 was always referred to in the context of Silverlight, this got me thinking.&amp;#160; Was i referencing a Silverlight based assembly in my project?&amp;#160; To find this out I turned to my handy decompiler from &lt;a href="http://www.telerik.com/products/decompiler.aspx"&gt;Telerik&lt;/a&gt;.&amp;#160; &lt;/p&gt;  &lt;p&gt;Sure enough I did have a silverlight assembly being referenced in .Net (I did not have the silverlight SDK installed on my box).&amp;#160; I removed the reference and redeployed, but nothing changed.&amp;#160; I still received the error above.&amp;#160; Now I was getting pissed.&amp;#160; I went back to the decompiler and started looking again through my reference tree to see if I missed something, and I did, kinda.&amp;#160; Turns out one of our assemblies is using the Portable Class Library and it is targeted towards the client profile and Silverlight profile, but this should not have caused an issue, but clearly it did.&lt;/p&gt;  &lt;p&gt;After a bit more digging the answer showed up.&amp;#160; As it turns out the solution to my problem was buried deep on the &lt;a href="http://msdn.microsoft.com/en-us/library/gg597391.aspx"&gt;Portable Class Library documentation&lt;/a&gt; page (as seen below), and it pointed me toward the &lt;a href="http://www.microsoft.com/en-us/download/details.aspx?id=3556"&gt;setup file&lt;/a&gt; which solved my issue.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_30C77178.png"&gt;&lt;img style="border-bottom:0px;border-left:0px;display:inline;border-top:0px;border-right:0px;" title="image" border="0" alt="image" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_thumb_5F00_29C7BEF3.png" width="513" height="47" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;   &lt;p&gt;Turns out that when you use the Portable Class Library it will actually upgrade/update your .net assemblies on disk in order to use this, which makes sense, and with out running the installed mentioned above you will not be able to use any .net assembly which is based off the Portable Class Library.&lt;/p&gt;    &lt;p&gt;The moral of the story is that if you are use PCL then make sure you install the update above on your servers in order to get everything to work.&lt;/p&gt;    &lt;p&gt;Till next time,&lt;/p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=70042" width="1" height="1"&gt;</description><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/.Net/default.aspx">.Net</category><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/Help_210021002100_/default.aspx">Help!!!</category><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/HowTo/default.aspx">HowTo</category></item><item><title>Argument Exception when Working with Secondary Tiles in WinRT (C#)</title><link>http://devlicio.us/blogs/derik_whittaker/archive/2012/07/14/parameter-incorrect-exception-when-working-with-secondary-tiles-in-winrt-c.aspx</link><pubDate>Sat, 14 Jul 2012 18:28:43 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:70036</guid><dc:creator>Derik Whittaker</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/derik_whittaker/rsscomments.aspx?PostID=70036</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/derik_whittaker/commentapi.aspx?PostID=70036</wfw:comment><comments>http://devlicio.us/blogs/derik_whittaker/archive/2012/07/14/parameter-incorrect-exception-when-working-with-secondary-tiles-in-winrt-c.aspx#comments</comments><description>&lt;p&gt;If you are attempting to work with or create secondary tiles and you are getting the following exception you may want to check your title id.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;System.ArgumentException: The parameter is incorrect. &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;When trying to do a &lt;a href="http://msdn.microsoft.com/en-us/library/windows/apps/windows.ui.startscreen.secondarytile.exists.aspx"&gt;SecondaryTile.Exists&lt;/a&gt;(tileId) with the value as seen in the picture below&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_68D68E07.png"&gt;&lt;img title="image" style="border-top:0px;border-right:0px;border-bottom:0px;border-left:0px;display:inline;" border="0" alt="image" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_thumb_5F00_7C86084C.png" width="404" height="55" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;I was getting the ArgumentException, at first I was stumped but then it dawned on me the ID cannot contain spaces or special characters.&amp;#160; When I removed the spaces as seen below my errors went away.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_3E8C778E.png"&gt;&lt;img title="image" style="border-top:0px;border-right:0px;border-bottom:0px;border-left:0px;display:inline;" border="0" alt="image" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_thumb_5F00_60E40D07.png" width="404" height="52" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;The take away from here is if you are getting exceptions when working with tileId’s check that the ID does not have whitespace or special characters.&lt;/p&gt;  &lt;p&gt;Till next time,&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=70036" width="1" height="1"&gt;</description><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/HowTo/default.aspx">HowTo</category><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/WinRT/default.aspx">WinRT</category><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/Metro/default.aspx">Metro</category></item><item><title>Playing a embedded media file (mp3) in WinRT (not via Xaml)</title><link>http://devlicio.us/blogs/derik_whittaker/archive/2012/07/14/playing-a-embedded-media-file-mp3-in-winrt-not-via-xaml.aspx</link><pubDate>Sat, 14 Jul 2012 17:39:30 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:70035</guid><dc:creator>Derik Whittaker</dc:creator><slash:comments>2</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/derik_whittaker/rsscomments.aspx?PostID=70035</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/derik_whittaker/commentapi.aspx?PostID=70035</wfw:comment><comments>http://devlicio.us/blogs/derik_whittaker/archive/2012/07/14/playing-a-embedded-media-file-mp3-in-winrt-not-via-xaml.aspx#comments</comments><description>&lt;p&gt;When building WinRT applications it is going to be pretty common to want to play some sort of embedded audio file.&amp;#160; It may also be common to want to play this file but via a ViewModel (or simply not in a view).&amp;#160; In this post we are going to take a quick look at how to play an MP3 file by using the &lt;a href="http://msdn.microsoft.com/en-us/library/system.windows.controls.mediaelement.aspx"&gt;MediaElement&lt;/a&gt; control, but we will NOT be doing this via XAML, we will be doing via straight up code.&amp;#160; The reason I am not using XAML here is because i don’t want to limit the places or times I can play audio, also I want to trigger the playing of the file via my ViewModel.&lt;/p&gt;  &lt;p&gt;Before we get coding lets assume we have an audio file embedded in our application under the /Assests/SoundFiles folder and the file name is ding.mp3&lt;/p&gt;  &lt;p&gt;dd&lt;/p&gt;  &lt;pre class="c#" name="code"&gt;
private MediaElement _mediaElement;
public async Task Play( string fileName)
{
    var packageLocation = Windows.ApplicationModel.Package.Current.InstalledLocation;
    var assetsFolder = await packageLocation.GetFolderAsync(&amp;quot;assets&amp;quot;);
    var soundsFolder = await assetsFolder.GetFolderAsync(&amp;quot;soundFiles&amp;quot;);
    var myAudio = await soundsFolder.GetFileAsync(fileName); // would be ding.mp3
 
    _mediaElement = new MediaElement();
            
    var stream = await myAudio.OpenAsync(FileAccessMode.Read);
    _mediaElement.SetSource(stream, myAudio.ContentType);

    _mediaElement.Play();
}&lt;/pre&gt;

&lt;p&gt;In the code above you can see that we are doing the following things.&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Getting the &lt;a href="http://msdn.microsoft.com/en-us/library/windows/apps/windows.storage.storagefile.aspx"&gt;StorageFile&lt;/a&gt; reference to Ding.mp3&lt;/li&gt;

  &lt;li&gt;Creating a new instance of the &lt;a href="http://msdn.microsoft.com/en-us/library/system.windows.controls.mediaelement.aspx"&gt;MediaElement&lt;/a&gt; (this is class level because I found the audio would not play if it were a local instance)&lt;/li&gt;

  &lt;li&gt;Open the &lt;a href="http://msdn.microsoft.com/en-us/library/windows/apps/windows.storage.storagefile.aspx"&gt;StorageFile&lt;/a&gt; and get the &lt;a href="http://msdn.microsoft.com/en-us/library/windows/apps/windows.storage.streams.irandomaccessstream.aspx"&gt;Stream&lt;/a&gt; reference of the file&lt;/li&gt;

  &lt;li&gt;Set the &lt;a href="http://msdn.microsoft.com/en-us/library/windows/apps/windows.storage.streams.irandomaccessstream.aspx"&gt;Stream&lt;/a&gt; reference as the source for the MediaElement&lt;/li&gt;

  &lt;li&gt;Call Play&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Now in theory you should be able to set the ‘source’ property to the file path, but i was not able to get this to work.&amp;#160; This may have been my error or could be an issue with the MediaElement.&amp;#160; &lt;/p&gt;

&lt;p&gt;As you can see this is not too complicated and requires almost no code&lt;/p&gt;

&lt;p&gt;Till next time,&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=70035" width="1" height="1"&gt;</description><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/HowTo/default.aspx">HowTo</category><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/WinRT/default.aspx">WinRT</category><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/Metro/default.aspx">Metro</category></item><item><title>Creating an IStorageFile out of a Local Resource in WinRT (C#)</title><link>http://devlicio.us/blogs/derik_whittaker/archive/2012/06/26/creating-an-istoragefile-out-of-a-local-resource-in-winrt-c.aspx</link><pubDate>Tue, 26 Jun 2012 13:52:35 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:70012</guid><dc:creator>Derik Whittaker</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/derik_whittaker/rsscomments.aspx?PostID=70012</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/derik_whittaker/commentapi.aspx?PostID=70012</wfw:comment><comments>http://devlicio.us/blogs/derik_whittaker/archive/2012/06/26/creating-an-istoragefile-out-of-a-local-resource-in-winrt-c.aspx#comments</comments><description>&lt;p&gt;When working with a C#/XAML WinRT application it is common that you will include resources such as images, files, audio recordings, etc inside your deployment package.&amp;#160; It will also be common that you may want to access these resources as native storage files in order to do things like share them between applications.&amp;#160; Accessing these files is actually pretty easy and is only about 3 lines of code.&lt;/p&gt;  &lt;p&gt;Before we get started assume that we have a directory structure inside our application as follows&lt;/p&gt;  &lt;p&gt;root/Images/Image1.png    &lt;br /&gt;root/Images/Image2.png     &lt;br /&gt;root/Images/Image3.png     &lt;br /&gt;root/Images/Image4.png&lt;/p&gt;  &lt;p&gt;When accessing our local files we will first want get the StorageFolder of the InstalledLocation of our package.&amp;#160; This can be done as follows&lt;/p&gt;  &lt;p&gt;&lt;em&gt;var packageLocation = Windows.ApplicationModel.Package.Current.InstalledLocation;&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;Now that we have the StorageFolder (packageLocation) we want we can get the “Images” folder as follows&lt;/p&gt;  &lt;p&gt;&lt;em&gt;var imagesFolder = await packageLocation.GetFolderAsync(&amp;quot;Images&amp;quot;);&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;Once we have our images folder it is simple as asking for the given file as follows&lt;/p&gt;  &lt;p&gt;var image = await imagesFolder.GetFileAsync(“Image1.png”);&lt;/p&gt;  &lt;p&gt;Now that we have our Image we also have our IStorageFile.&amp;#160; This allows us to pass this file to another application via the Share Contract, or to create a stream reference out of via the RandomAccessStreamReference.CreateFromFile(image) method.&lt;/p&gt;  &lt;p&gt;Here is all the code in one block&lt;/p&gt;  &lt;p&gt;&lt;em&gt;var packageLocation = Windows.ApplicationModel.Package.Current.InstalledLocation;      &lt;br /&gt;&lt;em&gt;var imagesFolder = await packageLocation.GetFolderAsync(&amp;quot;Images&amp;quot;);        &lt;br /&gt;var image = await imagesFolder.GetFileAsync(“Image1.png”);&lt;/em&gt;&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;&lt;em&gt;&lt;em&gt;// if you want the file as a stream (say to put into a Bitmap control        &lt;br /&gt;var imageStreamRef = RandomAccessStreamReference.CreateFromFile(image);&lt;/em&gt;&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;As you can see from above, this is pretty easy as well as pretty powerful.&lt;/p&gt;  &lt;p&gt;Till next time&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=70012" width="1" height="1"&gt;</description><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/HowTo/default.aspx">HowTo</category><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/WinRT/default.aspx">WinRT</category><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/Metro/default.aspx">Metro</category></item><item><title>Parsing Twitter Date format to .Net DateTime</title><link>http://devlicio.us/blogs/derik_whittaker/archive/2012/05/24/parsing-twitter-date-format-to-net-datetime.aspx</link><pubDate>Thu, 24 May 2012 12:53:17 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:69758</guid><dc:creator>Derik Whittaker</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/derik_whittaker/rsscomments.aspx?PostID=69758</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/derik_whittaker/commentapi.aspx?PostID=69758</wfw:comment><comments>http://devlicio.us/blogs/derik_whittaker/archive/2012/05/24/parsing-twitter-date-format-to-net-datetime.aspx#comments</comments><description>&lt;p&gt;Recently when I needed to parse the twitter datetime format into a .Net DateTime I found this &lt;a href="http://blog.tacticalnuclearstrike.com/2009/05/twitter-date-parsing-in-c/"&gt;post&lt;/a&gt; on the web showing how to do it.&amp;#160; However, the format string in the post is setup for non-us format so I thought I would share how to do it for US formatted datetime.&lt;/p&gt;  &lt;pre class="c#" name="code"&gt;const string format = &amp;quot;ddd MMMM dd HH:mm:ss zzzz yyyy&amp;quot;;

var d = DateTime.ParseExact(&amp;quot;Thu May 24 11:43:52 +0000 2012&amp;quot;, format, System.Globalization.CultureInfo.InvariantCulture)
&lt;/pre&gt;

&lt;p&gt;Hope this helps.&lt;/p&gt;

&lt;p&gt;Till next time,&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=69758" width="1" height="1"&gt;</description><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/.Net/default.aspx">.Net</category><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/HowTo/default.aspx">HowTo</category></item><item><title>Entity Framework Error–New Transaction is not allowed because there are other threads running in the session</title><link>http://devlicio.us/blogs/derik_whittaker/archive/2011/12/13/entity-framework-error-new-transaction-is-not-allowed-because-there-are-other-threads-running-in-the-session.aspx</link><pubDate>Wed, 14 Dec 2011 01:13:39 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:68829</guid><dc:creator>Derik Whittaker</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/derik_whittaker/rsscomments.aspx?PostID=68829</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/derik_whittaker/commentapi.aspx?PostID=68829</wfw:comment><comments>http://devlicio.us/blogs/derik_whittaker/archive/2011/12/13/entity-framework-error-new-transaction-is-not-allowed-because-there-are-other-threads-running-in-the-session.aspx#comments</comments><description>&lt;p&gt;Recently when I was working with Entity Framework inside one of our RIA Services end points I ran into the errors below while trying to save my changes.&amp;#160; Of course at first this error caused me to stop and scratch my head&lt;/p&gt;  &lt;p&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_34B1086B.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://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_thumb_5F00_7AC1C57E.png" width="364" height="220" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_204B42E0.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://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_thumb_5F00_7FC4032D.png" width="364" height="50" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;To give a bit of background on what I was doing.&amp;#160; Inside one of our RIA calls (Off Topic, not a big fan of RIA but this is not the time or the place) we were doing a bit of background processing.&amp;#160; In this background processing we needed to query the database for some data (as seen below), update the data and then save the data.&amp;#160; However, when I called ObjectContext.SubmitChanges() I would get the error above.&amp;#160; what was really odd was that I was saving on the EXACT same ObjectContext instance as the instance the data was queried from so I was a bit stumped.&lt;/p&gt;  &lt;p&gt;Here is the original code which was causing the problems&lt;/p&gt;  &lt;pre&gt;var socialLinks = ObjectContext.SocialMediaLinks.Where( x =&amp;gt; x.ClientID == clientId )&lt;/pre&gt;

&lt;p&gt;As you can see from the line above the code appears to be pretty harmless.&amp;#160; I am simply reaching into my ObjectContext and grabbing all the items which match for a given client.&amp;#160; Later on in the code I am doing a ForEach loop over the list and changing various values based on rules.&amp;#160; However, it is this code which is causing me errors when I try to save. &lt;/p&gt;

&lt;p&gt;After a bit of searching and staring it finally occurred to me what the issue was.&amp;#160; Because I had never actually ‘completed’ my query the original transaction was still opened and when I called save it was trying to create and use another transaction.&lt;/p&gt;

&lt;p&gt;To get around this issue (there may be better ways and if so please let me know) I changed my code to be the code you see below.&lt;/p&gt;

&lt;pre&gt;var socialLinks = ObjectContext.SocialMediaLinks.Where( x =&amp;gt; x.ClientID == clientId ).ToList()&lt;/pre&gt;

&lt;p&gt;By adding the .ToList() to my query I am forcing the fetch to take place at one time, thus closing the underlying transaction to the database.&amp;#160; Now when I saved the data (I literally did not change another line of code) everything worked just fine.&lt;/p&gt;

&lt;p&gt;If you find your self in this situation make sure you have actually finished executing your EF queries before you save your changes.&amp;#160; BTW this is done inherently when going across the wire which is why I have never seen this before.&lt;/p&gt;

&lt;p&gt;Till next time,&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=68829" width="1" height="1"&gt;</description><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/Development/default.aspx">Development</category><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/Development+Tools/default.aspx">Development Tools</category><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/HowTo/default.aspx">HowTo</category><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/RIA+Services/default.aspx">RIA Services</category></item><item><title>Using MVVM with the AutoCompleteTextBox in Silverlight 4</title><link>http://devlicio.us/blogs/derik_whittaker/archive/2011/11/18/using-mvvm-with-the-autocompletetextbox-in-silverlight-4.aspx</link><pubDate>Fri, 18 Nov 2011 22:25:00 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:68404</guid><dc:creator>Derik Whittaker</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/derik_whittaker/rsscomments.aspx?PostID=68404</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/derik_whittaker/commentapi.aspx?PostID=68404</wfw:comment><comments>http://devlicio.us/blogs/derik_whittaker/archive/2011/11/18/using-mvvm-with-the-autocompletetextbox-in-silverlight-4.aspx#comments</comments><description>&lt;p&gt;The AutoCompleteTextBox is a great tool in Silverlight to allow you to provide relevant information to your users as they are typing as seen below:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_4B1A6A5F.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" alt="image" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_thumb_5F00_4AAE376A.png" height="165" width="364" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;But there are a few issues with this control&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Pretty much every sample on the net uses the code behind to do the heavy lifting and not binding &lt;/li&gt;
&lt;li&gt;It will not update the VM text box in real time, which is needed if you want to do on the fly filtering &lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;In this post I will walk you though how to setup your AutoCompleteText&amp;nbsp; box and we will learn how to do 3 things&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Use MVVM to populate and use the control &lt;/li&gt;
&lt;li&gt;Use a custom Behavior to allow the property backing the control to be updated in real time &lt;/li&gt;
&lt;li&gt;Use a command to trigger background searches on the fly &lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;b&gt;Using MVVM to populate your control:&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;In order to populate your AutoCompleteTextBox you will need to bind something to the ItemSource property of the control as such:&lt;/p&gt;
&lt;p&gt;&lt;i&gt;ItemsSource=&amp;quot;{Binding KeywordSearchSource}&amp;quot;&lt;/i&gt;&lt;/p&gt;
&lt;p&gt;I am sure you are wondering what the KeywordSearchSource is?&amp;nbsp; Well it is simple a property which returns a IEnumerable&amp;lt;string&amp;gt;&lt;/p&gt;
&lt;pre class="c#" name="code"&gt;       public IEnumerable KeywordSearchSource
        {
            get
            {
                return SomeListOfValues.Select( x =&amp;gt; x.TextValue );
            }
        }&lt;/pre&gt;
&lt;p&gt;The next thing you will want to do is setup a property in your view to handle the current value inside the control.&amp;nbsp; This is needed because we are binding and not using the code behind.&amp;nbsp; You can do this as below:&lt;/p&gt;
&lt;p&gt;&lt;i&gt;Text=&amp;quot;{Binding KeywordSearchText, Mode=TwoWay}&amp;quot;&lt;/i&gt;&lt;/p&gt;
&lt;p&gt;The trick to above is to remember to mark this as being TwoWay or you will not get the results you are expecting&lt;/p&gt;
&lt;pre class="c#" name="code"&gt;        private string _keywordSearchText;
        public string KeywordSearchText
        {
            get { return _keywordSearchText; }
            set 
            {
                _keywordSearchText = value; 

                NotifyOfPropertyChange(() =&amp;gt; KeywordSearchText); 
            }
        }&lt;/pre&gt;
&lt;p&gt;That does it for the MVVM portion of the setup.&amp;nbsp; However, you may already know that when binding to a text box the actual binding does not trigger until AFTER the user leaves the control, in many cases this is good but not in our case.&amp;nbsp; In our case I want to start the filter process as the user types (which is fine as I have all the filter data local, this is NOT fine if I have to do any type of remote call to filter the data as this will cause a bad user experience).&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Triggering the binding in real time:&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;As I stated above the binding of a text box (or autocomplete text box) does not fire until you leave the control and this is not the desired action for us.&amp;nbsp; In order to get around this we are going to create a custom behavior to allow the text box binding to push the value into our property in real time.&lt;/p&gt;
&lt;p&gt;Our custom behavior is going to be called the ImmediateUpdateBehavior and the code can be found below.&lt;/p&gt;
&lt;pre class="c#" name="code"&gt;    public class ImmediateUpdateBehavior : Behavior
    {
        protected override void OnAttached()
        {
            AssociatedObject.TextChanged += OnTextChanged;
        }

        void OnTextChanged(object sender, RoutedEventArgs e)
        {
            AssociatedObject.GetBindingExpression(AutoCompleteBox.TextProperty).UpdateSource();
        }

        protected override void OnDetaching()
        {
            AssociatedObject.TextChanged -= OnTextChanged;
        }
    }&lt;/pre&gt;
&lt;p&gt;In the behavior above you can see that all we are pretty much doing is listing for the TextChanged event and forcing the binding to fire.&amp;nbsp; This is a nice way to do it when developing with MVVM.&lt;/p&gt;
&lt;p&gt;Once we have our behavior created we need to attach it to our AutoCompleteTextBox and that can be found below.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_2307BB40.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" alt="image" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_thumb_5F00_7BCD720A.png" height="73" width="324" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Triggering the filtering to fire as we type:&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;I am going to chose to do this via a Command.&amp;nbsp; I guess you could have the changing value of the property do the same thing but I typically am against doing this as I feel it is hiding the implementation details of the filtering.&amp;nbsp; I also feel that this can cause unwanted side effects in your code if you are not careful.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;In order to use the command I am going to use the EventTrigger behavior in silverlight to call my command.&amp;nbsp; You can see this XAML below.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_09338511.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" alt="image" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_thumb_5F00_28E25ED9.png" height="98" width="644" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;In the XAML above you see I am calling the KeywordSearchFilterCommand.&amp;nbsp; This command will end up calling the code below&lt;/p&gt;
&lt;pre class="c#" name="code"&gt;        private void KeywordSearchFilter()
        {
	    // Key here is i am simply notifying to rebuind these values and allowing the underlying methods to filter the data
            NotifyOfPropertyChange(() =&amp;gt; SomeListOfValues);
            NotifyOfPropertyChange(() =&amp;gt; PagedSomeListOfValues);
        }&lt;/pre&gt;
&lt;p&gt;As you can see from the above I am not doing anything special in the filter method I am simply notifying of property change and letting the various properties doing their own filtering.&amp;nbsp; The code below is the filtering for my PagedSomeListOfValues property (we are doing client side paging here)&lt;/p&gt;
&lt;pre class="c#" name="code"&gt;        public ObservableCollection PagedSomeListOfValues
        {
            get
            {
                var skipCount = PageIndex &amp;gt; 0 ? PageIndex * PageSize : 0;
                var takeCount = PageSize;
                var tempItems= SomeListOfValues.Skip(skipCount).Take(takeCount).ToList();

                var observableLinks = new ObservableCollection();
                observableLinks.SetContents(tempItems);

                return observableLinks;
            }
        }&lt;/pre&gt;
&lt;p&gt;Once you have your 2 properties (list and search field) bound to the AutoCompleteTextBox you are almost there, but not quite.&amp;nbsp; In order to make this fully work you will want to also you the custom behavior and the filter command.&lt;/p&gt;
&lt;p&gt;Hope this helps.&lt;/p&gt;
&lt;p&gt;Till next time,&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=68404" width="1" height="1"&gt;</description><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/HowTo/default.aspx">HowTo</category><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/Silverlight/default.aspx">Silverlight</category></item><item><title>Help, my MVC Ajax requests are not rendering and there is no exception being displayed</title><link>http://devlicio.us/blogs/derik_whittaker/archive/2011/10/10/help-my-mvc-ajax-requests-are-not-rendering-and-there-is-no-exception-being-displayed.aspx</link><pubDate>Mon, 10 Oct 2011 22:38:27 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:68276</guid><dc:creator>Derik Whittaker</dc:creator><slash:comments>3</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/derik_whittaker/rsscomments.aspx?PostID=68276</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/derik_whittaker/commentapi.aspx?PostID=68276</wfw:comment><comments>http://devlicio.us/blogs/derik_whittaker/archive/2011/10/10/help-my-mvc-ajax-requests-are-not-rendering-and-there-is-no-exception-being-displayed.aspx#comments</comments><description>&lt;p&gt;***** If there is any type of built in MVC support for helping find these issues please let me know *****&lt;/p&gt;  &lt;p&gt;Ok, this may be common sense to everyone else on the net and if so… Oh Well.&lt;/p&gt;  &lt;p&gt;Tonight I was working on the MVC3 rewrite of the &lt;a href="http://www.dimecasts.net"&gt;Dimecasts.net&lt;/a&gt; website and after a bit of refactoring my search feature was not working….Well it was hitting the controller action just fine and returning the data out of the controller with NO issues.&amp;#160; However my search result div was not being updated dated correctly. &lt;/p&gt;  &lt;p&gt;Fortunately for me I just happened to already have Fiddler up and running so I simply popped over to see what it had to say.&amp;#160; I immediately noticed that Fiddler was giving me a 500 error on my controller action result:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_4D74BB81.png"&gt;&lt;img style="background-image:none;border-bottom:0px;border-left:0px;padding-left:0px;padding-right:0px;display:inline;border-top:0px;border-right:0px;padding-top:0px;" title="image" border="0" alt="image" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_thumb_5F00_583212D6.png" width="644" height="32" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;When I took a look at the response output I noticed the following:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_1EAF02DF.png"&gt;&lt;img style="background-image:none;border-bottom:0px;border-left:0px;padding-left:0px;padding-right:0px;display:inline;border-top:0px;border-right:0px;padding-top:0px;" title="image" border="0" alt="image" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_thumb_5F00_6BDEFC6A.png" width="759" height="243" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;In case you cannot read the above let me summarize for you.&amp;#160; Basically I had changed the response object I was returned back out of my controller but I did not change my partial view.&lt;/p&gt;  &lt;p&gt;Once I changed my partial view to expect the correct data type as the result model everything was right as rain.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;The moral of the story is 2 things&lt;/strong&gt;&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Fiddler is your friend and WILL help you debug and diagnosis any errors you may have when doing anything http related&lt;/li&gt;    &lt;li&gt;When doing some refactoring remember to make the correct changes to your razor views or you may not get the results you expected.&lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;Till next time,&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=68276" width="1" height="1"&gt;</description><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/asp.net/default.aspx">asp.net</category><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/HowTo/default.aspx">HowTo</category><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/ASP.Net+MVC/default.aspx">ASP.Net MVC</category></item><item><title>How to setup a clean error message when your Metro Application does not support Data Sharing</title><link>http://devlicio.us/blogs/derik_whittaker/archive/2011/10/09/how-to-setup-a-clean-error-message-when-your-metro-application-does-not-support-data-sharing.aspx</link><pubDate>Sun, 09 Oct 2011 11:54:00 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:68259</guid><dc:creator>Derik Whittaker</dc:creator><slash:comments>4</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/derik_whittaker/rsscomments.aspx?PostID=68259</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/derik_whittaker/commentapi.aspx?PostID=68259</wfw:comment><comments>http://devlicio.us/blogs/derik_whittaker/archive/2011/10/09/how-to-setup-a-clean-error-message-when-your-metro-application-does-not-support-data-sharing.aspx#comments</comments><description>&lt;p&gt;When building a WinRT/Metro application one of the key integration points between your application and others is to allow Data Sharing via the Sharing Contracts.&amp;nbsp; By default applications DO NOT support sharing and when a user taps on the Share Charm they will see an error similar to the following.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_4427342B.png"&gt;&lt;img title="image" style="border-top:0px;border-right:0px;background-image:none;border-bottom:0px;padding-top:0px;padding-left:0px;margin:0px;border-left:0px;display:inline;padding-right:0px;" alt="image" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_thumb_5F00_11C360AC.png" border="0" height="223" width="244" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;This message is NOT that user friendly and should be avoided.&amp;nbsp; Besides what good does a screenshot of your application really do anyone &lt;img class="wlEmoticon wlEmoticon-smile" style="border-top-style:none;border-bottom-style:none;border-right-style:none;border-left-style:none;" alt="Smile" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/wlEmoticon_2D00_smile_5F00_1F2973B2.png" /&gt;.&lt;/p&gt;
&lt;p&gt;If you are explicitly not going to support sharing from a given view in your application you should provide the user a little better message telling them this, fortunately setting this up is a piece of cake.&lt;/p&gt;
&lt;p&gt;To setup this clean user friendly message we simply need to do 3 things&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Grab the DataTransfer Context for the current view&lt;/li&gt;
&lt;/ol&gt;
&lt;blockquote&gt;
&lt;p&gt;Add the following using clause : using Windows.ApplicationModel.DataTransfer&lt;/p&gt;
&lt;p&gt;Grab the context as : var dtm = DataTransferManager.GetForCurrentView();&lt;/p&gt;
&lt;/blockquote&gt;
&lt;ol&gt;
&lt;li&gt;Setup the event to handle the DataRequested event&lt;/li&gt;
&lt;/ol&gt;
&lt;blockquote&gt;
&lt;p&gt;Wire up the DataRequested event as: dtm.DataRequested += OnDataRequested;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;ol&gt;
&lt;li&gt;Populate the failure message in the Share Panel with our user friendly message&lt;/li&gt;
&lt;/ol&gt;
&lt;blockquote&gt;
&lt;p&gt;Inside your event handler do the following:     &lt;br /&gt;args.Request.FailWithDisplayText( &amp;quot;Data Sharing Not Supported at this time&amp;quot; );&lt;/p&gt;
&lt;p&gt;The args object is of course the EventArgs which is passed into your event handler.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;One thing to pay attention to is that the amount of text which can be displayed is very short.&amp;nbsp; If you provide a value which is too long the value will be truncated and the &amp;hellip; will be appended to the end.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Now that we have enabled our view to display a friendly error message when someone tries to invoke the share we should see something like the following;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_33AEC330.png"&gt;&lt;img title="image" style="border-top:0px;border-right:0px;background-image:none;border-bottom:0px;padding-top:0px;padding-left:0px;margin:0px;border-left:0px;display:inline;padding-right:0px;" alt="image" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_thumb_5F00_535D9CF8.png" border="0" height="151" width="244" /&gt;&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;(please not the &amp;hellip; added to the message.&amp;nbsp; This is what I was referring to above when I said it will truncate long messages)&lt;/p&gt;
&lt;p&gt;Till next time,&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=68259" width="1" height="1"&gt;</description><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/HowTo/default.aspx">HowTo</category><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/XAML/default.aspx">XAML</category><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/WinRT/default.aspx">WinRT</category><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/Metro/default.aspx">Metro</category></item></channel></rss>