<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://www.alexthissen.nl/utility/FeedStylesheets/atom.xsl" media="screen"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en"><title type="html">Alex Thissen Weblog Build 1.15.10.1971</title><subtitle type="html">Disassembling my brain</subtitle><id>http://www.alexthissen.nl/blogs/main/atom.aspx</id><link rel="alternate" type="text/html" href="http://www.alexthissen.nl/blogs/main/default.aspx" /><link rel="self" type="application/atom+xml" href="http://www.alexthissen.nl/blogs/main/atom.aspx" /><generator uri="http://communityserver.org" version="4.1.31106.3070">Community Server</generator><updated>2009-08-20T23:20:36Z</updated><entry><title>Revelations on Windows 8</title><link rel="alternate" type="text/html" href="/blogs/main/archive/2011/09/14/revelations-on-windows-8.aspx" /><id>/blogs/main/archive/2011/09/14/revelations-on-windows-8.aspx</id><published>2011-09-14T18:32:13Z</published><updated>2011-09-14T18:32:13Z</updated><content type="html">&lt;p&gt;Today the //BUILD/Windows conference started with a day full of main sessions. A two and a half hour keynote followed by three “Big Picture” sessions after lunch introduced all present to the new Windows 8 OS and platform. Personally, I am still catching my breath over the amazing amount of information that was given to us. Lots of people have asked me since then what I thought of the first day. I have told them: “Fantastic”. Here’s why, in my words and with a personal interpretation of the information that is available to everyone.&lt;/p&gt;  &lt;h3&gt;Merging the web with Windows&lt;/h3&gt;  &lt;p&gt;What I saw Microsoft present today is the new vision for the Windows 8 operating system. Windows 8 merges with the web in terms of devices and applications. It also brings together all your devices and makes them a mesh that is constantly in sync with one another. This mainly goes for data, be it application data, application settings or identities. The Cloud (Windows Live in particular, complemented by Windows Azure) acts as the conduit to flow and store information across devices and online storage. &lt;/p&gt;  &lt;h3&gt;Web of applications&lt;/h3&gt;  &lt;p&gt;Equally important is the fact that all applications are not only interconnected with the OS and the cloud, but also with one another. Searching and exchanging data has become a smooth continuum across OS and applications alike. I like to think of it as a new opportunity to create Windows-based mashups, just like it has become common place for Web 2.0 applications. This style of creating applications will now come to native Windows applications. The possibilities will be endless. All you need to do is reimagine your apps, just like Microsoft has reimagined Windows.&lt;/p&gt;  &lt;h3&gt;A new family of applications&lt;/h3&gt;  &lt;p&gt;Windows 8 distinguishes two types of applications: Desktop apps and Metro style apps. The Desktop apps are best described as the applications that will run on earlier versions of Windows (7, Vista, …). The Desktop can be built using the well known variety of APIs, ranging from native Win32 in C/C++, to .NET or Silverlight with C# or VB and HTML with JavaScript for Internet Explorer hosted web applications. Metro style applications are easily identified from their styling. Behind that new appearance there is a whole new stack of frameworks and APIs to build and run applications. The Metro applications can interconnect with each other and the OS. There is deep integration through the new API.&lt;/p&gt;  &lt;h3&gt;&lt;a href="http://www.alexthissen.nl/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/main/IMAG2035_5F00_084BB6D8.jpg"&gt;&lt;img style="background-image:none;border-bottom:0px;border-left:0px;margin:0px 10px 0px 0px;padding-left:0px;padding-right:0px;display:inline;border-top:0px;border-right:0px;padding-top:0px;" title="IMAG2035" border="0" alt="IMAG2035" src="http://www.alexthissen.nl/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/main/IMAG2035_5F00_thumb_5F00_4F052A15.jpg" width="640" height="383" /&gt;&lt;/a&gt;&lt;/h3&gt;  &lt;h3&gt;Metro, great for users and developers&lt;/h3&gt;  &lt;p&gt;Metro applications use a new application model at system service level. This is the layer that runs on top of the Windows kernel. The application model also represents the way a Metro application lives in its eco-system, hooks into the operating system with its own execution environment and how it is packaged and deployed. On top of the app model you can build Metro apps with three new APIs: Data and Communication, Graphics and Media, Devices and Printers. You can choose from any kind programming interface, just like with the Desktop apps, boiling down to C++, managed languages and JavaScript. The first two use XAML to create the view layer. XAML has become a native part of the operating system.&lt;/p&gt;  &lt;p&gt;Whether you are going for the XAML or HTML5 approach, Metro apps have the same distinct look and feel, backed up with styling guidelines. The Visual Studio 2011 development environment embraces Metro and offers a whole slew of templates to facilitate in creating the right Metro views for your app.&lt;/p&gt;  &lt;p&gt;The Metro style will help users get a consistent feel across devices (desktop PC, tablet or phone) and form factors (small, medium, large). Whether they pick up a phone with WP7.5 or a tablet with Windows 8, it all looks and feels the same. For now, Metro style applications are built targeted at either Windows 8 or Phone 7.5&lt;/p&gt;  &lt;h3&gt;Opportunities for everyone&lt;/h3&gt;  &lt;p&gt;With all of this come great opportunities for everyone: users, designers, developers, architects and business, you name it. Since this is a developer conference, I would like to point out that the next couple of years will be very, very interesting for developers. The shift in programming paradigm from rich-client, high-end client applications to interconnected, cloud- and os-integrated applications are a new ball-game and a game changer to boot. This will give lots of change, chance and learning for all to enjoy. &lt;/p&gt;  &lt;h3&gt;The extra gift&lt;/h3&gt;  &lt;p&gt;As if all of this goodness and announcements weren’t enough there was the unexpected gift. Secretly anticipated and living up to speculation all attendees of //BUILD/Windows were giving a new Developer Preview Tablet: a Samsung tablet with amazing specs. The line for picking it up was unbelievable. I chose to wait until tomorrow to pick it up. I still need to do so. Everybody is excited about it. Check the specs to see why.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.alexthissen.nl/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/main/image_5F00_13D14E4A.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://www.alexthissen.nl/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/main/image_5F00_thumb_5F00_7B318B2C.png" width="244" height="160" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.alexthissen.nl/aggbug.aspx?PostID=22586" width="1" height="1"&gt;</content><author><name>alexthissen</name><uri>http://www.alexthissen.nl/members/alexthissen/default.aspx</uri></author><category term="Conferences" scheme="http://www.alexthissen.nl/blogs/main/archive/tags/Conferences/default.aspx" /><category term="Windows OS" scheme="http://www.alexthissen.nl/blogs/main/archive/tags/Windows+OS/default.aspx" /></entry><entry><title>Getting ready to unwrap the big picture at BUILD</title><link rel="alternate" type="text/html" href="/blogs/main/archive/2011/09/13/getting-ready-to-unwrap-the-big-picture-at-build.aspx" /><id>/blogs/main/archive/2011/09/13/getting-ready-to-unwrap-the-big-picture-at-build.aspx</id><published>2011-09-13T05:47:11Z</published><updated>2011-09-13T05:47:11Z</updated><content type="html">&lt;p&gt;&lt;a href="http://www.alexthissen.nl/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/main/IMAG2029_5F00_6CBD8A95.jpg"&gt;&lt;img style="background-image:none;border-right-width:0px;margin:0px 10px 0px 0px;padding-left:0px;padding-right:0px;display:inline;float:left;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;padding-top:0px;" title="IMAG2029" border="0" alt="IMAG2029" align="left" src="http://www.alexthissen.nl/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/main/IMAG2029_5F00_thumb_5F00_576F3953.jpg" width="190" height="114" /&gt;&lt;/a&gt;Tomorrow is the first day of the //BUILD/Windows conference. BUILD is a highly anticipated conference and expectations are equally high. I thought it would be good to put some of my thoughts on my blog before the conference actually started. You see, BUILD is special in a way that most conference of the past years have not been: we know nothing about the announcements. Sure, there will most likely be information on Windows 8, HTML 5 and JavaScript, the developer roadmap and so on. But then again, this is only high over. Nobody knows anything about what will be announced, not even the average Microsoft employee. &lt;/p&gt;  &lt;p&gt;The almost complete silence and accompanying secrecy is not what we have seen in the past couple of years. Microsoft has always been very open in its directions. The product teams have engaged with the community early on and gotten feedback from the developers, architects and so on. Now, we have heard nothing up front. And this leads to a lot of speculation, criticism, fear and doubt. People complain about this approach. Apple and Google have been working this way for a long time now. The big announcements and revelations are made on an important conference. So, how bad is it that Microsoft has taken the same path?&lt;/p&gt;  &lt;p&gt;Taking a step back I feel spoiled. All these years we have had the luxury of knowing all upfront. It is like Christmas time (or Sinterklaas if you are Dutch), where you sent out a wish list to Santa Claus. Santa would tell you exactly what you would get. The unwrapping of the presents was fun to do, but there were hardly any surprises. This time is different. Tomorrow we will be given a lot of presents and we do not know what is in the boxes. Everyone will be thrilled to receive the gifts and find out what is inside. Best of all, there might even be presents that we hadn’t wished for. I am enjoying every moment of it. Because once the unwrapping is done, the nervousness and anxiety goes away and is replaced with the fun of playing with the new stuff. Still good, but different. Who knows how long it will be before we will have the experience of not knowing again?&lt;/p&gt;  &lt;p&gt;The registration today went very smooth. It was not busy (yet). The self-service terminals made it easy to register. The badge, wristband (for the party on Wednesday) and booklet were all the things we got. There were no details on the sessions, other than that the first day will be general sessions only. These general sessions are called “Big picture” in the booklet. Sort of indicates what we will getting from those. The breakout sessions are from Wednesday till Friday. It will be four fantastic days without a doubt. I am looking forward to it! &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;a href="http://www.alexthissen.nl/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/main/IMAG2030_5F00_114E5673.jpg"&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="IMAG2030" border="0" alt="IMAG2030" src="http://www.alexthissen.nl/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/main/IMAG2030_5F00_thumb_5F00_5D55EEBA.jpg" width="415" height="249" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.alexthissen.nl/aggbug.aspx?PostID=22585" width="1" height="1"&gt;</content><author><name>alexthissen</name><uri>http://www.alexthissen.nl/members/alexthissen/default.aspx</uri></author><category term="Conferences" scheme="http://www.alexthissen.nl/blogs/main/archive/tags/Conferences/default.aspx" /><category term="Windows OS" scheme="http://www.alexthissen.nl/blogs/main/archive/tags/Windows+OS/default.aspx" /></entry><entry><title>Using WCF and WIF to perform WS-Trust active claim requests</title><link rel="alternate" type="text/html" href="/blogs/main/archive/2011/07/18/using-active-profile-for.aspx" /><id>/blogs/main/archive/2011/07/18/using-active-profile-for.aspx</id><published>2011-07-18T14:07:39Z</published><updated>2011-07-18T14:07:39Z</updated><content type="html">&lt;p&gt;The last week I have been working on a claim-based identity scenario that involves two separate instances of a Active Directory Federation Services (ADFS) 2.0 as Security Token Service (STS). The first STS is an identity provider STS (IP-STS) and the second a resource STS (R-STS) . The R-STS and IP-STS have a trust relationship in that the IP-STS is a trusted identity provider to the R-STS. Typically this setup is used with the passive profile for federation from browser clients. The web application (SharePoint 2010 for our scenario) would require authentication, redirect to the R-STS, which in turn would redirected (after IP selection) to the IP-STS. Here the end-user will authenticate, gets a identity claims from the IP-STS and is redirected back to the R-STS. The resource STS can augment claims from information stored in AD Lightweight Directory Services (AD-LDS) and issue the final claim token to the passively federated web application.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.alexthissen.nl/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/main/image_5F00_18889F28.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://www.alexthissen.nl/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/main/image_5F00_thumb_5F00_4609BEEB.png" width="567" height="366" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;In our case we have a SharePoint 2007 application, which does not have its own STS to initiate the entire process. Also, business requirements demand that &lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;the user interface is completely controlled &lt;/li&gt;    &lt;li&gt;no redirects to other pages during authentication &lt;/li&gt;    &lt;li&gt;authentication takes place from within a certain screen flow &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;These requirements made us investigate the active profile flow for the setup. In an active profile flow you will use the web services of ADFS 2.0 to communicate directly to the STS instances. You can use either the WS-Trust or WS-Federation protocol depending on your requirements. WS-Federation allows you to call the R-STS directly with the retrieval of the IP-STS claim performed under the covers. WS-Trust is used for the individuals steps. You can also leverage WS-Trust to take full control of the individual steps. To get acquainted with the entire active scenario we chose to the latter approach. Windows Communication Foundation (WCF) and Windows Identity Foundation (WIF) provide ready-to-use channels for the WS-Trust protocol and WS-Federation protocol. The scenario will take several steps:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Acquire an identity claim from the IP-STS by using username/password authentication to authenticate. &lt;/li&gt;    &lt;li&gt;The IP-STS will issue a claim token regarding our identity, sign and encrypt it and send it back to us. &lt;/li&gt;    &lt;li&gt;Use the claim token from the IP-STS to authenticate against the R-STS and request a new claim token with additional claims from AD-LDS. &lt;/li&gt;    &lt;li&gt;The R-STS will also issue the (augmented) claim, sign and (optionally) encrypt it and send it. &lt;/li&gt;    &lt;li&gt;We need to decrypt the token, check its signature and issuer and convert the claim token to a principal object. &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;Note that we made some design choices, such as using username/password to authenticate against the IP-STS. You could make similar or different choices depending on your particular scenario.&lt;/p&gt;  &lt;h3&gt;Step 1: Acquiring an identity claims from an active STS&lt;/h3&gt;  &lt;p&gt;The first part of the process is the acquisition of a claim token from the IP-STS. We need one of the specialized WCF binding for a WS-Trust channel. Because we are using username and password to authenticate, this comes down to UserNameWSTrustBinding. We want to use transport security (an HTTPS connection) with credentials inside of the message (because Message security would mean that we need encryption and certificate exchange for this part). The endpoint at ADFS is &lt;a href="https://identityadfs.company.com/services/trust/2005/usernamemixed"&gt;https://identityadfs.company.com/services/trust/2005/usernamemixed&lt;/a&gt; to reflect our choices. The 2005 endpoint will use the newer WS-Trust 1.3 specification (as opposed to the February 2005 one).&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.alexthissen.nl/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/main/image_5F00_4C509579.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://www.alexthissen.nl/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/main/image_5F00_thumb_5F00_1024C9D1.png" width="640" height="211" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;pre style="background:white;"&gt;&lt;font size="2"&gt;&lt;font face="Consolas"&gt;&lt;span&gt;&lt;font color="#0000ff"&gt;var&lt;/font&gt;&lt;/span&gt; binding = &lt;span&gt;&lt;font color="#0000ff"&gt;new&lt;/font&gt;&lt;/span&gt;&amp;#160;&lt;span&gt;&lt;font color="#2b91af"&gt;UserNameWSTrustBinding&lt;/font&gt;&lt;/span&gt;(&lt;span&gt;&lt;font color="#2b91af"&gt;SecurityMode&lt;/font&gt;&lt;/span&gt;.TransportWithMessageCredential);
&lt;span&gt;&lt;font color="#0000ff"&gt;var&lt;/font&gt;&lt;/span&gt; factory = &lt;span&gt;&lt;font color="#0000ff"&gt;new&lt;/font&gt;&lt;/span&gt;&amp;#160;&lt;span&gt;&lt;font color="#2b91af"&gt;WSTrustChannelFactory&lt;/font&gt;&lt;/span&gt;(binding, &lt;/font&gt;&lt;font face="Consolas"&gt;&lt;span&gt;&lt;font color="#a31515"&gt;&amp;quot;https://identityadfs.company.com/adfs/services/trust/13/usernamemixed&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;)
  {
    TrustVersion = &lt;span&gt;&lt;font color="#2b91af"&gt;TrustVersion&lt;/font&gt;&lt;/span&gt;.WSTrustFeb2005,
  };
 
factory.Credentials.UserName.UserName = &lt;span&gt;&lt;font color="#a31515"&gt;@&amp;quot;youraccount&amp;quot;&lt;/font&gt;&lt;/span&gt;;
factory.Credentials.UserName.Password = &lt;span&gt;&lt;font color="#a31515"&gt;@&amp;quot;abc123!&amp;quot;&lt;/font&gt;&lt;/span&gt;;
factory.ConfigureChannelFactory();&lt;/font&gt;
&lt;/font&gt;&lt;/pre&gt;

&lt;p&gt;We now have a configured channel factory to create an actual WS-Trust channel. Across that channel we want to send a Request Security Token (RST) message. &lt;/p&gt;

&lt;pre style="background:white;"&gt;&lt;font size="2"&gt;&lt;font face="Consolas"&gt;&lt;span&gt;&lt;font color="#0000ff"&gt;var&lt;/font&gt;&lt;/span&gt; rst = &lt;span&gt;&lt;font color="#0000ff"&gt;new&lt;/font&gt;&lt;/span&gt;&amp;#160;&lt;span&gt;&lt;font color="#2b91af"&gt;RequestSecurityToken&lt;/font&gt;&lt;/span&gt;
  {
    RequestType = &lt;span&gt;&lt;font color="#2b91af"&gt;WSTrust13Constants&lt;/font&gt;&lt;/span&gt;.&lt;span&gt;&lt;font color="#2b91af"&gt;RequestTypes&lt;/font&gt;&lt;/span&gt;.Issue,
    AppliesTo = &lt;span&gt;&lt;font color="#0000ff"&gt;new&lt;/font&gt;&lt;/span&gt;&amp;#160;&lt;span&gt;&lt;font color="#2b91af"&gt;EndpointAddress&lt;/font&gt;&lt;/span&gt;(&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;span&gt;&lt;font color="#a31515"&gt;&lt;a href="http://resourceadfs.company.com/adfs/services/trust"&gt;http://resourceadfs.company.com/adfs/services/trust&lt;/a&gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2" face="Consolas"&gt;),
    KeyType = &lt;span&gt;&lt;font color="#2b91af"&gt;WSTrust13Constants&lt;/font&gt;&lt;/span&gt;.&lt;span&gt;&lt;font color="#2b91af"&gt;KeyTypes&lt;/font&gt;&lt;/span&gt;.Symmetric
  };&lt;/font&gt;&lt;/pre&gt;

&lt;pre style="background:white;"&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;span&gt;&lt;font color="#0000ff"&gt;var&lt;/font&gt;&lt;/span&gt; channel = factory.CreateChannel();
&lt;span&gt;&lt;font color="#0000ff"&gt;return&lt;/font&gt;&lt;/span&gt; channel.Issue(rst);&lt;/font&gt;&lt;/font&gt;&lt;/pre&gt;

&lt;p&gt;As you can see this RST message indicates an issue request for the audience “http://sourceadfs.company.com/adfs/services/trust/active”, which is the identifier of the relying party (the IP-STS) administration in the R-STS . In other words: a identity claim token intended to be shown to the R-STS. &lt;/p&gt;

&lt;p&gt;We also ask the IP-STS issuer to encrypt the claim token with a symmetric key. You will see why this is in a moment. In other situations you could have asked for a Bearer (unecnrypted) key type token, which would have allowed you to inspect the token.&lt;/p&gt;

&lt;h3&gt;Step 2: Issue token from IP-STS&lt;/h3&gt;

&lt;p&gt;The IP-STS will accept and validate our credentials against the Active Directory Domain Services identity store. When successfully authenticated, ADFS will use its claim rules to extract information from ADDS and build a claim token with the indicated claims. Next it will encrypt this claim token using a certificate with a public key. This public key belongs to a public/private key pair that the R-STS holds. The IP-STS can encrypt the token, where only the R-STS can decrypt it using its private key.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://www.alexthissen.nl/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/main/image_5F00_2B5D22D2.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://www.alexthissen.nl/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/main/image_5F00_thumb_5F00_4B0BFC9A.png" width="640" height="211" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;Step 3: Use claim token to authenticate and request augmented claim token&lt;/h3&gt;

&lt;p&gt;Now, we can use the issued identity claim token to authenticate against the R-STS. We will again use a WS-Trust channel, but now with issued token authentication.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://www.alexthissen.nl/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/main/image_5F00_2A1889F3.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://www.alexthissen.nl/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/main/image_5F00_thumb_5F00_30CB9376.png" width="640" height="175" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;pre style="background:white;"&gt;&lt;font size="2"&gt;&lt;font face="Consolas"&gt;&lt;span&gt;&lt;font color="#0000ff"&gt;var&lt;/font&gt;&lt;/span&gt; binding = &lt;span&gt;&lt;font color="#0000ff"&gt;new&lt;/font&gt;&lt;/span&gt;&amp;#160;&lt;span&gt;&lt;font color="#2b91af"&gt;IssuedTokenWSTrustBinding&lt;/font&gt;&lt;/span&gt;();
binding.SecurityMode = &lt;span&gt;&lt;font color="#2b91af"&gt;SecurityMode&lt;/font&gt;&lt;/span&gt;.TransportWithMessageCredential;
binding.KeyType = &lt;span&gt;&lt;font color="#2b91af"&gt;SecurityKeyType&lt;/font&gt;&lt;/span&gt;.SymmetricKey;
 
&lt;span&gt;&lt;font color="#0000ff"&gt;var&lt;/font&gt;&lt;/span&gt; factory = &lt;span&gt;&lt;font color="#0000ff"&gt;new&lt;/font&gt;&lt;/span&gt;&amp;#160;&lt;span&gt;&lt;font color="#2b91af"&gt;WSTrustChannelFactory&lt;/font&gt;&lt;/span&gt;(binding, &lt;br /&gt;  &lt;/font&gt;&lt;font face="Consolas"&gt;&lt;span&gt;&lt;font color="#a31515"&gt;&amp;quot;https://resourceadfs.company.com/adfs/services/trust/13/issuedtokenmixedsymmetricbasic256&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;);
factory.TrustVersion = &lt;span&gt;&lt;font color="#2b91af"&gt;TrustVersion&lt;/font&gt;&lt;/span&gt;.WSTrust13;
factory.Credentials.SupportInteractive = &lt;span&gt;&lt;font color="#0000ff"&gt;false&lt;/font&gt;&lt;/span&gt;;&lt;br /&gt;factory.ConfigureChannelFactory();&lt;/font&gt; &lt;/font&gt;&lt;/pre&gt;

&lt;p&gt;&lt;font style="font-size:12pt;"&gt;The configuration of the channel factory is similar to the first step. The key differences are that we now have an IssuedTokenWSTrustBinding and a symmetric key for the issued token. The reason for choosing the symmetric encrypted request in the first step is that the R-STS does not accept Bearer key tokens for authentication. They have to be (a)symmetrically signed for the R-STS to use them as an authentication means. Also, we suppress the Interactive support (meaning InfoCard c.q. CardSpace UI), as we are initiating a service request (hence, no user is available).&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;font size="3"&gt;Next, we create another RST message and send it out to the R-STS.&lt;/font&gt;&lt;/p&gt;

&lt;pre style="background:white;"&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;span&gt;&lt;font color="#0000ff"&gt;var&lt;/font&gt;&lt;/span&gt; rst = &lt;span&gt;&lt;font color="#0000ff"&gt;new&lt;/font&gt;&lt;/span&gt;&amp;#160;&lt;span&gt;&lt;font color="#2b91af"&gt;RequestSecurityToken&lt;/font&gt;&lt;/span&gt;
  {
    RequestType = &lt;span&gt;&lt;font color="#2b91af"&gt;RequestTypes&lt;/font&gt;&lt;/span&gt;.Issue,
    AppliesTo = &lt;span&gt;&lt;font color="#0000ff"&gt;new&lt;/font&gt;&lt;/span&gt;&amp;#160;&lt;span&gt;&lt;font color="#2b91af"&gt;EndpointAddress&lt;/font&gt;&lt;/span&gt;(&lt;font face="Consolas"&gt;&lt;span&gt;&lt;font color="#a31515"&gt;&amp;quot;http://sp2007webapp.company.com&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;),
    KeyType = &lt;span&gt;&lt;font color="#2b91af"&gt;KeyTypes&lt;/font&gt;&lt;/span&gt;.Bearer
  };&amp;#160;&amp;#160; &lt;span&gt;&lt;font color="#0000ff"&gt;var&lt;/font&gt;&lt;/span&gt; channel = factory.CreateChannelWithIssuedToken(token);
&lt;span&gt;&lt;font color="#0000ff"&gt;return&lt;/font&gt;&lt;/span&gt; channel.Issue(rst);&lt;/font&gt;&lt;/font&gt;&lt;/pre&gt;

&lt;p&gt;The RST now indicates an audience for the SharePoint 2007 application. Its key type can be Bearer or (A)Symmetric, depending on how you want the token to be transferred. Should you choose the Symmetric or Asymmetric key type, you will need to install a server certificate on the web application’s IIS server, extract the public key and install it on the R-STS server as the encryption certificate for the relying party (i.e. the SharePoint app) trust.&lt;/p&gt;

&lt;p&gt;Finally, using an extension method from WIF we create a channel from the factory that can convey the token as an authentication means. Lastly, we send out the RST message and return the token to the caller after step 4 has completed.&lt;/p&gt;

&lt;h3&gt;Step 4: Issuing an augmented claim&lt;/h3&gt;

&lt;p&gt;Once the issued token arrives at the R-STS, ADFS will decrypt the token using its public/private keypair. If it is a valid token, the R-STS will believe its trusted IP-STS that the credentials originally provided where correct. According to the configured claim rules the R-STS will create new and/or additional claims (called claim augmentation) to the new claim token. It will include the audience, sign it, encrypt it if you indicated so in the RST, and send out the RST response (RSTR).&lt;/p&gt;

&lt;p&gt;&lt;a href="http://www.alexthissen.nl/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/main/image_5F00_104453C4.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://www.alexthissen.nl/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/main/image_5F00_thumb_5F00_61EACE16.png" width="640" height="160" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;Step 5: Check claim token and create principal&lt;/h3&gt;

&lt;p&gt;The last step is back on the SharePoint application. &lt;/p&gt;

&lt;pre style="background:white;"&gt;&lt;font face="Consolas"&gt;&lt;span&gt;&lt;font color="#2b91af" size="2"&gt;GenericXmlSecurityToken&lt;/font&gt;&lt;/span&gt;&lt;font size="2"&gt; augmentedToken = AugmentClaims(issuedToken);
&lt;span&gt;&lt;font color="#0000ff"&gt;var&lt;/font&gt;&lt;/span&gt; tokenReader = &lt;span&gt;&lt;font color="#0000ff"&gt;new&lt;/font&gt;&lt;/span&gt;&amp;#160;&lt;span&gt;&lt;font color="#2b91af"&gt;StringReader&lt;/font&gt;&lt;/span&gt;(augmentedToken.TokenXml.OuterXml);
&lt;span&gt;&lt;font color="#0000ff"&gt;var&lt;/font&gt;&lt;/span&gt; reader = &lt;span&gt;&lt;font color="#2b91af"&gt;XmlReader&lt;/font&gt;&lt;/span&gt;.Create(tokenReader);&lt;/font&gt;
&lt;/font&gt;&lt;/pre&gt;

&lt;p&gt;The issuedToken variable contains the token received from step 1 and 2. The AugmentClaims method is the implementation shown in step 3. When the R-STS returns the augmented claim, it will surface as a GenericXmlSecurityToken. We set up an XmlReader to start reading the token.&lt;/p&gt;

&lt;p&gt;Remember that to read the token we need to decrypt it, check its signature, audience and issuer. This checking is taken care of by a set of token handlers&lt;/p&gt;

&lt;pre style="background:white;"&gt;&lt;font face="Consolas"&gt;&lt;span&gt;&lt;font color="#2b91af" size="2"&gt;SecurityTokenHandlerCollection&lt;/font&gt;&lt;/span&gt;&lt;font size="2"&gt; handlers = &lt;br /&gt;  &lt;span&gt;&lt;font color="#2b91af"&gt;SecurityTokenHandlerCollection&lt;/font&gt;&lt;/span&gt;.CreateDefaultSecurityTokenHandlerCollection();&lt;/font&gt;
&lt;/font&gt;&lt;/pre&gt;

&lt;p&gt;The default security handlers are some eight handlers for various types of tokens. They all use the configuration defined at the SecurityTokenHandlerCollection. First, we will add our public/private keypair as the certificate that the token resolver should use for decryption. The SecurityTokenResolver will use the thumbprint as a reference to the certificate &lt;/p&gt;

&lt;pre style="background:white;"&gt;&lt;font face="Consolas"&gt;&lt;span&gt;&lt;font color="#2b91af" size="2"&gt;X509Store&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:12pt;" size="2"&gt;&lt;font size="2"&gt; store = &lt;span&gt;&lt;font color="#0000ff"&gt;new&lt;/font&gt;&lt;/span&gt;&amp;#160;&lt;span&gt;&lt;font color="#2b91af"&gt;X509Store&lt;/font&gt;&lt;/span&gt;(&lt;span&gt;&lt;font color="#2b91af"&gt;StoreName&lt;/font&gt;&lt;/span&gt;.My, &lt;span&gt;&lt;font color="#2b91af"&gt;StoreLocation&lt;/font&gt;&lt;/span&gt;.LocalMachine);
store.Open(&lt;span&gt;&lt;font color="#2b91af"&gt;OpenFlags&lt;/font&gt;&lt;/span&gt;.ReadOnly);
&lt;span&gt;&lt;font color="#2b91af"&gt;X509Certificate2Collection&lt;/font&gt;&lt;/span&gt; certificates = store.Certificates;
&lt;span&gt;&lt;font color="#2b91af"&gt;X509Certificate2&lt;/font&gt;&lt;/span&gt; certificate = certificates.Find(&lt;br /&gt;  &lt;span&gt;&lt;font color="#2b91af"&gt;X509FindType&lt;/font&gt;&lt;/span&gt;.FindByThumbprint, &lt;br /&gt;  &lt;span&gt;&lt;font color="#a31515"&gt;&amp;quot;&lt;em&gt;ThumbprintForWebAppPubPrivCertificateAllCapitals&lt;/em&gt;&amp;quot;&lt;/font&gt;&lt;/span&gt;, &lt;span&gt;&lt;font color="#0000ff"&gt;true&lt;/font&gt;&lt;/span&gt;)[0];&lt;/font&gt;
&lt;font size="2"&gt; 
&lt;span&gt;&lt;font color="#2b91af"&gt;List&lt;/font&gt;&lt;/span&gt;&amp;lt;&lt;span&gt;&lt;font color="#2b91af"&gt;SecurityToken&lt;/font&gt;&lt;/span&gt;&amp;gt; serviceTokens = &lt;span&gt;&lt;font color="#0000ff"&gt;new&lt;/font&gt;&lt;/span&gt;&amp;#160;&lt;span&gt;&lt;font color="#2b91af"&gt;List&lt;/font&gt;&lt;/span&gt;&amp;lt;&lt;span&gt;&lt;font color="#2b91af"&gt;SecurityToken&lt;/font&gt;&lt;/span&gt;&amp;gt;();
serviceTokens.Add(&lt;span&gt;&lt;font color="#0000ff"&gt;new&lt;/font&gt;&lt;/span&gt;&amp;#160;&lt;span&gt;&lt;font color="#2b91af"&gt;X509SecurityToken&lt;/font&gt;&lt;/span&gt;(certificate));
&lt;span&gt;&lt;font color="#2b91af"&gt;SecurityTokenResolver&lt;/font&gt;&lt;/span&gt; serviceResolver = &lt;br /&gt;  &lt;span&gt;&lt;font color="#2b91af"&gt;SecurityTokenResolver&lt;/font&gt;&lt;/span&gt;.CreateDefaultSecurityTokenResolver(&lt;br /&gt;  serviceTokens.AsReadOnly(), &lt;span&gt;&lt;font color="#0000ff"&gt;false&lt;/font&gt;&lt;/span&gt;);
handlers.Configuration.ServiceTokenResolver = serviceResolver;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/pre&gt;

&lt;p&gt;You will only need the code fragment for the token resolver above if you indicated an encrypted token. We did not, so these 8 lines of code are not necessary.&lt;/p&gt;

&lt;p&gt;Next, we will add a certificate store for the issuer resolution. The token handlers will look up the issuer’s certificate thumbprint in the Personal certificates store of Local machine (not a user’s store).&lt;/p&gt;

&lt;pre style="background:white;"&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;span&gt;&lt;font color="#2b91af"&gt;SecurityTokenHandlerCollection&lt;/font&gt;&lt;/span&gt; handlers = &lt;br /&gt;  &lt;span&gt;&lt;font color="#2b91af"&gt;SecurityTokenHandlerCollection&lt;/font&gt;&lt;/span&gt;.CreateDefaultSecurityTokenHandlerCollection();&lt;br /&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;span&gt;&lt;font color="#2b91af"&gt;X509CertificateStoreTokenResolver&lt;/font&gt;&lt;/span&gt; certificateStoreIssuerResolver = &lt;br /&gt;  &lt;span&gt;&lt;font color="#0000ff"&gt;new&lt;/font&gt;&lt;/span&gt;&amp;#160;&lt;span&gt;&lt;font color="#2b91af"&gt;X509CertificateStoreTokenResolver&lt;/font&gt;&lt;/span&gt;(&lt;span&gt;&lt;font color="#2b91af"&gt;StoreName&lt;/font&gt;&lt;/span&gt;.My, &lt;span&gt;&lt;font color="#2b91af"&gt;StoreLocation&lt;/font&gt;&lt;/span&gt;.LocalMachine);&lt;br /&gt;handlers.Configuration.IssuerTokenResolver = certificateStoreIssuerResolver;&lt;/font&gt;&lt;/font&gt;&lt;/pre&gt;

&lt;pre style="background:white;"&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;span&gt;&lt;font color="#0000ff"&gt;var&lt;/font&gt;&lt;/span&gt; registry = &lt;span&gt;&lt;font color="#0000ff"&gt;new&lt;/font&gt;&lt;/span&gt;&amp;#160;&lt;span&gt;&lt;font color="#2b91af"&gt;ConfigurationBasedIssuerNameRegistry&lt;/font&gt;&lt;/span&gt;();
registry.AddTrustedIssuer(&lt;span&gt;&lt;font color="#a31515"&gt;&amp;quot;&lt;em&gt;ThumbPrintForResourceADFSPubSigningAllCapitals&lt;/em&gt;&amp;quot;&lt;/font&gt;&lt;/span&gt;, &lt;br /&gt;  &lt;span&gt;&lt;font color="#a31515"&gt;&lt;a href="http://resourceadfs.company.com/adfs/services/trust"&gt;http://resourceadfs.company.com/adfs/services/trust&lt;/a&gt;&lt;/font&gt;&lt;/span&gt;);&lt;/font&gt;&lt;/font&gt;&lt;/pre&gt;

&lt;pre style="background:white;"&gt;&lt;font size="2"&gt;&lt;font face="Consolas"&gt;handlers.Configuration.IssuerNameRegistry = registry;&lt;br /&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;handlers.Configuration.AudienceRestriction.AllowedAudienceUris.&lt;br /&gt;  Add(&lt;span&gt;&lt;font color="#0000ff"&gt;new&lt;/font&gt;&lt;/span&gt; &lt;span&gt;&lt;font color="#2b91af"&gt;Uri&lt;/font&gt;&lt;/span&gt;(&lt;span&gt;&lt;font color="#a31515"&gt;&lt;a href="http://sp2007webapp.company.com"&gt;http://sp2007webapp.company.com&lt;/a&gt;&lt;/font&gt;&lt;/span&gt;));&lt;/font&gt;&lt;/font&gt;&lt;/pre&gt;

&lt;p&gt;With all this setup, all that remains it to actually read (decrypt) the token and to check its signature, issuer and audience. The set of identities that is included will contain 1 IClaimsIdentity derived object containing our identity with corresponding claims.&lt;/p&gt;

&lt;p&gt;&lt;font size="2"&gt;&lt;font face="Consolas"&gt;&lt;span&gt;&lt;font color="#0000ff"&gt;var&lt;/font&gt;&lt;/span&gt; samlToken = handlers.ReadToken(reader); 

      &lt;br /&gt;&lt;font face="Consolas"&gt;&lt;span&gt;&lt;font color="#2b91af"&gt;IClaimsIdentity &lt;/font&gt;&lt;/span&gt;&lt;/font&gt;identity = handlers.ValidateToken(samlToken)[0];&lt;/font&gt; &lt;/font&gt;&lt;/p&gt;

&lt;h2&gt;All done&lt;/h2&gt;

&lt;p&gt;At this point we have a ClaimsIdentity that we can use to construct a claim principal and start reading claims for authorization inside our application. You might want to have the claims principal set to the current thread Thread.CurrentPrincipal and the HTTP context via HttpContext.Current.User. Inside the identity you can see the initial authentication type (username/password in our case) and for each claim the issuer (R-STS) and the original issuer (IP-STS, only when you passed through the original IP-STS claim as a R-STS claim).&lt;/p&gt;

&lt;p&gt;All steps assume a happy flow, but you will need to include the usual exception handling for Timeout-, Communication-, ObjectDisposedException and other exceptions that may occur.&lt;/p&gt;

&lt;p&gt;Hope this helps.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.alexthissen.nl/aggbug.aspx?PostID=22580" width="1" height="1"&gt;</content><author><name>alexthissen</name><uri>http://www.alexthissen.nl/members/alexthissen/default.aspx</uri></author><category term="Security" scheme="http://www.alexthissen.nl/blogs/main/archive/tags/Security/default.aspx" /><category term="WCF" scheme="http://www.alexthissen.nl/blogs/main/archive/tags/WCF/default.aspx" /><category term="ADFS" scheme="http://www.alexthissen.nl/blogs/main/archive/tags/ADFS/default.aspx" /></entry><entry><title>Portable Libraries for Visual Studio 2010 SP1</title><link rel="alternate" type="text/html" href="/blogs/main/archive/2011/07/07/portable-libraries-for-visual-studio-2010-sp1.aspx" /><id>/blogs/main/archive/2011/07/07/portable-libraries-for-visual-studio-2010-sp1.aspx</id><published>2011-07-07T21:47:03Z</published><updated>2011-07-07T21:47:03Z</updated><content type="html">&lt;p&gt;The Microsoft &lt;a href="http://blogs.msdn.com/b/bclteam/" target="_blank"&gt;BCL team&lt;/a&gt; recently released the RTM version of &lt;a href="http://msdn.microsoft.com/en-us/library/gg597391.aspx" target="_blank"&gt;Portable Libraries&lt;/a&gt; (PL). This &lt;a href="http://visualstudiogallery.msdn.microsoft.com/b0e0b5e9-e138-410b-ad10-00cb3caf4981" target="_blank"&gt;PowerTool&lt;/a&gt; for Visual Studio 2010 SP1 allow you to develop managed assemblies for more than one target .NET framework. It will let you aim your code at both the full .NET Framework, Silverlight, Silverlight for Windows Phone 7 and/or Xbox 360. By using the Portable Libraries you can control which targets you are aiming for and compile a single assembly that will work on all targets you selected.&lt;/p&gt; &lt;p&gt;The Portable Libraries has features that are close to, yet different from another piece of functionality in Visual Studio: multitargeting. It is similar in that it will help you find the allowed subset of functionality in the .NET Framework given the combination of targets you select. It is different, because it will let you have a single project where you would normally have multiple projects for class libraries targeting .NET FX (versions 2.0 to 4.0, with full or client profile) and Silverlight. For Xbox 360 you have the Xbox 360 Game Library which comes close, but is a different thing altogether. PL projects are class libraries which can host reusable managed code over all of the previously mentioned.&lt;/p&gt; &lt;p&gt;You can install the tooling for PL from &lt;a href="http://visualstudiogallery.msdn.microsoft.com/b0e0b5e9-e138-410b-ad10-00cb3caf4981" target="_blank"&gt;here&lt;/a&gt;. Once you have done that, a new library project is available:&lt;/p&gt; &lt;p&gt;&lt;a href="http://www.alexthissen.nl/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/main/image_5F00_7B364EAA.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://www.alexthissen.nl/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/main/image_5F00_thumb_5F00_48664836.png" width="640" height="211" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;A Portable Library project has its own project template. The main difference from a regular class library is in the AssemblyInfo.cs file. The contents are trimmed, because ComVisibleAttribute and GuidAttribute do not make sense for Silverlight and Xbox and are not allowed. The other difference is an extra tab on the Project Properties page. It allows you to specify the targets for your library.&lt;/p&gt; &lt;p&gt;&lt;a href="http://www.alexthissen.nl/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/main/image_5F00_07C3FBC7.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://www.alexthissen.nl/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/main/image_5F00_thumb_5F00_596A7619.png" width="640" height="314" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;In the screenshot below you can see a Class Library project converted to a Portable Library. The references to assemblies that are not part of the allowed assemblies for the targets are indicated with exclamation marks, just as when you had selected a not allowed assembly for the .NET Target Framework in a normal Class Library.&lt;br /&gt;&lt;a href="http://www.alexthissen.nl/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/main/image_5F00_38770372.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://www.alexthissen.nl/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/main/image_5F00_thumb_5F00_4CFC52F0.png" width="384" height="482" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;The Portable Libraries have a different build target, which further distinguishes them from regular class libraries.&lt;/p&gt; &lt;p&gt;The allowed set of assemblies is listed &lt;a href="http://msdn.microsoft.com/en-us/library/gg597391.aspx" target="_blank"&gt;here&lt;/a&gt;, but to give you an idea, it is limited:&lt;/p&gt; &lt;ul&gt; &lt;li&gt; &lt;p&gt;&lt;strong&gt;mscorlib.dll&lt;/strong&gt;&lt;/p&gt; &lt;li&gt; &lt;p&gt;&lt;strong&gt;System.dll&lt;/strong&gt;&lt;/p&gt; &lt;li&gt; &lt;p&gt;&lt;strong&gt;System.Core.dll&lt;/strong&gt;&lt;/p&gt; &lt;li&gt; &lt;p&gt;System.Xml.dll&lt;/p&gt; &lt;li&gt; &lt;p&gt;&lt;em&gt;System.ComponentModel.Composition.dll&lt;/em&gt; (MEF)&lt;/p&gt; &lt;li&gt; &lt;p&gt;System.Net.dll&lt;/p&gt; &lt;li&gt; &lt;p&gt;System.Runtime.Serialization.dll&lt;/p&gt; &lt;li&gt; &lt;p&gt;System.ServiceModel.dll&lt;/p&gt; &lt;li&gt; &lt;p&gt;System.Xml.Serialization.dll&lt;/p&gt; &lt;li&gt; &lt;p&gt;System.Windows.dll (from Silverlight)&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;This set is the largest possible if you are only targeting .NET Framework 4. For Silverlight and Phone 7 you cannot use MEF (System.ComponentModel.Composition), and for Xbox 360 you can &lt;u&gt;only&lt;/u&gt; use the bold assemblies.&lt;/p&gt; &lt;p&gt;The use of the Portable Class Library project will pay of in finding which classes you can use and which not. If you are in doubt, you can check the MSDN documentation and make sure. Here is an example for the System.Runtime.InteropServices.StructLayoutAttribute class:&lt;/p&gt; &lt;p&gt;&lt;a href="http://www.alexthissen.nl/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/main/image_5F00_1EA2CD43.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://www.alexthissen.nl/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/main/image_5F00_thumb_5F00_4570E383.png" width="273" height="284" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;In the type’s members you can see whether a particular member is supported (when the type itself is):&lt;/p&gt; &lt;p&gt;&lt;a href="http://www.alexthissen.nl/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/main/image_5F00_053ACA09.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://www.alexthissen.nl/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/main/image_5F00_thumb_5F00_5E0080D3.png" width="383" height="168" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;The small project icon in the left column means it is supported.&lt;/p&gt; &lt;h2&gt;An example scenario&lt;/h2&gt; &lt;p&gt;Let’s say you have a piece of C# code that can be reused in an application or game for Windows, Phone and Xbox 360. Normally (without Portable Libraries), you would need to set up several projects:&lt;/p&gt; &lt;p&gt;&lt;a href="http://www.alexthissen.nl/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/main/image_5F00_6FDD14A0.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://www.alexthissen.nl/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/main/image_5F00_thumb_5F00_5D944DDE.png" width="257" height="371" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;Each of the ReusableGameCore libraries contain the same code, but have a different target. They are referenced by the corresponding game (or application) version for Windows, Phone and Xbox. &lt;/p&gt; &lt;p&gt;You need to do so, because the build target need to be different for the various consumers of your reusable code. For example, referencing a normal Class Library project in an XNA Game Studio 4.0 project for Xbox 360 will get you compile errors. It will complain about the “wrong” target framework being selected, even though you have changed it to .NET 4 Client Profile (or something else). &lt;/p&gt; &lt;p&gt;As you can see in the screenshot the code in the Silverlight and Xbox360 library projects is linked from the Windows version. You will only have one version of the code, but having three project is not ideal.&lt;/p&gt; &lt;p&gt;The alternative is offered by Portable Libraries. In that case the three libraries can be combined into a single one. Your solution will look like this:&lt;/p&gt; &lt;p&gt;&lt;a href="http://www.alexthissen.nl/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/main/image_5F00_4F55D4EE.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://www.alexthissen.nl/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/main/image_5F00_thumb_5F00_0F1FBB74.png" width="257" height="224" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;The three other projects each reference the single portable class library. Quicker to set up and easier to maintain. Moreover, you can install additional frameworks, which allows you to target other or more from the same library.&lt;/p&gt; &lt;h2&gt;Converting a Class Library to a Portable Class Library&lt;/h2&gt; &lt;p&gt;It could very well be that you have a Visual Studio solution that holds class libraries which you would like to be Portable. One option is to create a new Portable Library project and transfer the files from the class library to the new Portable project. This should be the normal way to go. I tried whether it is possible to convert the class library project into a portable one. Turns out that it can be done. Here’s how:&lt;/p&gt; &lt;ol&gt; &lt;li&gt;Unload the Class Library project. Right-click the project and select Unload Project from the context menu to do so.  &lt;li&gt;Edit the .csproj or .vbproj file. Pick the option from the context menu.  &lt;li&gt;Add the following fragment to the first &amp;lt;PropertyGroup&amp;gt; under the &amp;lt;Project&amp;gt; root element:&lt;br /&gt;&lt;br /&gt;C#:&lt;pre style="background:white;"&gt;&lt;font face="Consolas"&gt;&lt;span&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size:12pt;"&gt;&amp;lt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:12pt;"&gt;&lt;span&gt;&lt;font color="#a31515"&gt;ProjectTypeGuids&lt;/font&gt;&lt;/span&gt;&lt;span&gt;&lt;font color="#0000ff"&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}&lt;span&gt;&lt;font color="#0000ff"&gt;&amp;lt;/&lt;/font&gt;&lt;/span&gt;&lt;span&gt;&lt;font color="#a31515"&gt;ProjectTypeGuids&lt;/font&gt;&lt;/span&gt;&lt;span&gt;&lt;font color="#0000ff"&gt;&amp;gt;&lt;br /&gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;span&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size:12pt;"&gt;&amp;lt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:12pt;"&gt;&lt;span&gt;&lt;font color="#a31515"&gt;TargetFrameworkProfile&lt;/font&gt;&lt;/span&gt;&lt;span&gt;&lt;font color="#0000ff"&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;Profile1&lt;span&gt;&lt;font color="#0000ff"&gt;&amp;lt;/&lt;/font&gt;&lt;/span&gt;&lt;span&gt;&lt;font color="#a31515"&gt;TargetFrameworkProfile&lt;/font&gt;&lt;/span&gt;&lt;span&gt;&lt;font color="#0000ff"&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/pre&gt;&lt;pre style="list-style-type:disc;background:white;"&gt;&lt;font face="Calibri"&gt;Visual Basic:&lt;/font&gt;&lt;/pre&gt;&lt;pre style="list-style-type:disc;background:white;"&gt;&lt;font face="Consolas"&gt;&lt;span&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size:12pt;"&gt;&amp;lt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:12pt;"&gt;&lt;span&gt;&lt;font color="#a31515"&gt;ProjectTypeGuids&lt;/font&gt;&lt;/span&gt;&lt;span&gt;&lt;font color="#0000ff"&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;{14182A97-F7F0-4C62-8B27-98AA8AE2109A};{F184B08F-C81C-45F6-A57F-5ABD9991F28F}&lt;span&gt;&lt;font color="#0000ff"&gt;&amp;lt;/&lt;/font&gt;&lt;/span&gt;&lt;span&gt;&lt;font color="#a31515"&gt;ProjectTypeGuids&lt;/font&gt;&lt;/span&gt;&lt;span&gt;&lt;font color="#0000ff"&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;
&lt;span&gt;&lt;font color="#0000ff"&gt;&amp;lt;&lt;/font&gt;&lt;/span&gt;&lt;span&gt;&lt;font color="#a31515"&gt;TargetFrameworkProfile&lt;/font&gt;&lt;/span&gt;&lt;span&gt;&lt;font color="#0000ff"&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;Profile2&lt;span&gt;&lt;font color="#0000ff"&gt;&amp;lt;/&lt;/font&gt;&lt;/span&gt;&lt;span&gt;&lt;font color="#a31515"&gt;TargetFrameworkProfile&lt;/font&gt;&lt;/span&gt;&lt;span&gt;&lt;font color="#0000ff"&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size:12pt;"&gt;&lt;span&gt;&lt;font color="#0000ff"&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;
&lt;li&gt;Remove the &amp;lt;ProductVersion&amp;gt; and &amp;lt;SchemaVersion elements:&lt;br /&gt;&lt;br /&gt;&lt;font face="Consolas"&gt;&lt;span&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size:12pt;"&gt;&amp;lt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:12pt;"&gt;&lt;span&gt;&lt;font color="#a31515"&gt;ProductVersion&lt;/font&gt;&lt;/span&gt;&lt;span&gt;&lt;font color="#0000ff"&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;8.0.30703&lt;span&gt;&lt;font color="#0000ff"&gt;&amp;lt;/&lt;/font&gt;&lt;/span&gt;&lt;span&gt;&lt;font color="#a31515"&gt;ProductVersion&lt;/font&gt;&lt;/span&gt;&lt;span&gt;&lt;font color="#0000ff"&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&lt;font color="#0000ff"&gt;&amp;lt;&lt;/font&gt;&lt;/span&gt;&lt;span&gt;&lt;font color="#a31515"&gt;SchemaVersion&lt;/font&gt;&lt;/span&gt;&lt;span&gt;&lt;font color="#0000ff"&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;2.0&lt;span&gt;&lt;font color="#0000ff"&gt;&amp;lt;/&lt;/font&gt;&lt;/span&gt;&lt;span&gt;&lt;font color="#a31515"&gt;SchemaVersion&lt;/font&gt;&lt;/span&gt;&lt;span&gt;&lt;font color="#0000ff"&gt;&amp;gt;&lt;br /&gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;
&lt;li&gt;Change the &amp;lt;Import&amp;gt; element just before the closing tag of the &amp;lt;Project&amp;gt; element to the . &lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size:12pt;"&gt;&lt;span&gt;&lt;font color="#000000" face="Calibri"&gt;In C# replace&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;pre style="list-style-type:disc;background:white;"&gt;&lt;font face="Consolas"&gt;&lt;span&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size:12pt;"&gt;&amp;lt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:12pt;"&gt;&lt;span&gt;&lt;font color="#a31515"&gt;Import&lt;/font&gt;&lt;/span&gt;&lt;span&gt;&lt;font color="#0000ff"&gt;&amp;nbsp;&lt;/font&gt;&lt;/span&gt;&lt;span&gt;&lt;font color="#ff0000"&gt;Project&lt;/font&gt;&lt;/span&gt;&lt;span&gt;&lt;font color="#0000ff"&gt;=&lt;/font&gt;&lt;/span&gt;&amp;quot;&lt;span&gt;&lt;font color="#0000ff"&gt;$(MSBuildToolsPath)\Microsoft.CSharp.targets&lt;/font&gt;&lt;/span&gt;&amp;quot;&lt;span&gt;&lt;font color="#0000ff"&gt; /&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/pre&gt;&lt;pre style="list-style-type:disc;background:white;"&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size:12pt;"&gt;&lt;span&gt;&lt;font color="#000000" face="Calibri"&gt;with&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/pre&gt;&lt;pre style="list-style-type:disc;background:white;"&gt;&lt;font face="Consolas"&gt;&lt;span&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size:12pt;"&gt;&amp;lt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:12pt;"&gt;&lt;span&gt;&lt;font color="#a31515"&gt;Import&lt;/font&gt;&lt;/span&gt;&lt;span&gt;&lt;font color="#0000ff"&gt;&amp;nbsp;&lt;/font&gt;&lt;/span&gt;&lt;span&gt;&lt;font color="#ff0000"&gt;Project&lt;/font&gt;&lt;/span&gt;&lt;span&gt;&lt;font color="#0000ff"&gt;=&lt;/font&gt;&lt;/span&gt;&amp;quot;&lt;span&gt;&lt;font color="#0000ff"&gt;$(MSBuildExtensionsPath32)\Microsoft\Portable\$(TargetFrameworkVersion)\Microsoft.Portable.CSharp.targets&lt;/font&gt;&lt;/span&gt;&amp;quot;&lt;span&gt;&lt;font color="#0000ff"&gt; /&amp;gt;&lt;/font&gt;&lt;/span&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size:12pt;"&gt;&lt;span&gt;&lt;font color="#000000" face="Calibri"&gt;In Visual Basic replace&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;pre style="list-style-type:disc;background:white;"&gt;&lt;font face="Consolas"&gt;&lt;span&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size:12pt;"&gt;&amp;lt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:12pt;"&gt;&lt;span&gt;&lt;font color="#a31515"&gt;Import&lt;/font&gt;&lt;/span&gt;&lt;span&gt;&lt;font color="#0000ff"&gt; &lt;/font&gt;&lt;/span&gt;&lt;span&gt;&lt;font color="#ff0000"&gt;Project&lt;/font&gt;&lt;/span&gt;&lt;span&gt;&lt;font color="#0000ff"&gt;=&lt;/font&gt;&lt;/span&gt;&amp;quot;&lt;span&gt;&lt;font color="#0000ff"&gt;$(MSBuildToolsPath)\Microsoft.VisualBasic.targets&lt;/font&gt;&lt;/span&gt;&amp;quot;&lt;span&gt;&lt;font color="#0000ff"&gt; /&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/pre&gt;&lt;pre style="list-style-type:disc;background:white;"&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size:12pt;"&gt;&lt;span&gt;&lt;font color="#000000" face="Calibri"&gt;with&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/pre&gt;&lt;pre style="list-style-type:disc;background:white;"&gt;&lt;font face="Consolas"&gt;&lt;span&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size:12pt;"&gt;&amp;lt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:12pt;"&gt;&lt;span&gt;&lt;font color="#a31515"&gt;Import&lt;/font&gt;&lt;/span&gt;&lt;span&gt;&lt;font color="#0000ff"&gt; &lt;/font&gt;&lt;/span&gt;&lt;span&gt;&lt;font color="#ff0000"&gt;Project&lt;/font&gt;&lt;/span&gt;&lt;span&gt;&lt;font color="#0000ff"&gt;=&lt;/font&gt;&lt;/span&gt;&amp;quot;&lt;span&gt;&lt;font color="#0000ff"&gt;$(MSBuildExtensionsPath32)\Microsoft\Portable\$(TargetFrameworkVersion)\Microsoft.Portable.VisualBasic.targets&lt;/font&gt;&lt;/span&gt;&amp;quot;&lt;span&gt;&lt;font color="#0000ff"&gt; /&amp;gt;&lt;/font&gt;&lt;/span&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/pre&gt;&lt;pre style="list-style-type:disc;background:white;"&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size:12pt;"&gt;&lt;span&gt;&lt;font color="#000000" face="Calibri"&gt;&lt;/pre&gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/li&gt;
&lt;ul&gt;&lt;/ul&gt;&lt;/ul&gt;
&lt;li&gt;Remove the following code from AssemblyInfo.cs (or the equivalent from AssemblyInfo.vb)&lt;/li&gt;&lt;pre style="background:white;"&gt;&lt;font face="Consolas"&gt;&lt;span&gt;&lt;font color="#008000"&gt;&lt;font style="font-size:12pt;"&gt;// Setting ComVisible to false makes the types in this assembly not visible &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:12pt;"&gt;
&lt;span&gt;&lt;font color="#008000"&gt;// to COM components.  If you need to access a type in this assembly from &lt;/font&gt;&lt;/span&gt;
&lt;span&gt;&lt;font color="#008000"&gt;// COM, set the ComVisible attribute to true on that type.&lt;/font&gt;&lt;/span&gt;
[&lt;span&gt;&lt;font color="#0000ff"&gt;assembly&lt;/font&gt;&lt;/span&gt;: ComVisible(&lt;span&gt;&lt;font color="#0000ff"&gt;false&lt;/font&gt;&lt;/span&gt;)]
 
&lt;span&gt;&lt;font color="#008000"&gt;// The following GUID is for the ID of the typelib if this project is exposed to COM&lt;/font&gt;&lt;/span&gt;
[&lt;span&gt;&lt;font color="#0000ff"&gt;assembly&lt;/font&gt;&lt;/span&gt;: Guid(&lt;span&gt;&lt;font color="#a31515"&gt;&amp;quot;1e49a9ca-89db-46d1-9704-b76e10897ffb&amp;quot;&lt;/font&gt;&lt;/span&gt;)]&lt;/font&gt;&lt;/font&gt;&lt;/pre&gt;
&lt;li&gt;Reload the project by right-clicking the project and selecting the menu item&lt;/li&gt;&lt;/ol&gt;
&lt;p&gt;Please note that this is not an official and therefore not supported migration. No guarantees and make sure you have backups, checkins et cetera before you undertake this conversion.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.alexthissen.nl/aggbug.aspx?PostID=22576" width="1" height="1"&gt;</content><author><name>alexthissen</name><uri>http://www.alexthissen.nl/members/alexthissen/default.aspx</uri></author><category term="Gaming" scheme="http://www.alexthissen.nl/blogs/main/archive/tags/Gaming/default.aspx" /><category term="Visual Studio 2010" scheme="http://www.alexthissen.nl/blogs/main/archive/tags/Visual+Studio+2010/default.aspx" /><category term="Windows Phone" scheme="http://www.alexthissen.nl/blogs/main/archive/tags/Windows+Phone/default.aspx" /><category term="Xbox 360" scheme="http://www.alexthissen.nl/blogs/main/archive/tags/Xbox+360/default.aspx" /></entry><entry><title>SDN Event June 2011: ASP.NET Web Pages Framework for ASP.NET developers</title><link rel="alternate" type="text/html" href="/blogs/main/archive/2011/06/20/sdn-event-june-2011-asp-net-web-pages-framework-for-asp-net-developers.aspx" /><id>/blogs/main/archive/2011/06/20/sdn-event-june-2011-asp-net-web-pages-framework-for-asp-net-developers.aspx</id><published>2011-06-20T05:43:22Z</published><updated>2011-06-20T05:43:22Z</updated><content type="html">&lt;p&gt;Last Friday saw another edition of a &lt;a href="http://www.sdn.nl/SDN/" target="_blank"&gt;Software Development Network&lt;/a&gt;&amp;#160;&lt;a href="http://www.sdn.nl/SDN/SDNEvent/Events2011/SDNEventjuni2011/tabid/205/Default.aspx" target="_blank"&gt;Event&lt;/a&gt;. A number of great sessions were on the list. I got to see &lt;a href="http://blogs.infosupport.com/blogs/marcelv/" target="_blank"&gt;Marcel de Vries&lt;/a&gt;’s session on combined development for Windows Phone 7, Android and iOS. I must say I was impressed with the state of tooling for Mono for Android and MonoTouch (for iOS). &lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.alexthissen.nl/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/main/image_5F00_717E0311.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://www.alexthissen.nl/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/main/image_5F00_thumb_5F00_3542119C.png" width="595" height="58" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;My session for the SDN Event was on the ASP.NET Web Pages Framework. In it I show &lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;what this new framework is, &lt;/li&gt;    &lt;li&gt;how it relates to ASP.NET WebForms, MVC and WebMatrix &lt;/li&gt;    &lt;li&gt;how to build applications with it &lt;/li&gt;    &lt;li&gt;introduction to Razor (see also my DevDays 2011 session on “Introduction to Razor” for more information on Razor) &lt;/li&gt;    &lt;li&gt;what the new concepts like “page hierarchies”, UrlData and PageData are &lt;/li&gt;    &lt;li&gt;working with models and model state (and how this is different than the model from MVC) &lt;/li&gt;    &lt;li&gt;automatic routing&lt;/li&gt;    &lt;li&gt;some more&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;If you couldn’t make it, feel free to take a look at the &lt;a href="http://www.alexthissen.nl/media/p/22568.aspx" target="_blank"&gt;slides&lt;/a&gt; and the &lt;a href="http://www.alexthissen.nl/media/p/22569.aspx" target="_blank"&gt;demos&lt;/a&gt;. Thanks everyone who attended the session. Hopefully you found it useful.&lt;/p&gt;  &lt;p&gt;I missed the session of &lt;a href="http://pepijnsitter.wordpress.com/author/pepijnsitter/" target="_blank"&gt;Pepijn Sitter&lt;/a&gt; on XNA Game development for the Windows Phone 7, because he shared the timeslot with my own session. Luckily for me I had a chance to meet him before his session. We had a very enthusiastic talk on games, game development, the fun of it all and his Ms. Pacman implementation with XNA for XBox360 and Windows Phone 7. Brilliant stuff.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.alexthissen.nl/aggbug.aspx?PostID=22570" width="1" height="1"&gt;</content><author><name>alexthissen</name><uri>http://www.alexthissen.nl/members/alexthissen/default.aspx</uri></author></entry><entry><title>Choosing from all the great sessions at the Dutch Developer Days 2011</title><link rel="alternate" type="text/html" href="/blogs/main/archive/2011/04/19/choosing-from-all-the-great-sessions-at-the-dutch-developer-days-2011.aspx" /><id>/blogs/main/archive/2011/04/19/choosing-from-all-the-great-sessions-at-the-dutch-developer-days-2011.aspx</id><published>2011-04-19T05:44:37Z</published><updated>2011-04-19T05:44:37Z</updated><content type="html">&lt;p&gt;The organization of the Microsoft Developer Days has an outstanding reputation for selecting excellent speakers from abroad and both new and well known speakers in The Netherlands. This year I intend to go see more sessions than in previous years. It is hard to choose from all of the sessions that are listed. Instead of randomly picking from that list, I first came up with a strategy to select them. It turned out to be a criteria list that should help prioritize sessions.&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;em&gt;Strategic initiative from Microsoft        &lt;br /&gt;&lt;/em&gt;If there is a session on Windows Azure, Windows Phone or the next version of some product&lt;/li&gt;    &lt;li&gt;&lt;em&gt;Practice over theory        &lt;br /&gt;&lt;/em&gt;I guess that you can go a long way by following the training kits, blogs and documentation on new platforms, frameworks and technologies. The lessons learned by using these in real-life/business scenarios is a lot harder to come by. &lt;/li&gt;    &lt;li&gt;&lt;em&gt;New and broad information over in-depth information (on topics that are known already)        &lt;br /&gt;&lt;/em&gt;Learning new things gets preference over going deeper into topics I already feel comfortable with &lt;/li&gt;    &lt;li&gt;&lt;em&gt;Speaker&amp;#160; reputation&lt;/em&gt;      &lt;br /&gt;Some speakers are a delight to go see. If none of the above make a difference or end in a tie, I will decide based on the speaker. This can be based on entertainment value, technical accuracy or experiences in the past. &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;a href="http://www.alexthissen.nl/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/main/image_5F00_27B03875.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://www.alexthissen.nl/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/main/image_5F00_thumb_5F00_7956B2C7.png" width="690" height="103" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;h2&gt;Developer Days - 1&lt;/h2&gt;  &lt;table border="0" cellspacing="0" cellpadding="2" width="730"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="top" width="127"&gt;9:15 – 10:45&lt;/td&gt;        &lt;td valign="top" width="601"&gt;The easiest timeslot to choose a session: the keynote &lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="127"&gt;11:05 – 12:20&lt;/td&gt;        &lt;td valign="top" width="601"&gt;         &lt;ol&gt;           &lt;li&gt;&lt;a href="http://www.techdays.nl/SessieDetails.aspx?cid=1317"&gt;What&amp;#39;s New in SQL Server &amp;quot;Denali&amp;quot; for Developers?&lt;/a&gt;, Paul van Wingerden.              &lt;br /&gt;New technology and I’m very rusty on the developer side of SQL Server. Catching up required.&lt;/li&gt;            &lt;li&gt;&lt;a href="http://www.techdays.nl/SessieDetails.aspx?cid=1518"&gt;Windows Phone 7 (title to be disclosed after MIX)&lt;/a&gt;, Ben Riga:               &lt;br /&gt;Summary of WP7 as discussed at Mix 2011. Should save a lot of time viewing this session instead of the &lt;a href="http://channel9.msdn.com/Events/MIX/MIX11" target="_blank"&gt;recorded videos at Channel 9&lt;/a&gt;&lt;/li&gt;            &lt;li&gt;&lt;a href="http://www.techdays.nl/SessieDetails.aspx?cid=1513"&gt;MVC 3 – 101&lt;/a&gt;, Scott Hanselman              &lt;br /&gt;Guaranteed fun and overview of MVC3 to boot&lt;/li&gt;         &lt;/ol&gt;       &lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="127"&gt;13:30 – 14:45&lt;/td&gt;        &lt;td valign="top" width="601"&gt;         &lt;ol&gt;           &lt;li&gt;&lt;a href="http://www.techdays.nl/SessieDetails.aspx?cid=1515"&gt;Reactive Extensions for .NET for the Rest of Us&lt;/a&gt;, Mike Taulty              &lt;br /&gt;Mike is an excellent speaker with loads of high-speed demos and more information than a human could handle in one hour.&lt;/li&gt;            &lt;li&gt;&lt;a href="http://www.techdays.nl/SessieDetails.aspx?cid=1524"&gt;Windows Azure AppFabric: Building, Managing, and Connecting High-Density, Multi-Tenant Cloud Applications &lt;/a&gt;, Clemens Vasters              &lt;br /&gt;Clemens is Mr. ServiceBus and the authority on this part of AppFabric.&lt;/li&gt;            &lt;li&gt;&lt;a href="http://www.techdays.nl/SessieDetails.aspx?cid=1444"&gt;De Locatie Centraal met Windows Phone 7&lt;/a&gt;, Marco Wagemakers              &lt;br /&gt;Lower on the list as Achmea is also using ArcGIS and it should be close to home.&lt;/li&gt;         &lt;/ol&gt;       &lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="127"&gt;15:05 – 16:20&lt;/td&gt;        &lt;td valign="top" width="601"&gt;         &lt;ol&gt;           &lt;li&gt;&lt;a href="http://www.techdays.nl/SessieDetails.aspx?cid=1523"&gt;Produceer Betere Product Kwaliteit door Gebruik te Maken van de Ultimate Test Tools&lt;/a&gt;, Marcel de Vries              &lt;br /&gt;It’s been a long time since I saw Marcel speak. I also need some better overview of the test tooling&lt;/li&gt;            &lt;li&gt;&lt;a href="http://www.techdays.nl/SessieDetails.aspx?cid=1427"&gt;Taking Control of your World with the .NET Micro Framework&lt;/a&gt;, Rob Miles              &lt;br /&gt;Great speaker who could easily have been standup comedian. I’m curious what the .NET Micro Framework will bring us in the future.&lt;/li&gt;         &lt;/ol&gt;       &lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="127"&gt;16:30 – 17:45&lt;/td&gt;        &lt;td valign="top" width="601"&gt;         &lt;ol&gt;           &lt;li&gt;&lt;a href="http://www.techdays.nl/SessieDetails.aspx?cid=1614"&gt;What&amp;#39;s New in Silverlight 5&lt;/a&gt;, Jeff Prosise              &lt;br /&gt;What can I say: Jeff Prosise of Windows and MFC fame to tell us about the new things in SL5. A must see.&lt;/li&gt;            &lt;li&gt;&lt;a href="http://www.techdays.nl/SessieDetails.aspx?cid=1302"&gt;Visual Studio LightSwitch - Beyond the Basics&lt;/a&gt;, Beth Massi              &lt;br /&gt;I saw a LightSwitch session by Stefan Kamphuis at the Dutch CodeCamp a couple of weeks ago. I looks very promising as a new tool and I want to know more about the developer potential of this tool.&lt;/li&gt;         &lt;/ol&gt;       &lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;h2&gt;Developer Days - 2&lt;/h2&gt;  &lt;table border="0" cellspacing="0" cellpadding="2" width="733"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="top" width="129"&gt;9:15 – 10:30&lt;/td&gt;        &lt;td valign="top" width="602"&gt;         &lt;ol&gt;           &lt;li&gt;&lt;a href="http://www.techdays.nl/SessieDetails.aspx?cid=1546"&gt;HTML 5 - That&amp;#39;s What You Need to Know Today!&lt;/a&gt;, Ingo Rammer              &lt;br /&gt;Ingo Rammer is famous for his book and knowledge on .NET Remoting. HTML 5 is going to make an impact over the next couple of years. Better not to stay behind.&lt;/li&gt;            &lt;li&gt;&lt;a href="http://www.techdays.nl/SessieDetails.aspx?cid=1323"&gt;Identity &amp;amp; Access Control in the Cloud&lt;/a&gt;, Vittorio Bertocci              &lt;br /&gt;What can I say: the next generation security combined with the cloud. If it weren’t for my involvement in a project that goes deep into claims and identity, I would go see this one.&lt;/li&gt;            &lt;li&gt;&lt;a href="http://www.techdays.nl/SessieDetails.aspx?cid=1562"&gt;Improving Legacy .NET Code&lt;/a&gt;, Thomas Huijer              &lt;br /&gt;Something we all have to deal with: legacy code. I wonder what Thomas’s insights are in improving this.&lt;/li&gt;         &lt;/ol&gt;       &lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="129"&gt;10:50 – 12:05&lt;/td&gt;        &lt;td valign="top" width="602"&gt;         &lt;ol&gt;           &lt;li&gt;&lt;a href="http://www.techdays.nl/SessieDetails.aspx?cid=1423"&gt;Demystifying the .NET Asynchronous Programming Landscape&lt;/a&gt;, Bart de Smet              &lt;br /&gt;Bart has been involved in Linq and other language features at the source in Redmond. This will give a great insight into the async options and the upcoming VB and C# support.&lt;/li&gt;            &lt;li&gt;&lt;a href="http://www.techdays.nl/SessieDetails.aspx?cid=1345"&gt;Real World Architecture with ASP.NET MVC&lt;/a&gt;, Hadi Hariri&lt;/li&gt;            &lt;li&gt;&lt;a href="http://www.techdays.nl/SessieDetails.aspx?cid=1276"&gt;Real World Windows Azure Development: Tips &amp;amp; Tricks&lt;/a&gt;, Wade Wegner              &lt;br /&gt;Hard to choose between number 2 and 3. If it comes down to one of these, I think I’ll toss a coin. (I’ve done so before, ask &lt;a href="http://bloggingabout.net/blogs/dennis" target="_blank"&gt;Dennis&lt;/a&gt;)&lt;/li&gt;         &lt;/ol&gt;       &lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="129"&gt;13:15 – 14:30&lt;/td&gt;        &lt;td valign="top" width="602"&gt;         &lt;ol&gt;           &lt;li&gt;&lt;a href="http://www.techdays.nl/SessieDetails.aspx?cid=1346"&gt;Windows Azure AppFabric Access Control Service: Deep Dive&lt;/a&gt;, Vittorio Bertocci&lt;/li&gt;            &lt;li&gt;&lt;a href="http://www.techdays.nl/SessieDetails.aspx?cid=1343"&gt;Advanced Debugging with Visual Studio 2010&lt;/a&gt;, Ingo Rammer              &lt;br /&gt;Just yesterday I did some low level debugging with WinDbg and DotTrace to track down a memory leak in an ASP.NET application. Ingo will be able to tell more on the topic.&lt;/li&gt;         &lt;/ol&gt;       &lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="129"&gt;14:50 – 16:05&lt;/td&gt;        &lt;td valign="top" width="602"&gt;I’ll be at my own session. Come see this if you are interested in finding out more on Razor and the Web Pages framework surrounding it.&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="129"&gt;16:15 – 17:30&lt;/td&gt;        &lt;td valign="top" width="602"&gt;         &lt;ol&gt;           &lt;li&gt;&lt;a href="http://www.techdays.nl/SessieDetails.aspx?cid=1422"&gt;Developing SaaS Solutions with the Windows Azure Platform&lt;/a&gt;, Vittorio Bertocci&lt;/li&gt;            &lt;li&gt;&lt;a href="http://www.techdays.nl/SessieDetails.aspx?cid=1482"&gt;Web Services Interoperability tussen WCF en Java&lt;/a&gt;, Edwin van Wijk en Bert Erman&lt;/li&gt;            &lt;li&gt;&lt;a href="http://www.techdays.nl/SessieDetails.aspx?cid=1602"&gt;WCF Data Services Introductie - De Serverkant&lt;/a&gt;, Erno de Weerd&lt;/li&gt;         &lt;/ol&gt;          &lt;p&gt;At the end of the conference I have no idea what I think is a nice roundup. These three seemed to come to mind. We’ll see.&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;Hopefully this list or the criteria will help you select from all of the sessions, if you are in doubt. Whichever way, the DevDays 2011 should be a great event. Have fun and see you there!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.alexthissen.nl/aggbug.aspx?PostID=22566" width="1" height="1"&gt;</content><author><name>alexthissen</name><uri>http://www.alexthissen.nl/members/alexthissen/default.aspx</uri></author></entry><entry><title>A new role: Microsoft Regional Director</title><link rel="alternate" type="text/html" href="/blogs/main/archive/2011/04/04/a-new-role-microsoft-regional-director.aspx" /><id>/blogs/main/archive/2011/04/04/a-new-role-microsoft-regional-director.aspx</id><published>2011-04-04T20:49:27Z</published><updated>2011-04-04T20:49:27Z</updated><content type="html">&lt;p&gt;Since early March I have been given a new role as Microsoft Regional Director (RD). In The Netherlands there are two positions for RD, and for the past few years &lt;a href="http://blogs.infosupport.com/blogs/marcelv/" target="_blank"&gt;Marcel de Vries&lt;/a&gt; and &lt;a href="https://blogs.microsoft.nl/members/Anko-Duizer.aspx" target="_blank"&gt;Anko Duizer&lt;/a&gt; have fulfilled both. Last year Anko rejoined the ranks of Microsoft and automatically stopped being an RD. August last year I was contacted by Microsoft NL to talk about the RD program. I happily accepted the invitation to become the new RD.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.alexthissen.nl/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/main/RegionalDirector_5F00_7A28196A.png"&gt;&lt;img style="background-image:none;border-bottom:0px;border-left:0px;padding-left:0px;padding-right:0px;display:inline;float:right;border-top:0px;border-right:0px;padding-top:0px;" title="RegionalDirector" border="0" alt="RegionalDirector" align="right" src="http://www.alexthissen.nl/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/main/RegionalDirector_5F00_thumb_5F00_62413244.png" width="156" height="57" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;I’ve waited for a good moment to announce my new role and finished some other work, in order to be able to spend more time on the RD program. The appearance of the RD column that Marcel and myself wrote for the the last issue of the Dutch &lt;a href="http://www.dotnetmag.nl/" target="_blank"&gt;DotNetMagazine&lt;/a&gt; seemed like a good time. I am very enthusiastic about the program and the part I can play in it. I really believe that RDs can serve as an intermediate between Microsoft and the community at large (being the .NET community, end users and businesses). Very soon Marcel and myself will start building an “attack plan” to maximize the impact we can make as RDs. Stay tuned.&lt;/p&gt;  &lt;p&gt;Next up will be a translation of the RD column in English, because I think that it explains the purpose of the Regional Director program from a different angle. I’ve named it “Regional Directors: the antennas for Microsoft and the community”.&lt;/p&gt;  &lt;p&gt;If you are interested to read more on the Regional Director program, you can take a look at the &lt;a href="http://TheRegion.com" target="_blank"&gt;TheRegion.com&lt;/a&gt;. Also, there is a nice blog post by Jeffrey Pallermo that has some frequently asked questions on “&lt;a href="http://weblogs.asp.net/palermo4/archive/2008/01/04/who-are-the-microsoft-regional-directors.aspx" target="_blank"&gt;who are the Regional Directors&lt;/a&gt;?”. &lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.alexthissen.nl/aggbug.aspx?PostID=22565" width="1" height="1"&gt;</content><author><name>alexthissen</name><uri>http://www.alexthissen.nl/members/alexthissen/default.aspx</uri></author><category term="Regional Director" scheme="http://www.alexthissen.nl/blogs/main/archive/tags/Regional+Director/default.aspx" /></entry><entry><title>Vacature “Microsoft Technisch consultant” bij Nokavision</title><link rel="alternate" type="text/html" href="/blogs/main/archive/2010/11/29/vacature-microsoft-technisch-consultant-bij-nokavision.aspx" /><id>/blogs/main/archive/2010/11/29/vacature-microsoft-technisch-consultant-bij-nokavision.aspx</id><published>2010-11-29T13:55:26Z</published><updated>2010-11-29T13:55:26Z</updated><content type="html">&lt;p&gt;Het bedrijf &lt;a href="http://www.nokavision.com/" target="_blank"&gt;Nokavision&lt;/a&gt; uit ‘s-Hertogenbosch heeft een interessante vacature beschikbaar. Ben je op zoek naar een nieuwe uitdaging in het zuidelijke deel van Nederland, lees dan de beschrijving eens door. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.alexthissen.nl/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/main/cid_5F00_image001_5F00_gif01CB7CF2_5F00_762F6F27.gif"&gt;&lt;img style="background-image:none;border-right-width:0px;margin:0px 10px 0px 0px;padding-left:0px;padding-right:0px;display:inline;float:left;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;padding-top:0px;" title="!cid_image001_gif@01CB7CF2" border="0" alt="!cid_image001_gif@01CB7CF2" align="left" src="http://www.alexthissen.nl/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/main/cid_5F00_image001_5F00_gif01CB7CF2_5F00_thumb_5F00_2D294D61.gif" width="219" height="50" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Ik ken Nokavision als een bedrijf dat graag bezig is met nieuwe Microsoft technologien. Ze hebben een sterk verleden met document management en document stromen en business process management in organisaties. Om meer te weten te komen over Nokavision, kun je natuurlijk &lt;a href="http://www.nokavision.com/" target="_blank"&gt;hun website&lt;/a&gt; bezoeken. Daar vind je onder andere &lt;a href="http://www.nokavision.com/case_studies.htm" target="_blank"&gt;case studies&lt;/a&gt; van eerdere klanten, hun producten (o.a. Skelta, StreamServe en Captaris producten) en de diensten die ze bieden.&lt;/p&gt;  &lt;p&gt;Hieronder de vacaturetekst. Ben je geinteresseerd, neem dan contact op met Rob Steenvoorden. De contactgegevens staan onderaan.&lt;/p&gt;  &lt;h2&gt;Microsoft Technisch consultant&lt;/h2&gt;  &lt;h3&gt;Doel van functie&lt;/h3&gt;  &lt;p&gt;Als Consultant maak je deel uit van een professioneel team dat als standplaats Den Bosch heeft. Onze werkzaamheden vinden plaats aan oplossingen die als product in de markt worden gezet. Je werkt aan de ontwikkeling, uitbreiding en beheer van Microsoft oplossingen. Je werkt met professionele collega’s met diverse ideeën, achtergronden en werkwijzen. Je wordt aangemoedigd je technische vaardigheden uit te breiden en je thuis te voelen in een “lerende” cultuur. &lt;/p&gt;  &lt;h3&gt;Verantwoordelijkheden en taken&lt;/h3&gt;  &lt;p&gt;Je bent verantwoordelijk voor de ontwikkeling, oplevering en onderhoud van nieuwe en bestaande&amp;#160; producten op basis van Microsoft technologieën. Je werkt met de modernste Microsoft technologieën waaronder C#, .NET 4, Silverlight 4, WCF RIA Services, Entity Framework, Enterprise Library, SQL Server. Tevens maken we gebruik van Workflow technologie die .NET gerelateerd is. &lt;/p&gt;  &lt;h3&gt;Ideale profiel&lt;/h3&gt;  &lt;ul&gt;   &lt;li&gt;Ervaring met C# en .NET &lt;/li&gt;    &lt;li&gt;Junior/Medior software ontwikkelaar &lt;/li&gt;    &lt;li&gt;Je bent accuraat en hebt een actieve houding &lt;/li&gt;    &lt;li&gt;Belangstelling voor complexe bedrijfskundige en technische omgevingen &lt;/li&gt;    &lt;li&gt;Gewend om volgens methodieken te werken &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Een pré is:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Kennis van UML &amp;amp; Design Patterns &lt;/li&gt;    &lt;li&gt;Kennis van en ervaring met Silverlight en/of WPF &lt;/li&gt; &lt;/ul&gt;  &lt;h3&gt;Arbeidsvoorwaarden&lt;/h3&gt;  &lt;p&gt;Nokavision is een zeer sociaal bedrijf. Nokavision biedt uitstekende primaire/secundaire arbeidsvoorwaarden. De opleidingsmogelijkheden zowel intern als extern zijn uitstekend. Daarnaast besteden wij veel tijd en energie aan persoonlijke groei en ontwikkeling.&lt;/p&gt;  &lt;p&gt;Wil je meer weten of reageren: stuur je bericht met CV naar &lt;a href="mailto:r.steenvoorden@nokavision.com"&gt;r.steenvoorden@nokavision.com&lt;/a&gt; of bel met 073-6408490.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.alexthissen.nl/aggbug.aspx?PostID=22562" width="1" height="1"&gt;</content><author><name>alexthissen</name><uri>http://www.alexthissen.nl/members/alexthissen/default.aspx</uri></author></entry><entry><title>Two exam opportunities</title><link rel="alternate" type="text/html" href="/blogs/main/archive/2010/10/16/two-exam-opportunities.aspx" /><id>/blogs/main/archive/2010/10/16/two-exam-opportunities.aspx</id><published>2010-10-16T20:46:48Z</published><updated>2010-10-16T20:46:48Z</updated><content type="html">&lt;p&gt;Quick post on two beta Microsoft exams that you are allowed to participate in. &lt;a href="http://blogs.msdn.com/b/gerryo/" target="_blank"&gt;Gerry o’Brien&lt;/a&gt; posted that the exams:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://blogs.msdn.com/b/gerryo/archive/2010/10/13/windows-azure-beta-exam-announcement.aspx" target="_blank"&gt;71-583, Pro: Designing and Developing Windows Azure Applications&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://blogs.msdn.com/b/gerryo/archive/2010/10/13/silverlight-beta-exam-announcement.aspx" target="_blank"&gt;71-506, TS: Silverlight 4, Development&lt;/a&gt; &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;are now available to take. The beauty is that if you manage to pass the qualifying score on the beta exam, you also pass the exam as soon as it is released. Of course, it is also a good challenge for your brain and a test of your knowledge on the topic of the exam. When you’re into the business of training, coaching or other knowledge transfer areas, this is a great opportunity to find out which training, books and e-learning material is needed to prepare for this exam.&lt;/p&gt;  &lt;p&gt;The Microsoft Learning website lists extra information on the exams &lt;a href="http://www.microsoft.com/learning/en/us/exam.aspx?ID=70-583&amp;amp;locale=en-us" target="_blank"&gt;70-583&lt;/a&gt; and &lt;a href="http://www.microsoft.com/learning/en/us/exam.aspx?ID=70-506&amp;amp;locale=en-us" target="_blank"&gt;70-506&lt;/a&gt;. The exams seem to be the one exam to pass to acquire either the “MCPD: Windows Azure Developer 4” or “MCTS: Silverlight 4, Development” certifications.&lt;/p&gt;  &lt;p&gt;You can take these exams for free if you use the promotion codes AZPRO and SL410 respectively. You need to enter these code at the Payment Information screen.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.alexthissen.nl/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/main/image_5F00_4DF72B5B.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://www.alexthissen.nl/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/main/image_5F00_thumb_5F00_576FE9D1.png" width="552" height="253" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Time is limited, so be sure to register immediately at &lt;a href="http://www.prometric.com/default.htm" target="_blank"&gt;Prometric&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.alexthissen.nl/aggbug.aspx?PostID=22558" width="1" height="1"&gt;</content><author><name>alexthissen</name><uri>http://www.alexthissen.nl/members/alexthissen/default.aspx</uri></author></entry><entry><title>Microsoft Most Valuable Professional for 2010</title><link rel="alternate" type="text/html" href="/blogs/main/archive/2010/07/02/microsoft-most-valuable-professional-for-2010.aspx" /><id>/blogs/main/archive/2010/07/02/microsoft-most-valuable-professional-for-2010.aspx</id><published>2010-07-02T14:59:32Z</published><updated>2010-07-02T14:59:32Z</updated><content type="html">&lt;p&gt;&lt;a href="http://www.alexthissen.nl/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/main/MVPLogo_5F00_1C802089.gif"&gt;&lt;img style="border-bottom:0px;border-left:0px;margin:0px 15px 15px 0px;display:inline;border-top:0px;border-right:0px;" title="MVPLogo" border="0" alt="MVPLogo" align="left" src="http://www.alexthissen.nl/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/main/MVPLogo_5F00_thumb_5F00_7C35640B.gif" width="115" height="180" /&gt;&lt;/a&gt;Yesterday I received mail from Toby Richards with the title “Congratulations 2010 Microsoft MVP!”. This means that Microsoft grants me this title as a Microsoft community contributor for another year.&lt;/p&gt;  &lt;p&gt; The mail is pretty flattering: “&lt;em&gt;This award is given to exceptional technical community leaders who actively share their high quality, real world expertise with others.&lt;/em&gt;” I do hope people like the presentations I give at the various Dutch conferences. That’s my main place to share.&lt;/p&gt;  &lt;p&gt;Thanks Microsoft. Thanks community. Hope to meet you again soon.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.alexthissen.nl/aggbug.aspx?PostID=22551" width="1" height="1"&gt;</content><author><name>alexthissen</name><uri>http://www.alexthissen.nl/members/alexthissen/default.aspx</uri></author></entry><entry><title>Extracting files from an MSI package</title><link rel="alternate" type="text/html" href="/blogs/main/archive/2010/06/17/extracting-files-from-an-msi-package.aspx" /><id>/blogs/main/archive/2010/06/17/extracting-files-from-an-msi-package.aspx</id><published>2010-06-17T09:03:19Z</published><updated>2010-06-17T09:03:19Z</updated><content type="html">&lt;p&gt;Reminder to self, as I have searched for this too many times:&lt;/p&gt;  &lt;p&gt;How to extract files from an MSI file without actually installing it:&lt;/p&gt;  &lt;div style="padding-bottom:0px;margin:0px;padding-left:0px;padding-right:0px;display:inline;float:none;padding-top:0px;" id="scid:812469c5-0cb0-4c63-8c15-c81123a09de7:2f7a4b70-cf9f-4020-b092-25f5a7ffcc6d" class="wlWriterEditableSmartContent"&gt;&lt;pre class="c"&gt;msiexec /a c:\downloads\WCFRestStarterKit.msi /qb TARGETDIR=c:\RESTStarterKit&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Run this from an elevated command prompt. The target directory does not have to be created beforehand.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.alexthissen.nl/aggbug.aspx?PostID=22550" width="1" height="1"&gt;</content><author><name>alexthissen</name><uri>http://www.alexthissen.nl/members/alexthissen/default.aspx</uri></author><category term="Windows OS" scheme="http://www.alexthissen.nl/blogs/main/archive/tags/Windows+OS/default.aspx" /><category term="Tools and Utilities" scheme="http://www.alexthissen.nl/blogs/main/archive/tags/Tools+and+Utilities/default.aspx" /></entry><entry><title>WCF Extensibility part 5: Make your endpoints behave</title><link rel="alternate" type="text/html" href="/blogs/main/archive/2009/08/25/wcf-extensibility-part-5-make-your-endpoints-behave.aspx" /><id>/blogs/main/archive/2009/08/25/wcf-extensibility-part-5-make-your-endpoints-behave.aspx</id><published>2009-08-25T06:36:00Z</published><updated>2009-08-25T06:36:00Z</updated><content type="html">&lt;p&gt;In the previous post we looked at an operation behavior that applied the operation formatter to a particular operation description. Because this is default behavior for all operations in the interface defined, we will make life a little easier on us to have the operation behaviors applied automatically. A WCF endpoint consists of address, binding and contract. The latter is represented by the [ServiceContract] annotated interface, in our case IRcon and the target of our exercise. &lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.alexthissen.nl/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/main/image_5F00_7BAA35EC.png"&gt;&lt;img height="252" width="670" src="http://www.alexthissen.nl/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/main/image_5F00_thumb_5F00_33C8616B.png" alt="image" border="0" title="image" style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;The extensibility point that the WCF runtime provides is an endpoint behavior. Endpoint behaviors allow you to manipulate an endpoint&amp;rsquo;s definition. To create an endpoint behavior you need to implement the System.ServiceModel.Description.IEndpointBehavior interface:&lt;/p&gt;
&lt;div class="wlWriterEditableSmartContent" id="scid:812469c5-0cb0-4c63-8c15-c81123a09de7:ae19c08b-4e08-41e0-8b3a-0e5d1324c144" style="padding-bottom:0px;margin:0px;padding-left:0px;padding-right:0px;display:inline;float:none;padding-top:0px;"&gt;
&lt;pre class="brush: csharp; gutter: true; first-line: 1; tab-size: 2;  toolbar: true;"&gt;public interface IEndpointBehavior
{
    void AddBindingParameters(ServiceEndpoint endpoint, BindingParameterCollection bindingParameters);
    void ApplyClientBehavior(ServiceEndpoint endpoint, ClientRuntime clientRuntime);
    void ApplyDispatchBehavior(ServiceEndpoint endpoint, EndpointDispatcher endpointDispatcher);
    void Validate(ServiceEndpoint endpoint);
}&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;This should look pretty familiar to you if you have read the previous part in this series. Again, you can apply your behavior both on the client and service side. There&amp;rsquo;s another validation moment in the Validate method and you can add binding parameters to the binding context for later use.&lt;/p&gt;
&lt;p&gt;The implementation of ApplyClientBehavior is the most interesting one. Here we will apply the operation behavior to each of the endpoint&amp;rsquo;s operations.&lt;/p&gt;
&lt;div class="wlWriterEditableSmartContent" id="scid:812469c5-0cb0-4c63-8c15-c81123a09de7:37b23b2a-92e9-4fa0-9453-7312ea3ebd23" style="padding-bottom:0px;margin:0px;padding-left:0px;padding-right:0px;display:inline;float:none;padding-top:0px;"&gt;
&lt;pre class="brush: csharp; gutter: true; first-line: 1; tab-size: 2;  toolbar: true;"&gt;public void ApplyClientBehavior(ServiceEndpoint endpoint, ClientRuntime clientRuntime)
{
    if (endpoint.Binding is SourceRconTcpBinding)
    {
        foreach (OperationDescription description in endpoint.Contract.Operations)
        {
            ApplyFormatterBehavior(description, endpoint);
        }
    }
}

private void ApplyFormatterBehavior(OperationDescription operationDescription, ServiceEndpoint endpoint)
{
    if (operationDescription.Behaviors.Find&amp;lt;SourceRconOperationFormatterBehavior&amp;gt;() == null)
    {
        SourceRconOperationFormatterBehavior formatterBehavior = new SourceRconOperationFormatterBehavior();
        operationDescription.Behaviors.Add(formatterBehavior);
    }
}&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;Inside the implementation a simple loop over the operation descriptions in the contract is enough to get things going. The helper method ApplyFormatterBehavior makes sure that the SourceRconOperationFormatterBehavior behavior is applied only once.&lt;/p&gt;
&lt;p&gt;An endpoint behavior needs to be added to the Behaviors collection of an endpoint to make it do its work. Given the client-side interface definition IRconProxy (which derives from both IRcon and IClientChannel) you can create a channel factory. The factory holds the the definition of the endpoint, provided by the implicit ABC in line 1 (address and binding are obvious, the generic &amp;lt;T&amp;gt; of the ChannelFactory represents the contract).&lt;/p&gt;
&lt;div class="wlWriterEditableSmartContent" id="scid:812469c5-0cb0-4c63-8c15-c81123a09de7:c14be624-47f4-419f-9b12-ff7e0a4b7f16" style="padding-bottom:0px;margin:0px;padding-left:0px;padding-right:0px;display:inline;float:none;padding-top:0px;"&gt;
&lt;pre class="brush: csharp; gutter: true; first-line: 1; tab-size: 2;  toolbar: true;"&gt;ChannelFactory&amp;lt;IRconProxy&amp;gt; factory = new ChannelFactory&amp;lt;IRconProxy&amp;gt;(binding, new EndpointAddress(uri));
factory.Endpoint.Behaviors.Add(new SourceRconEndpointBehavior());
factory.Open();&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;Line 2 adds the behavior to the Behaviors collection of the endpoint. When the factory opens, the behavior gets applied. The operation formatters get applied at that moment as well. The operation formatters are used when the actual calls through the channel are made.&lt;/p&gt;
&lt;p&gt;Side note: if you were to use a ClientBase&amp;lt;T&amp;gt; derived proxy, you would need to drill down into the proxy.ChannelFactory.Endpoint.Behaviors to get at the Behaviors collection, or use the proxy.Endpoint property for easier access.&lt;/p&gt;
&lt;p&gt;To summarize, an endpoint behavior allows you to manipulate your endpoint. Behaviors are an opt-in, so it is your choice whether to apply them or not. &lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.alexthissen.nl/aggbug.aspx?PostID=22532" width="1" height="1"&gt;</content><author><name>alexthissen</name><uri>http://www.alexthissen.nl/members/alexthissen/default.aspx</uri></author><category term="Gaming" scheme="http://www.alexthissen.nl/blogs/main/archive/tags/Gaming/default.aspx" /><category term="Protocols" scheme="http://www.alexthissen.nl/blogs/main/archive/tags/Protocols/default.aspx" /><category term=".NET FX 3.5 SP1" scheme="http://www.alexthissen.nl/blogs/main/archive/tags/.NET+FX+3.5+SP1/default.aspx" /><category term="WCF" scheme="http://www.alexthissen.nl/blogs/main/archive/tags/WCF/default.aspx" /></entry><entry><title>WCF Extensibility part 4: Applying formatting to operations</title><link rel="alternate" type="text/html" href="/blogs/main/archive/2009/08/21/wcf-extensibility-part-4-applying-formatting-to-operations.aspx" /><id>/blogs/main/archive/2009/08/21/wcf-extensibility-part-4-applying-formatting-to-operations.aspx</id><published>2009-08-21T20:11:00Z</published><updated>2009-08-21T20:11:00Z</updated><content type="html">&lt;p&gt;In the previous part we inspected the way you can influence the transition from a service operation to a WCF Message object. This was accomplished with an implementation of the IClientMessageFormatter interface, in our case the SourceRconOperationFormatter class. Now it&amp;rsquo;s time to look at how to apply this message formatter to the client channel stack.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.alexthissen.nl/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/main/image_5F00_65ADA55C.png"&gt;&lt;img height="254" width="673" src="http://www.alexthissen.nl/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/main/image_5F00_thumb_5F00_3CC29053.png" alt="image" border="0" title="image" style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;The message formatting happens based on the formatter that is specified as part of the description of an operation. This means that in theory you could change the formatter from operation to operation. In order to get the formatter in place you need to change the Formatter property of the System.ServiceModel.Description.OperationDescription for the operation of your choice. Obviously this has to be done before the first method call is made. The extensibility point that allows you define which formatters are used for client and service operations is an operation behavior. When applied an operation behavior will influence the way an operation behaves when called. Hence the name.&lt;/p&gt;
&lt;p&gt;Operation behaviors must implement the System.ServiceModel.Decription.IOperationBehavior interface. First of all look at that interface definition:&lt;/p&gt;
&lt;div class="wlWriterEditableSmartContent" id="scid:812469c5-0cb0-4c63-8c15-c81123a09de7:aa86fa62-127d-4f19-8cf2-bc4ed09015de" style="padding-bottom:0px;margin:0px;padding-left:0px;padding-right:0px;display:inline;float:none;padding-top:0px;"&gt;
&lt;pre class="brush: csharp; gutter: true; first-line: 1; tab-size: 2;  toolbar: true;"&gt;public interface IOperationBehavior
{
    void AddBindingParameters(OperationDescription operationDescription, BindingParameterCollection bindingParameters);
    void ApplyClientBehavior(OperationDescription operationDescription, ClientOperation clientOperation);
    void ApplyDispatchBehavior(OperationDescription operationDescription, DispatchOperation dispatchOperation);
    void Validate(OperationDescription operationDescription);
}&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;As you can see it has two methods to apply the specifics of your behavior to an operation description: one for client-side and one for service-side operations. We need to fill in the client-side proxy part of it only. Furthermore, the behavior can validate the operation to which it is applied. More on this in a moment. And finally, should the behavior need to add specific parameters to the entire binding (which can be accessed later on from the binding context) it is free to do so in the AddBindingParameters method.&lt;/p&gt;
&lt;p&gt;The SourceRconOperationFormatterBehavior class explicitly implements the IOperationBehavior interface. There is no point to have public method as it is unlikely that the implementation will be called other than via the interface.&lt;/p&gt;
&lt;div class="wlWriterEditableSmartContent" id="scid:812469c5-0cb0-4c63-8c15-c81123a09de7:cdfeef7d-2528-46b2-89ee-4f49a38deb2b" style="padding-bottom:0px;margin:0px;padding-left:0px;padding-right:0px;display:inline;float:none;padding-top:0px;"&gt;
&lt;pre class="brush: csharp; gutter: true; first-line: 1; tab-size: 2;  toolbar: true;"&gt;public class SourceRconOperationFormatterBehavior: IOperationBehavior
{
    #region IOperationBehavior Members

    void IOperationBehavior.AddBindingParameters(OperationDescription operationDescription, BindingParameterCollection bindingParameters)
    {
        // Nothing for us to do
    }

    void IOperationBehavior.ApplyClientBehavior(OperationDescription operationDescription, ClientOperation clientOperation)
    {
        // Apply our own formatter
        clientOperation.Formatter = new SourceRconOperationFormatter(operationDescription);

        // This behavior takes care of both request and replies at client
        clientOperation.SerializeRequest = true;
        clientOperation.DeserializeReply = true;
    }

    void IOperationBehavior.ApplyDispatchBehavior(OperationDescription operationDescription, System.ServiceModel.Dispatcher.DispatchOperation dispatchOperation)
    {
        // Client-side only
        throw new NotImplementedException();
    }

    void IOperationBehavior.Validate(OperationDescription operationDescription)
    {
        // Always valid?
        // In our case we cannot have ref or out parameters
        // We could check that parameters are primitive types
    }

    #endregion
}&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;The ApplyClientBehavior method set the Formatter property of the client operation to which the behavior is applied. It also expresses that the client operation will serialize and deserialize both request and reply messages.&lt;/p&gt;
&lt;p&gt;Inside the Validate method we could check whether the operation is compatible with the behavior. For example, we should check that there are no ref or out parameters. We could check that the parameters are either representable as a string, and whether the return value is either of type string (the reply messages always contain string data) or that it is deserializable from a string. I have not been able to get the validate method to be triggered and all implementations of IOperationBehavior inside the framework have an empty method body. With Reflector you can see that the client validations on behaviors should go off when the ChannelFactory is opening. I&amp;rsquo;m not sure why it does not fire.&lt;/p&gt;
&lt;p&gt;You can go the extra mile and have your behavior derive from Attribute:&lt;/p&gt;
&lt;div class="wlWriterEditableSmartContent" id="scid:812469c5-0cb0-4c63-8c15-c81123a09de7:a37777bd-ae37-4504-ac48-f1392d75f025" style="padding-bottom:0px;margin:0px;padding-left:0px;padding-right:0px;display:inline;float:none;padding-top:0px;"&gt;
&lt;pre class="brush: csharp; gutter: true; first-line: 1; tab-size: 2;  toolbar: true;"&gt;[AttributeUsage(AttributeTargets.Method)]
public sealed class SourceRconOperationFormatterBehaviorAttribute : Attribute, IOperationBehavior&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;so it can be used as an attribute above a method:&lt;/p&gt;
&lt;div class="wlWriterEditableSmartContent" id="scid:812469c5-0cb0-4c63-8c15-c81123a09de7:87d7b200-7785-4e00-99ab-77891efda061" style="padding-bottom:0px;margin:0px;padding-left:0px;padding-right:0px;display:inline;float:none;padding-top:0px;"&gt;
&lt;pre class="brush: csharp; gutter: true; first-line: 1; tab-size: 2;  toolbar: true;"&gt;[ServiceContract]
public interface IRcon
{
    [OperationContract(Action = &amp;quot;status&amp;quot;)]
    [SourceRconOperationFormatterBehavior]
    string GetStatus();&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;You would probably want to change the name of the behavior/attribute class to something like SourceRconOperationAttribute so it looks like [SourceRconOperation]. This makes more sense. In our case the behavior is not really optional as we need to apply the operation formatter for every operation in a service contract to make things work. Having an interface that is only partially usable for remote control seems weird.&lt;/p&gt;
&lt;p&gt;Having made the remarks above on how behaviors are non-optional, the next topic will be about a streamlined way to accomplish that all operations in a service contract will have the operation formatter behavior applied.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.alexthissen.nl/aggbug.aspx?PostID=22521" width="1" height="1"&gt;</content><author><name>alexthissen</name><uri>http://www.alexthissen.nl/members/alexthissen/default.aspx</uri></author></entry><entry><title>WCF Extensibility part 3: Formatting operations</title><link rel="alternate" type="text/html" href="/blogs/main/archive/2009/08/21/wcf-extensibility-part-3-formatting-operations.aspx" /><id>/blogs/main/archive/2009/08/21/wcf-extensibility-part-3-formatting-operations.aspx</id><published>2009-08-20T22:00:00Z</published><updated>2009-08-20T22:00:00Z</updated><content type="html">&lt;p&gt;Time to get serious and drill down into the first area of the big picture. We are going to take a look at &amp;ldquo;operation formatting&amp;rdquo;, which is roughly located in the highlighted area. &lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.alexthissen.nl/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/main/image_5F00_5049AD0C.png"&gt;&lt;img height="216" width="567" src="http://www.alexthissen.nl/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/main/image_5F00_thumb_5F00_5CD75A28.png" alt="image" border="0" title="image" style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;One of the crucial parts of the WCF channel layer is the way that method invocations get transformed into WCF messages. This capability allows the end-programmer to work with the object-oriented paradigm. This means you call methods on proxy objects, instead of having to fiddle with the messages going back and forth between a client and service yourself.&lt;/p&gt;
&lt;p&gt;Let&amp;rsquo;s say we have a proxy that was created like so:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;div class="wlWriterEditableSmartContent" id="scid:812469c5-0cb0-4c63-8c15-c81123a09de7:59bea44a-51cf-4c1f-aafe-d2d69ac019a5" style="padding-bottom:0px;margin:0px;padding-left:0px;padding-right:0px;display:inline;float:none;padding-top:0px;"&gt;
&lt;pre class="brush: csharp; gutter: true; first-line: 1; tab-size: 2;  toolbar: true;"&gt;[ServiceContract]
public interface IRcon
{
    [OperationContract(Action = &amp;quot;kick&amp;quot;)]
    string Kick(string steamID);
}

public interface IRconProxy : IRcon, IClientChannel { }

class Program
{
    static void Main(string[] args)
    {
        SourceRconTcpBinding binding = new SourceRconTcpBinding(&amp;quot;abc123&amp;quot;);
        string uri = &amp;quot;raw.tcp://192.168.100.101:27015&amp;quot;;
        IRconProxy proxy = null;
        ChannelFactory&amp;lt;IRconProxy&amp;gt; factory = new ChannelFactory&amp;lt;IRconProxy&amp;gt;(binding, new EndpointAddress(uri));
        factory.Endpoint.Behaviors.Add(new SourceRconEndpointBehavior());
        factory.Open();

        proxy = factory.CreateChannel();

        string reply = proxy.Kick(&amp;quot;1:0:1337&amp;quot;);&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Take a look at the last line. There you can see a method call being made on the proxy that was created with a call to ChannelFactory&amp;lt;IRconProxy&amp;gt;.CreateChannel. We want to influence the way this method call gets transformed into a specialized System.ServiceModel.Messaging.Message class, called SourceRconMessage. The regular transformation would change a method call into normal Message objects. Our message object holds the spcifics for the Source rcon protocol. Here is the shape of the class, corresponding to the elements of the rcon protocol:&lt;/p&gt;
&lt;div class="wlWriterEditableSmartContent" id="scid:812469c5-0cb0-4c63-8c15-c81123a09de7:23390be6-1db6-4516-9006-ff6f6f2d81ec" style="padding-bottom:0px;margin:0px;padding-left:0px;padding-right:0px;display:inline;float:none;padding-top:0px;"&gt;
&lt;pre class="brush: csharp; gutter: true; first-line: 1; tab-size: 2;  toolbar: true;"&gt;public class SourceRconMessage : Message
{
    public int RequestID { get { ... } }
    public ServerData ServerData { ... } }
    public string String1 { get { ... } }
    public string String2 { get { ... } }
}&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;We will get back to the specifics of the message in a later post.&lt;/p&gt;
&lt;p&gt;The process of changing a method invocation to a message and vice versa is called operation formatting. The key interfaces for all classes that performs this task are System.ServiceModel.Dispatcher.IClientMessageFormatter and IDispatchMessageFormatter. They are essentially the same but mirrored, because they represent the formatting that will happen at the client and service respectively.&lt;/p&gt;
&lt;div class="wlWriterEditableSmartContent" id="scid:812469c5-0cb0-4c63-8c15-c81123a09de7:06202aea-f927-4a9e-8597-f4b16fca5089" style="padding-bottom:0px;margin:0px;padding-left:0px;padding-right:0px;display:inline;float:none;padding-top:0px;"&gt;
&lt;pre class="brush: csharp; gutter: true; first-line: 1; tab-size: 2;  toolbar: true;"&gt;public interface IClientMessageFormatter
{
	object DeserializeReply(Message message, object[] parameters);
	Message SerializeRequest(MessageVersion messageVersion, object[] parameters);
}&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;We will only look at the client message formatter, since we are building a client-side only implementation of the channel stack. The service&amp;rsquo;s side would have DeserializeRequest and SerializeReply, mirroring the direction requests and replies are sent and received.&lt;/p&gt;
&lt;p&gt;Let&amp;rsquo;s look at each of the implementations of the two methods of the IClientMessageFormatter interface:&lt;/p&gt;
&lt;div class="wlWriterEditableSmartContent" id="scid:812469c5-0cb0-4c63-8c15-c81123a09de7:8047e62f-4faa-45dd-a143-506623a14266" style="padding-bottom:0px;margin:0px;padding-left:0px;padding-right:0px;display:inline;float:none;padding-top:0px;"&gt;
&lt;pre class="brush: csharp; gutter: true; first-line: 1; tab-size: 2;  toolbar: true;"&gt;// Changes a list of parameters and operation description into a SourceRconMessage
public Message SerializeRequest(MessageVersion messageVersion, object[] parameters)
{
    SourceRconMessage message = new SourceRconMessage(operationDescription.Messages[0].Action, parameters);
    message.Headers.MessageId = new UniqueId(message.RequestID.ToString());

    return message;
}&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;No rocket science here. The process of changing the action and parameters of the method call into a message is performed by a custom-built constructor on the SourceRconMessage class. The one thing to remember for later though is the mysterious property of MessageId in the Headers of the message that we set. This will be revisited at a later stage.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;div class="wlWriterEditableSmartContent" id="scid:812469c5-0cb0-4c63-8c15-c81123a09de7:fa3b973f-5535-4509-b736-1fa4a5a773a7" style="padding-bottom:0px;margin:0px;padding-left:0px;padding-right:0px;display:inline;float:none;padding-top:0px;"&gt;
&lt;pre class="brush: csharp; gutter: true; first-line: 1; tab-size: 2;  toolbar: true;"&gt;// Goes from SourceRconMessage to return value and parameter list
public object DeserializeReply(Message rawMessage, object[] parameters)
{
    // Deserialize message and return value
    object returnValue = null;
    SourceRconMessage message = (SourceRconMessage)rawMessage;

    // TODO: Use returnParameter.ParameterType to get the type of return parameter
	// and deserialize to that type from string
    returnValue = message.String1;

    return returnValue;
}&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The DeserializeReply method will get a deserialized reply message that was handed from the channel stack. This should be a SourceRconMessage object (which we should probably check for to be sure it really is). Right now we only extract the single valuable piece of information from the message: the String1 property. It is passed back as the return value, which will work as long as the return value is of type string. Notice how there is no type information available for the return value and parameters.&lt;/p&gt;
&lt;p&gt;The two methods above go into the SourceRconOperationFormatter class. &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;div class="wlWriterEditableSmartContent" id="scid:812469c5-0cb0-4c63-8c15-c81123a09de7:ceaf4f0b-f6d7-482c-be64-2d3261f0a367" style="padding-bottom:0px;margin:0px;padding-left:0px;padding-right:0px;display:inline;float:none;padding-top:0px;"&gt;
&lt;pre class="brush: csharp; gutter: true; first-line: 1; tab-size: 2;  toolbar: true;"&gt;public class SourceRconOperationFormatter: IClientMessageFormatter
{
    // Goes from SteamRconMessage to return value and parameter list
    public object DeserializeReply(Message rawMessage, object[] parameters) { ... }

    // Changes a list of parameters and operation description into a SteamRconMessage
    public Message SerializeRequest(MessageVersion messageVersion, object[] parameters) { ... }
}&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The class can contain much more. A later and improved version will have a special constructor to hold the operation description details to be able to have type information on the parameters and return value for the sake of DeserializeReply.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.alexthissen.nl/aggbug.aspx?PostID=22515" width="1" height="1"&gt;</content><author><name>alexthissen</name><uri>http://www.alexthissen.nl/members/alexthissen/default.aspx</uri></author><category term="Gaming" scheme="http://www.alexthissen.nl/blogs/main/archive/tags/Gaming/default.aspx" /><category term="Protocols" scheme="http://www.alexthissen.nl/blogs/main/archive/tags/Protocols/default.aspx" /><category term=".NET FX 3.5 SP1" scheme="http://www.alexthissen.nl/blogs/main/archive/tags/.NET+FX+3.5+SP1/default.aspx" /><category term="WCF" scheme="http://www.alexthissen.nl/blogs/main/archive/tags/WCF/default.aspx" /></entry><entry><title>WCF Extensibility part 2: The big picture</title><link rel="alternate" type="text/html" href="/blogs/main/archive/2009/08/20/wcf-extensibility-part-2-the-big-picture.aspx" /><id>/blogs/main/archive/2009/08/20/wcf-extensibility-part-2-the-big-picture.aspx</id><published>2009-08-20T21:20:36Z</published><updated>2009-08-20T21:20:36Z</updated><content type="html">&lt;p&gt;Before I drill down into each of the smaller parts of the client-side channel stack implementation, I want to sketch out an overview of some of the moving parts of the channel layer. This picture is by no means complete, and I will probably revisit it several times over the next couple of posts. It should however provide you with a better understanding of what we are trying to accomplish in what part of the channel layer. And remember, this picture is a sketch and may not be 100% exact or correct.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.alexthissen.nl/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/main/image_5F00_542E2B31.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://www.alexthissen.nl/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/main/image_5F00_thumb_5F00_234B73C6.png" width="673" height="248" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;What you see in the picture is the client-side of the WCF channel layer. I am trying to convey here that from the method call to the actual transport several things happen along the way. &lt;/p&gt;  &lt;p&gt;First of all, when you call a service (or something else at the other end of the transport) you make a method invocation on a proxy. This might be &lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;a raw transparent proxy like we created in the first part of the series with a call to ChannelFactory&amp;lt;T&amp;gt;.CreateChannel. &lt;/li&gt;    &lt;li&gt;a ClientBase derived proxy, like the one you get when you use Add Service Reference (ASR). This proxy uses the same transparent proxy on the inside.&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;This method call is translated to a message object representing the method call. This message is dropped into a stack of channels that will massage the message every which way. The different channels in the stack all have their specific purpose, such as security, reliable sessions, or transport. The last channel in the stack is always the transport channel. The final transport channel will encode the message using an encoder and will serialize the bytes across the transport, whatever that may be (HTTP, MSMQ, TCP, UDP, email, …). &lt;/p&gt;  &lt;p&gt;For Request/Reply message exchange patterns there will come a stream of bytes in response. The stream will be decoded by the message encoder, which gives another message object. The same holds true for duplex messaging, but for duplex the incoming request stream might be initiated by the service, without a previous message from us, the client. We will not encounter duplex/callback messages. Finally, the response message will be turned into the completion of the method call by yielding the return value and ref or out parameters. The method call returns to the caller. You may have guessed that this is for synchronous method calls on the proxy and you are absolutely correct. For now, we will leave asynchronous operations out of scope.&lt;/p&gt;  &lt;p&gt;For each of the following posts I will highlight the area that we focus upon. Any feedback is welcome.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.alexthissen.nl/aggbug.aspx?PostID=22513" width="1" height="1"&gt;</content><author><name>alexthissen</name><uri>http://www.alexthissen.nl/members/alexthissen/default.aspx</uri></author><category term="Gaming" scheme="http://www.alexthissen.nl/blogs/main/archive/tags/Gaming/default.aspx" /><category term="Protocols" scheme="http://www.alexthissen.nl/blogs/main/archive/tags/Protocols/default.aspx" /><category term=".NET FX 3.5 SP1" scheme="http://www.alexthissen.nl/blogs/main/archive/tags/.NET+FX+3.5+SP1/default.aspx" /><category term="WCF" scheme="http://www.alexthissen.nl/blogs/main/archive/tags/WCF/default.aspx" /></entry></feed>
