<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0"><channel><atom:link rel="hub" href="http://tumblr.superfeedr.com/" xmlns:atom="http://www.w3.org/2005/Atom"/><description>My name is Yavor Georgiev and I am a Program Manager at Microsoft working on the Windows Azure web services stack. I am responsible for web services support in Silverlight and jQuery clients, as well as support for writing Node.js services on Azure.Follow me on Twitter at @digthepony</description><title>Yavor Georgiev's Blog</title><generator>Tumblr (3.0; @yavor)</generator><link>http://hashtagfail.com/</link><item><title>beat-machine:

Our pitch at Startup Weekend Redmond
</title><description>&lt;iframe src="http://www.9slides.com/embed/BeatMachinePresentation" width="400" height="251" frameborder="0"&gt;&lt;/iframe&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;&lt;a class="tumblr_blog" href="http://beat-machine.tumblr.com/post/17970708907/our-pitch-at-startup-weekend-redmond"&gt;beat-machine&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Our pitch at Startup Weekend Redmond&lt;/p&gt;
&lt;/blockquote&gt;</description><link>http://hashtagfail.com/post/18035928578</link><guid>http://hashtagfail.com/post/18035928578</guid><pubDate>Tue, 21 Feb 2012 15:37:10 -0800</pubDate><category>Presentations</category></item><item><title>beat-machine:

3rd place at Startup Weekend Redmond… not bad for...</title><description>&lt;img src="http://28.media.tumblr.com/tumblr_lzomoiXz641rpmn1ro1_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;&lt;a class="tumblr_blog" href="http://beat-machine.tumblr.com/post/17937943425/3rd-place-at-startup-weekend-redmond-not-bad-for"&gt;beat-machine&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;3rd place at Startup Weekend Redmond… not bad for a crew of 4&lt;/p&gt;
&lt;/blockquote&gt;</description><link>http://hashtagfail.com/post/18035386372</link><guid>http://hashtagfail.com/post/18035386372</guid><pubDate>Tue, 21 Feb 2012 15:28:40 -0800</pubDate><category>Presentations</category></item><item><title>Azure SDK for Node.js 0.5.3 is out</title><description>&lt;p class="MsoNormal"&gt;We just pushed out a small February update (0.5.3) to the &lt;a href="https://github.com/WindowsAzure/azure-sdk-tools"&gt;Azure SDK for Node.js&lt;/a&gt;, containing the following fixes:&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;&lt;strong&gt;&lt;a href="https://github.com/WindowsAzure/azure-sdk-tools/issues/81"&gt;#81&lt;/a&gt;: Start-AzureEmulator errors if there’s a space in the service path: &lt;/strong&gt;we corrected an issue where the emulator would fail if there was a space in the path to the service&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href="https://github.com/WindowsAzure/azure-sdk-tools/issues/82"&gt;#82&lt;/a&gt;: Remove-AzureService prompts for yes/no confirmation:&lt;/strong&gt; when you want to remove a service, you will now see this prompt to prevent accidental data loss:
&lt;pre class="brush: bash"&gt;Confirm
Are you sure you want to remove service "foo"?
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help
(default is "Y"):Y
&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href="https://github.com/WindowsAzure/azure-sdk-tools/issues/131"&gt;#131&lt;/a&gt;: Start-AzureEmulator -Launch fails if run twice on the same web role: &lt;/strong&gt;corrected a problem where our attempt to clean up logs was causing the emulator to crash&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href="https://github.com/WindowsAzure/azure-sdk-tools/issues/138"&gt;#138&lt;/a&gt;: Publish-AzureService throws ArgumentNullException when no certificates element provided in .cscfg:&lt;/strong&gt; this may have affected folks using the Mongo commandlets&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href="https://github.com/WindowsAzure/azure-sdk-tools/issues/141"&gt;#141&lt;/a&gt;: Worker role did not allow write access:&lt;/strong&gt; the user under which Node was running in worker role did not have sufficient permission to write to disk. This may have surfaced as some modules who need to write to disk (such as stylus) failing.&lt;/li&gt;
&lt;/ul&gt;&lt;ul&gt;&lt;/ul&gt;&lt;p&gt;&lt;strong&gt;&lt;a href="http://www.microsoft.com/web/gallery/install.aspx?appid=azurenodepowershell"&gt;Here is a one-click install of the new bits.&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;Alongside this, we also released a refresh (0.5.2) of the &lt;a href="https://github.com/WindowsAzure/azure-sdk-for-node/"&gt;npm package for Azure&lt;/a&gt;, adding support for accessing ServiceBus queues and topics, among other fixes. Read &lt;a href="http://codebetter.com/glennblock/2012/02/14/servicebus-support-in-azure-npm-0-5-2/"&gt;Glenn’s blog post&lt;/a&gt; for more details.&lt;/p&gt;</description><link>http://hashtagfail.com/post/17781848569</link><guid>http://hashtagfail.com/post/17781848569</guid><pubDate>Fri, 17 Feb 2012 13:16:25 -0800</pubDate><category>JavaScript</category><category>Windows Azure</category></item><item><title>One of the most beautiful libraries in the world (Codrington...</title><description>&lt;img src="http://27.media.tumblr.com/tumblr_lx9g7h554K1qd717fo1_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;One of the most beautiful libraries in the world (Codrington Library at Oxford). UW’s Suzzallo library also made the list.&lt;/p&gt;</description><link>http://hashtagfail.com/post/15284595106</link><guid>http://hashtagfail.com/post/15284595106</guid><pubDate>Tue, 03 Jan 2012 22:18:53 -0800</pubDate><category>Architecture</category></item><item><title>Node.js/express blog on Azure in 5 minutes</title><description>&lt;p&gt;Following up on the announcements and demos shown at today’s &lt;a href="http://channel9.msdn.com/events/windowsazure/learn" title="Learn Windows Azure event on Channel 9"&gt;Learn Windows Azure event&lt;/a&gt;, I decided to put together a very quick demo that gets you going on Azure with a real app as fast as possible. &lt;/p&gt;
&lt;p&gt;I decided to modify &lt;a href="http://expressjs.com/" title="express"&gt;express’&lt;/a&gt; &lt;a href="https://github.com/visionmedia/express/tree/master/examples/blog" title="express blog sample"&gt;blog sample&lt;/a&gt; to use &lt;a href="http://github.com/WindowsAzure/azure-sdk-for-node" title="Azure node libraries"&gt;Azure storage&lt;/a&gt;, and also pre-configured all the service/role settings that Azure needs so you can get going as fast as possible.&lt;/p&gt;
&lt;p&gt;Here is the 5-minute recipe:&lt;/p&gt;
&lt;ol&gt;&lt;li&gt;Get your &lt;a href="http://www.windowsazure.com/en-us/pricing/free-trial/" title="Windows Azure portal"&gt;Windows Azure account&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Get the &lt;a href="http://www.windowsazure.com/en-us/develop/nodejs/" title="Windows Azure SDK for Node.js"&gt;Windows Azure SDK for Node.js&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Get the &lt;a href="https://github.com/yavorg/express-blog-azure" title="Express/Node sample on Azure"&gt;sample source code&lt;/a&gt; from GitHub. If you are wondering where some of the static content in the sample came from, check out this &lt;a href="http://www.windowsazure.com/en-us/develop/nodejs/tutorials/web-app-with-express/" title="Azure Node getting started"&gt;getting started document&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Get the needed Node packages by running this inside the &lt;strong&gt;ExpressBlog\WebRole&lt;/strong&gt; folder:&lt;br/&gt;&lt;pre class="brush: bash"&gt;npm install&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;You should now be able to launch the &lt;strong&gt;Windows Azure PowerShell for Node.js&lt;/strong&gt; shortcut from your start menu. Make sure you run as Administrator. The rest of the steps here should be completed from that shell.&lt;/li&gt;
&lt;li&gt;Download your Azure publish settings:&lt;br/&gt;&lt;pre class="brush: bash"&gt;Get-AzurePublishSettings&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;Import the settings:&lt;br/&gt;&lt;pre class="brush: bash"&gt;Import-AzurePublishSettings mine.publishsettings&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;Head to the Azure portal and create a storage account under your subscription. Make note of the account name and access key.&lt;/li&gt;
&lt;li&gt;Modify the &lt;strong&gt;ExpressBlog\WebRole\Web.cloud.config&lt;/strong&gt; file where indicated to include the storage settings.&lt;/li&gt;
&lt;li&gt;You are now ready to publish. Anywhere inside the &lt;strong&gt;ExpressBlog&lt;/strong&gt; folder, run the following, making sure you use a &lt;span&gt;unique service name&lt;/span&gt;:&lt;br/&gt;&lt;pre class="brush: bash"&gt;Publish-AzureService -Name uniqueServiceName&lt;/pre&gt;
&lt;/li&gt;
&lt;/ol&gt;&lt;p&gt;You’re all done!&lt;img alt="A Node/Express blog on Azure" src="http://media.tumblr.com/tumblr_lw60nrIUBC1qccglw.png"/&gt;&lt;/p&gt;
&lt;p&gt;Unfortunately things don’t always go according to plan, so in case you get an Internal Server Error or anything else goes wrong after you deploy to the cloud, use this simple trick to debug.&lt;/p&gt;
&lt;ol&gt;&lt;li&gt;Inside the &lt;strong&gt;Web.cloud.config&lt;/strong&gt; file, enable logging:&lt;br/&gt;&lt;pre class="brush: xml"&gt;&lt;iisnode loggingEnabled="true" /&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;Redeploy the service by simply typing:&lt;br/&gt;&lt;pre class="brush: bash"&gt;Publish-AzureService&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;Look at the Node.js log file for hints of what may be wrong at &lt;a href="http://uniqueServiceName.cloudapp.net/server.js.logs/0.txt"&gt;http://uniqueServiceName.cloudapp.net/server.js.logs/0.txt&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;div&gt;&lt;/div&gt;</description><link>http://hashtagfail.com/post/14183649394</link><guid>http://hashtagfail.com/post/14183649394</guid><pubDate>Tue, 13 Dec 2011 14:34:00 -0800</pubDate><category>JavaScript</category><category>Windows Azure</category></item><item><title>RIA Services SP2 RTW released</title><description>&lt;p&gt;We’re happy to announce the final release of WCF RIA Services V1 SP2:&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;&lt;strong&gt;&lt;a href="http://go.microsoft.com/fwlink/?LinkId=229318" title="Silverlight 5 Tools"&gt;Silverlight 5 tools installer&lt;/a&gt;&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href="http://go.microsoft.com/fwlink/?LinkId=215202" title="RIA Services SP2"&gt;Standalone RIA SP2 installer&lt;/a&gt;&lt;/strong&gt; &lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;In this release, we add the following new features:&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;Support for Silverlight 5 (the standalone installer linked above also supports Silverlight 4)&lt;/li&gt;
&lt;li&gt;DateTimeOffset support + various bugfixes&lt;/li&gt;
&lt;li&gt;&lt;span&gt;&lt;span&gt;Entity Framework Code-First development, using &lt;a href="http://nuget.org/packages/RIAServices.EntityFramework" title="RIAServices.EntityFramework NuGet package"&gt;this NuGet package&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;p class="MsoListParagraph"&gt;Known issues include:&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;&lt;span&gt;&lt;span&gt;Entity Framework 4.1 is required, but version 4.2 isn’t supported yet&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;&lt;span&gt;Requires Visual Studio 2010 or SP1. Visual Studio 11 isn’t supported yet&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;&lt;span&gt;Work on supporting Universal Providers for improved Windows Azure deployment is ongoing&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;If you want to create a Silverlight 4 Business Application Template, first create an instance of the Silverlight 5 template, and then use the Silverlight project properties to retarget it to Silverlight 4. You might see some temporary errors (System.Windows.Markup.XamlParseException) in the designer and error window, but rebuilding will make those disappear.&lt;/li&gt;
&lt;/ul&gt;</description><link>http://hashtagfail.com/post/13978432034</link><guid>http://hashtagfail.com/post/13978432034</guid><pubDate>Fri, 09 Dec 2011 12:13:00 -0800</pubDate><category>Silverlight</category><category>WCF RIA Services</category></item><item><title>Street Art Utopia - cool street art and graffiti blog</title><description>&lt;img src="http://25.media.tumblr.com/tumblr_lxaqlaLAdP1qd717fo1_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;Street Art Utopia - cool street art and graffiti blog&lt;/p&gt;</description><link>http://hashtagfail.com/post/15313429738</link><guid>http://hashtagfail.com/post/15313429738</guid><pubDate>Fri, 09 Dec 2011 00:00:00 -0800</pubDate><category>Design</category></item><item><title>Amazing ISS time-lapse</title><description>&lt;iframe src="http://player.vimeo.com/video/32001208" width="400" height="225" frameborder="0"&gt;&lt;/iframe&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;Amazing ISS time-lapse&lt;/p&gt;</description><link>http://hashtagfail.com/post/12919631560</link><guid>http://hashtagfail.com/post/12919631560</guid><pubDate>Thu, 17 Nov 2011 00:31:00 -0800</pubDate><category>Photography</category></item><item><title>Trying to clone a repo using the GitHub for Mac client at work...</title><description>&lt;img src="http://24.media.tumblr.com/tumblr_lu5gxjcrXl1qd717fo1_500.png"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;Trying to clone a repo using the GitHub for Mac client at work today was failing due to our proxy server. All my repos would show up, but they would fail when cloning, and trying to synchronize wouldn’t work either. I know I am sitting behind a HTTP proxy at work, but I assumed the GitHub client would just inherit the proxy settings already defined in the OSX preferences. Apparently not… so I hunted around the app to try and find dedicated proxy settings. Again, no luck here, but after looking around forums I discovered you could use the command line to set the proxy:&lt;/p&gt;
&lt;pre class="brush: bash"&gt;git config --global http.proxy http://proxy:port
&lt;/pre&gt;
&lt;p&gt;I restarted the GitHub client, and now it would happily clone and sync my repos. &lt;/p&gt;</description><link>http://hashtagfail.com/post/12333547822</link><guid>http://hashtagfail.com/post/12333547822</guid><pubDate>Fri, 04 Nov 2011 12:03:00 -0700</pubDate></item><item><title>"Active" Federation with Silverlight, WCF, and WIF</title><description>&lt;p&gt;In &lt;a title="RIA Services active federation" href="http://hashtagfail.com/post/5441929717/ria-services-active-federation"&gt;this post&lt;/a&gt; I provided a description of the active federation authentication pattern and shared how to implement it with RIA Services. In this post I will show how to do the same but use a regular WCF service instead of a RIA Services DomainService. I am including the diagram from my last post, with some minimal modifications here.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Active federation flow with Silverlight, WCF, and WIF" src="http://media.tumblr.com/tumblr_lsmur0bKCd1qccglw.png"/&gt;&lt;/p&gt;
&lt;p&gt;I should clarify why I am putting the word active in quotation marks. The following will only make sense if you understand the difference between passive and active federation, which is outlined in the post linked above. In the &lt;strong&gt;passive &lt;/strong&gt;federation case, the user never enters their credentials in the client app; they are redirected to the STS of the identity provider organization. This way the user is providing their credentials directly to the party they trust, and not to the app, which they may not trust. In the &lt;strong&gt;active &lt;/strong&gt;federation case, they actually provide their credentials to the client app, and trust that the app will not be malicious, and will simply forward those credentials to the STS of the identity provider. The client app is responsible for creating a secure login UI, and also for securely transmitting the credentials to the STS. That is a lot of responsibility, and in traditional active federation scenarios, the client app uses &lt;em&gt;strong encryption&lt;/em&gt; to guarantee the secure transfer of credentials. Still, lots of users may be reluctant to type in their credentials into a client app they don’t trust.&lt;/p&gt;
&lt;p&gt;In this example I show how to do the active federation flow, and my client app does collect the credentials. I have hand-rolled my login UI, and cannot make any guarantees as to how secure it actually is. For the communication with the server, I simply use HTTPS, instead of more comprehensive message-level security. So my example reaps the convenience of the active flow (no need to redirect the user to a different page, login happens in-app), however may not provide the traditional security guarantees associated with it. Hence “active”. &lt;/p&gt;
&lt;p&gt;&lt;em&gt;What I provide here may be perfectly secure for many scenarios but is up to you, the developer, to assess if this particular setup satisfies the requirements of your users and your organization. &lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Now some specifics of the sample. It’s a simple app that can draw squares on the screen according to a &lt;a title="Fibonacci numbers on Wikipedia" href="http://en.wikipedia.org/wiki/Fibonacci_number"&gt;Fibonacci&lt;/a&gt; tiling. There are two registered users: &lt;strong&gt;fabrikam\yavor&lt;/strong&gt; and &lt;strong&gt;fabrikam\test&lt;/strong&gt; and the password for both of them is &lt;strong&gt;12345&lt;/strong&gt;. Both can log into the app, however only the fabrikam\yavor user is in the role &lt;strong&gt;Calculators&lt;/strong&gt;, meaning people who can carry out calculations on the service. This is enforced by the following attribute on the service’s &lt;strong&gt;GetSequence&lt;/strong&gt; method.&lt;/p&gt;
&lt;pre class="brush: csharp"&gt;[PrincipalPermission(SecurityAction.Demand, Authenticated = true, Role = "Calculators")]
public int[] GetSequence(int max)&lt;/pre&gt;
&lt;p&gt;The bottom line here is that even though we have a STS with external user authentication, we kept authorization local to our app (we use ASP.NET roles). That’s a choice you can make as a developer - you can also externalize the user roles (or claims) as part of the STS, or keep them local.&lt;/p&gt;
&lt;p&gt;There are lots of extra details in the app, which you’ll see by exploring the source.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;a title="Download sample" href="http://archive.msdn.microsoft.com/Project/Download/FileDownload.aspx?ProjectName=silverlightws&amp;DownloadId=15744"&gt;The code is available here.&lt;/a&gt;&lt;/strong&gt; The solution should be fairly self-contained, so all you need to run it is Visual Studio 2010 and the &lt;a title="WIF download" href="http://msdn.microsoft.com/en-us/security/aa570351"&gt;Windows Identity Foundation Runtime&lt;/a&gt;. Here are some additional notes on the structure of the sample:&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;First, please run the included &lt;strong&gt;SetupCertificates.cmd&lt;/strong&gt; script inside the &lt;strong&gt;Scripts&lt;/strong&gt; folder&lt;/li&gt;
&lt;li&gt;The solution will create two applications in your local IIS instance: &lt;strong&gt;FibonacciService &lt;/strong&gt;and &lt;strong&gt;IdentityProviderAndSts&lt;/strong&gt;. Make sure you launch Visual Studio as &lt;strong&gt;Administrator&lt;/strong&gt;, so it has permission to create those. Also make sure you enable &lt;strong&gt;HTTPS&lt;/strong&gt; so both of the applications in the &lt;strong&gt;IIS Manager&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;I want to credit the folks behind the &lt;a title="Download the Identity Developer Training Kit" href="http://go.microsoft.com/fwlink/?LinkId=148795"&gt;Identity Developer Training Kit&lt;/a&gt;, from where I shamelessly stole some code.&lt;/p&gt;</description><link>http://hashtagfail.com/post/11094642160</link><guid>http://hashtagfail.com/post/11094642160</guid><pubDate>Thu, 06 Oct 2011 00:30:00 -0700</pubDate><category>WCF</category><category>Silverlight</category></item><item><title>Hosting WCF NetTcp services in Azure with a Silverlight client</title><description>&lt;p&gt;&lt;em&gt;&lt;strong&gt;UPDATE: Folks from the Windows Azure team have &lt;a title="NetTcp in WebRole" href="http://blogs.msdn.com/b/windowsazure/archive/2011/06/27/hosting-services-with-was-and-iis-on-windows-azure.aspx"&gt;posted an improved solution for how to host NetTcp services in Azure by using a WebRole instead of a WorkerRole&lt;/a&gt;, which simplifies the setup quite a bit.&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Silverlight 4 added support for WCF’s &lt;a title="NetTcpBinding on MSDN" href="http://msdn.microsoft.com/en-us/library/system.servicemodel.nettcpbinding.aspx"&gt;NetTcpBinding&lt;/a&gt;, which is a performant and scalable TCP-based binding. It is also a useful binding when used in Windows Azure because it is not affected by Azure’s random load-balancer when using multiple instances of the service and creates an effectively pinned duplex connection to the cloud. The only disadvantage of the NetTcp binding is that it Silverlight does not support TCP transport security, so all the traffic to the web service is unsecured and can be intercepted by malicious parties. That may or may not be acceptable for your application.&lt;/p&gt;
&lt;p&gt;I put together a sample on how to host a NetTcp service in Azure and consume it using a Silverlight client. The first thing to keep in mind here, is that Silverlight has some &lt;strong&gt;networking restrictions&lt;/strong&gt; for security reasons. One of this restrictions is that if you want to speak TCP to a server, the server has to expose a policy file over port 80 explicitly listing the ports that it allows TCP for. Moreover, the ports have to be in the range 4502-4530. In other words if my Silverlight app wants to talk to net.tcp://contoso.cloudapp.net:4502, then I need to expose a policy file at &lt;a href="http://contoso.cloudapp.net:80"&gt;http://contoso.cloudapp.net:80&lt;/a&gt;. &lt;/p&gt;
&lt;p&gt;Another interesting concern here is that hosting WCF NetTcp services is only allowed in Azure &lt;strong&gt;Worker Roles&lt;/strong&gt;. This is because the Azure Web Role (which is basically an IIS instance) does not have WCF non-HTTP activation enabled.&lt;/p&gt;
&lt;p&gt;My sample actually shows two separate approaches on how to implement this. If you already have an external web server where you host static HTML content as well as your Silverlight XAP file, the sample shows an approach using a &lt;strong&gt;single Worker Role.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;img src="http://media.tumblr.com/tumblr_llbbm2ucTM1qccglw.png" alt="NetTcp service in Azure with Silverlight with single Worker Role"/&gt;&lt;br/&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Now if you don’t have an existing webpage, you are probably already considering a Web Role, where you can host the static HTML files and Silverlight XAP file. In that case we can make our life easier by reusing that WebRole to host the clientaccesspolicy.xml file as well. This diagram shows that approach: &lt;strong&gt;Web Role + Worker Role.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="http://media.tumblr.com/tumblr_llbbs8MmDI1qccglw.png" alt="NetTcp service in Azure with Silverlight with a Web Role + Worker Role"/&gt;&lt;/p&gt;
&lt;p&gt;To run the sample, you need to install the following:&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;Visual Studio 2010&lt;/li&gt;
&lt;li&gt;Windows Azure SDK v1.4&lt;/li&gt;
&lt;li&gt;Windows Azure Tools for Microsoft Visual Studio 2010 Platform v1.4&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;Keep in mind that when you run the sample locally in the development fabric, it will not run correctly, because the the emulator cannot use port 80. Since the policy file has to be hosted on port 80, calls from Silverlight to the service will fail. This gets resolved when you publish the sample to the cloud.&lt;/p&gt;
&lt;p&gt;&lt;a title="Sample download" href="http://archive.msdn.microsoft.com/Project/Download/FileDownload.aspx?ProjectName=silverlightws&amp;DownloadId=15397"&gt;You can get the sample code here.&lt;/a&gt; &lt;/p&gt;</description><link>http://hashtagfail.com/post/5560439794</link><guid>http://hashtagfail.com/post/5560439794</guid><pubDate>Mon, 16 May 2011 17:23:00 -0700</pubDate><category>WCF</category><category>Silverlight</category><category>Windows Azure</category></item><item><title>Active Federation using RIA Services and WIF</title><description>&lt;p&gt;&lt;strong&gt;&lt;em&gt;UPDATE: A coworker here at Microsoft has brought up some interesting thoughts regarding this approach, and I’ve added a brief discussion below the second diagram.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Recently I decided to experiment with RIA Services in federated authentication scenarios. For those of you that aren’t familiar with federation, let’s consider the following scenario: my company Contoso builds an expense reporting application that I host in the cloud. One day I get Fabrikam to sign up as a client, and now I have to onboard all Fabrikam employees onto my system. It is true that I could create a login for every employee, but that is impractical because Fabrikam employees have to remember that extra login, and also I would need to keep my list of logins in sync when employees join or leave Fabrikam.&lt;/p&gt;
&lt;p&gt;The solution for this is &lt;strong&gt;federated authentication&lt;/strong&gt;, where my app can use a third-party (Fabrikam’s) authentication provider (also known as a Security Token Service or STS) to authenticate users. I won’t try to explain federation from scratch, because Microsoft’s patterns &amp; practices has a &lt;a title="patterns &amp; practices introduction to federation" href="http://msdn.microsoft.com/en-us/library/ff359101.aspx"&gt;great write-up&lt;/a&gt;. You can squint and ignore some of the claims stuff as it’s not super relevant to what I’m describing here.&lt;/p&gt;
&lt;p&gt;To build an app with federated auth using RIA Services, most folks resort to &lt;strong&gt;passive federation&lt;/strong&gt;, which you might be familiar with from using things like your LiveID login. The passive approach is browser-friendly and uses a combination of cookies, URIs and redirects to log you in to the site you’re trying to access.  The downside in the case of Silverlight is that you cannot complete the login inside your app: you have to navigate away from the Silverlight control, type in your credentials into a HTML (or ASPX) page, and then be bounced back by your browser to reload the control. Another downside is that you need to host a HTML page for the user to type in their credentials, in addition to the Silverlight app and the web services, which might not be desirable.&lt;/p&gt;
&lt;p&gt;The following diagram has a more detailed explanation of the exact flow that happens during the passive scenario:&lt;/p&gt;
&lt;p&gt;&lt;img alt="Passive federation with RIA Services" src="http://media.tumblr.com/tumblr_ll3zirBuBj1qccglw.png"/&gt;&lt;/p&gt;
&lt;p&gt;From what I’ve seen, most folks use this passive pattern with RIA today. Eugenio Pace’s blog &lt;a title="Passive federation with RIA Services" href="http://blogs.msdn.com/search/searchresults.aspx?q=RIA%20Services%20&amp;sections=3815"&gt;has a few great write-ups and demos that you can try out&lt;/a&gt;. Some are a bit dated, but you should be able to find your way around.&lt;/p&gt;
&lt;p&gt;What I wanted to try out was the &lt;strong&gt;active federation&lt;/strong&gt; case, in which the Silverlight app talks dirctly to the identity provider. This has the benefit of having the user type their credentials directly into the Silverlight app, without having to leave the page, which results in a more polished and faster user experience. Eventually, as the crypto support in Silverlight improves, it may end up being a more secure solution as well, if we are able to encrypt and sign the tokens that are being exchanged. The following diagram demonstrates the slightly different message flow in the active case. Note that the app itself is doing most of the work, not the browser.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Active federation with RIA Services" src="http://media.tumblr.com/tumblr_ll414g0h4u1qccglw.png"/&gt;&lt;/p&gt;
&lt;p&gt;Some interesting considerations emerged in conversation with Robert O’Brien, an architect here at Microsoft. Please consider these before building your own app:&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;One of the things we gain in this approach over a passive federation approach is the ability to log the user in from inside our UI. That provides for a better user experience, but it also puts the burden on our app to expose a credentials UI and pass the token over to the service. Potentially this could be a security risk for our app. Some folks believe that this goes against the spirit of federated authentication since it takes control away from the identity provider.&lt;/li&gt;
&lt;li&gt;The implementation shown here relies on WS-Trust as the protocol for the token. Unfortunately in today’s federated web, it seems like only ADFS and maybe OpenID servers honor that protocol. If you are trying to use WS-Trust and use Facebook/Yahoo/Google (either directly or through Azure’s Access Control Service) as the identity provider, you will find that WS-Trust is probably not supported. So outside the enterprise environment, this approach might not work.&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;Now some specifics of the sample. It’s a simple master/detail application that allows you to display and edit data. There are two registered users &lt;strong&gt;fabrikam\yavor&lt;/strong&gt; and &lt;strong&gt;fabrikam\test&lt;/strong&gt; and the password for both of them is &lt;strong&gt;12345&lt;/strong&gt;. If you don’t log in and try to display the data, you will get an error because of the &lt;strong&gt;EnableClientAccess &lt;/strong&gt;attribute.&lt;/p&gt;
&lt;pre class="brush: csharp"&gt;[RequiresAuthentication]
[EnableClientAccess()]
public class CustomersService : LinqToEntitiesDomainService&lt;AdventureWorksLT2008R2Entities&gt;&lt;/pre&gt;
&lt;p&gt;All authenticated users can view the data, but only users in the Editor role can make changes to it. Only the user &lt;strong&gt;fabrikam\yavor &lt;/strong&gt;is in that role.&lt;/p&gt;
&lt;pre class="brush: csharp"&gt;[RequiresRole("Editors")]
public void UpdateCustomer(Customer currentCustomer)
&lt;/pre&gt;
&lt;p&gt;The bottom line here is that even though we have a STS with external user authentication, we kept authorization local to our app (we use ASP.NET roles). That’s a choice you can make as a developer - you can also externalize the user roles (or claims) as part of the STS, or keep them local.&lt;/p&gt;
&lt;p&gt;There are lots of extra details in the app, which you’ll see by exploring the source.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;a title="Sample download" href="http://code.msdn.microsoft.com/Active-Federation-using-bfaaea97"&gt;The code is available here.&lt;/a&gt;&lt;/strong&gt; Note that you need the following installed on your machine for it to work:&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;Visual Studio 2010&lt;/li&gt;
&lt;li&gt;SQL Server 2008 R2 Express&lt;/li&gt;
&lt;li&gt;SQL Server 2008 R2 Management Studio Express &lt;/li&gt;
&lt;li&gt;WCF RIA Services V1 SP1/SP2&lt;/li&gt;
&lt;li&gt;&lt;a title="WIF download" href="http://msdn.microsoft.com/en-us/security/aa570351"&gt;Windows Identity Foundation Runtime&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a title="AdventureWorks LT database sample" href="http://msftdbprodsamples.codeplex.com/releases/view/55926"&gt;The AdventureWorks LT 2008R2 database for SQL Server Express 2008 R2&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;Here are some additional notes on the structure of the sample:&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;First, please run the included &lt;strong&gt;SetupCertificates.cmd&lt;/strong&gt; script inside the &lt;strong&gt;Scripts&lt;/strong&gt; folder&lt;/li&gt;
&lt;li&gt;The solution will create two applications in your local IIS instance: &lt;strong&gt;AddressBookFederatedAuth &lt;/strong&gt;and &lt;strong&gt;IdentityProviderAndSts&lt;/strong&gt;. Make sure you launch Visual Studio as &lt;strong&gt;Administrator&lt;/strong&gt;, so it has permission to create those. Also make sure you enable &lt;strong&gt;HTTPS&lt;/strong&gt; so both of the applications in the &lt;strong&gt;IIS Manager&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Change the &lt;strong&gt;Application pool &lt;/strong&gt;under which those applications are running to use the &lt;strong&gt;Network Service&lt;/strong&gt; account. &lt;/li&gt;
&lt;li&gt;Use SQL Server Management Studio, make sure &lt;strong&gt;Network Service&lt;/strong&gt; is added as a login to your SQL instance. When you add the account, make sure you give him some sane Server Roles (for example &lt;strong&gt;sysadmin&lt;/strong&gt;). Let me know in the comments if you find any of these steps difficult and I can provide more detailed instructions.&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;I want to credit &lt;a title="Eugenio's blog" href="http://blogs.msdn.com/b/eugeniop/"&gt;Eugenio Pace&lt;/a&gt;, &lt;a title="Kyle's blog" href="http://blogs.msdn.com/b/kylemc/"&gt;Kyle McClellan&lt;/a&gt;, and the folks behind the &lt;a title="Download the Identity Developer Training Kit" href="http://go.microsoft.com/fwlink/?LinkId=148795"&gt;Identity Developer Training Kit&lt;/a&gt;, from where I shamelessly stole some code.&lt;/p&gt;</description><link>http://hashtagfail.com/post/5441929717</link><guid>http://hashtagfail.com/post/5441929717</guid><pubDate>Thu, 12 May 2011 21:06:00 -0700</pubDate><category>WCF RIA Services</category><category>Silverlight</category></item><item><title>Debugging SGEN LoaderExceptions errors</title><description>&lt;p&gt;Recently we were contacted by a customer who was building a Release version of their assembly in Visual Studio and encountered the following error:&lt;/p&gt;
&lt;p&gt;&lt;img src="http://media.tumblr.com/tumblr_lkspj38nwO1qccglw.png" alt="SGEN error in Visual Studio"/&gt;&lt;/p&gt;
&lt;p&gt;You could get the same error if you attempt to run the sgen.exe tool on the built assembly:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Microsoft (R) Xml Serialization support utility&lt;br/&gt;[Microsoft (R) .NET Framework, Version 4.0.30319.1]&lt;br/&gt;Copyright (C) Microsoft Corporation. All rights reserved.&lt;br/&gt;Error: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.&lt;/p&gt;
&lt;p&gt;If you would like more help, please type “sgen /?”.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;The reason why this happens is that in Release builds, Visual Studio attempts to generate a serialization assembly containing the types in your solution, to improve XmlSerializer serialization performance, should you choose to serialize your types. &lt;strong&gt;This can be disabled by going to the Build tab of the project properties and setting “Generate serialization assembly” to “Off”.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;However if you legitimately want to take advantage of the serialization assembly, this error can be very frustrating to diagnose. The exception text leads you to believe Fusion is having a problem loading one of the dependent assemblies that your assembly is referencing. That may be the case, and you can easily diagnose that problem by launching the &lt;strong&gt;Fusion Log Viewer&lt;/strong&gt;, then enabling assembly logging, and then rebuilding your project (or rerunning sgen.exe). &lt;a title="Hanselman on Fusion LoaderErros" href="http://www.hanselman.com/blog/BackToBasicsUsingFusionLogViewerToDebugObscureLoaderErrors.aspx"&gt;Scott Hanselman has a good write-up on how to do this.&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Sometimes after inspecting the Fusion log, you’ll see that all assemblies were infact loaded correctly, but you’re still getting this error. In recent investigation we found that sometimes sgen.exe will show this error, and it won’t have to do with an assembly loading problem. Here is how to get to the bottom of that case.&lt;/p&gt;
&lt;ol&gt;&lt;li&gt;In Visual Studio create a dummy &lt;strong&gt;Console Application&lt;/strong&gt;. We won’t actually use this, it’s just a way for us to start sgen.exe in the debugger.&lt;/li&gt;
&lt;li&gt;Go to the Debug tab of the project properties and set 
&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Start external program&lt;/strong&gt;= C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\NETFX 4.0 Tools\sgen.exe&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Command line arguments&lt;/strong&gt;= /f /a:MyAssembly.dll &lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Working directory&lt;/strong&gt;= C:\FolderContainingMyAssembly&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;li&gt;Configure the debugger to break on all exceptions by going to the &lt;strong&gt;Debug&lt;/strong&gt; menu and selecting &lt;strong&gt;Exceptions&lt;/strong&gt; and then checking &lt;strong&gt;Thrown&lt;/strong&gt; next to &lt;strong&gt;Common Language Runtime Exceptions&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Also ensure that if you go to &lt;strong&gt;Tools&lt;/strong&gt; &gt; &lt;strong&gt;Options&lt;/strong&gt; &gt; &lt;strong&gt;Debugging&lt;/strong&gt; that &lt;strong&gt;Enable Just My Code&lt;/strong&gt; is unchecked.&lt;/li&gt;
&lt;li&gt;Then you are ready to press &lt;strong&gt;F5&lt;/strong&gt;. If everything works correctly, Vistual Studio will break at an exception. Right click on &lt;strong&gt;sgen.exe &lt;/strong&gt;anywhere in the &lt;strong&gt;Call Stack &lt;/strong&gt;window and load the symbols from the &lt;strong&gt;Microsoft Symbol Servers&lt;/strong&gt;.&lt;br/&gt; &lt;img src="http://media.tumblr.com/tumblr_lksrk1Zm0P1qccglw.png" alt="Loading sgen.exe symbols"/&gt;&lt;/li&gt;
&lt;li&gt;Once the symbols have loaded, press F5 until you get to a &lt;strong&gt;ReflectionTypeLoadException&lt;/strong&gt;. At that point you can select &lt;strong&gt;View Details&lt;/strong&gt; and inspect the &lt;strong&gt;LoaderExceptions&lt;/strong&gt; property yourself. This property will usually reveal the real source of the problem:&lt;br/&gt;&lt;img src="http://media.tumblr.com/tumblr_lksru3zrry1qccglw.png" alt="ReflectionTypeLoadException details"/&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;p&gt;Hope this is useful!&lt;/p&gt;</description><link>http://hashtagfail.com/post/5255977780</link><guid>http://hashtagfail.com/post/5255977780</guid><pubDate>Fri, 06 May 2011 16:33:00 -0700</pubDate><category>WCF</category></item><item><title>The time lapse aside, even capturing individual shots of the...</title><description>&lt;iframe src="http://player.vimeo.com/video/22439234" width="400" height="225" frameborder="0"&gt;&lt;/iframe&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;The time lapse aside, even capturing individual shots of the Milky Way looking like that is amazing. Long exposure + RAW?&lt;/p&gt;</description><link>http://hashtagfail.com/post/4757332085</link><guid>http://hashtagfail.com/post/4757332085</guid><pubDate>Tue, 19 Apr 2011 14:57:28 -0700</pubDate><category>Photography</category></item><item><title>RIA Services T4 template to copy comments from server to client</title><description>&lt;p&gt;As you know one of the new features in RIA Services V1 SP1 is support for T4 templates. The T4 template is a design-time artifact that can modify the way RIA Services client-side code generation happens. For more information on T4 templates, check out &lt;a title="T4 in RIA Services" href="http://jeffhandley.com/archive/2010/10/28/RiaServicesT4WalkUp.aspx"&gt;Jeff Handley’s blog post&lt;/a&gt; on the subject.&lt;/p&gt;
&lt;p&gt;Recently I was experimenting with RIA Services and I discovered that the IntelliSense comments for my entities were very sparse on the client. For example my Customer entity has a CompanyName property and the IntelliSense comment for that was:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Gets or sets the ‘CompanyName’ value. &lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;It was clear that this comment was being generated automatically, which was quite annoying because I had used my entity model on the server to carefully create useful comments for each property.&lt;/p&gt;
&lt;p&gt;&lt;img src="http://media.tumblr.com/tumblr_lj781cQW5O1qccglw.png" alt="EF designer showing property documentation"/&gt;&lt;/p&gt;
&lt;p&gt;I hear EF is actually smart enough that it supports defining these comments in the database itself, and they will get copied over when you create the model, but I haven’t tried it myself.&lt;/p&gt;
&lt;p&gt;So I set out to write a T4 template to take those comments from the server types generated by EF and copy them over to my Silverlight project.&lt;/p&gt;
&lt;p&gt;The first step was to tell Visual Studio to scrape all the types in my server project and generate a XML file containing their comments, by going to the&lt;strong&gt; Build&lt;/strong&gt; tab of project properties and checking this box: &lt;/p&gt;
&lt;p&gt;&lt;img src="http://media.tumblr.com/tumblr_lj78bhA4F41qccglw.png" alt="Enabling XML comments in project properties"/&gt;&lt;/p&gt;
&lt;p&gt;This file is usually used for IntelliSense, but you can open it up and the schema is pretty self-explanatory. Because code comments don’t get compiled into assemblies, this is the only way I know to tell VS to export the comments from my entities.&lt;/p&gt;
&lt;p&gt;The next step was to write a simple T4 template using RIA Services extensibility. What this does is that as it is about to generate a type on the client (which happens when you build), it will look up that type name and all its properties in the above XML file, and copy the comments over to the generated file.&lt;/p&gt;
&lt;pre class="brush: csharp"&gt;[DomainServiceClientCodeGenerator(typeof(CommentsClientCodeGenerator), "C#")]
public class CommentsClientCodeGenerator : CSharpClientCodeGenerator
{
    private XElement comments;

    public CommentsClientCodeGenerator()
    {
        comments = XElement.Load(new FileStream("..\\AddressBook.Web\\bin\\AddressBook.Web.XML", FileMode.Open));
    }

    protected override EntityGenerator EntityGenerator
    {
        get
        {
            return new CommentEntityGenerator(comments);
        }
    }

    public class CommentEntityGenerator : CSharpEntityGenerator
    {
        private XElement comments;

        public CommentEntityGenerator(XElement comments)
        {
            this.comments = comments;
        }

        private string PrintInnerXml(XElement element)
        {
            string[] lines = element.Nodes()
                .Aggregate("", (b, node) =&gt; b += node.ToString())
                .Split(new string[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries);
            StringBuilder sb = new StringBuilder();
            foreach(string line in lines)
            {
                sb.AppendLine(line.Trim().Insert(0, "///"));
            }
            return sb.ToString().Trim();
        }

        private XElement FindCommentElementByName(string name)
        {
            return comments
                .Descendants("member")
                .Where(x =&gt; String.Compare(x.Attributes("name").FirstOrDefault().Value.ToString(), name, true) == 0)
                .FirstOrDefault();
        }

        protected override void GenerateClassDeclaration()
        {
            XElement element = FindCommentElementByName("T:" + this.Type.FullName);
            if (element != null)
            {
                this.WriteLine(PrintInnerXml(element));
            }
            base.GenerateClassDeclaration();
        }

        protected override void GenerateProperty(PropertyDescriptor propertyDescriptor)
        {
            XElement element = FindCommentElementByName("P:" + propertyDescriptor.ComponentType.FullName + "." + propertyDescriptor.Name);
            if (element != null)
            {
                this.WriteLine(PrintInnerXml(element));
            }
            base.GenerateProperty(propertyDescriptor);
        }
    }
}
&lt;/pre&gt;
&lt;p&gt;That’s all I had to do… as soon as I started building this class (in its own project) inside my solution, the code comments I defined on the server started appearing in my Silverlight client.&lt;/p&gt;
&lt;p&gt;&lt;a title="T4 sample source code" href="http://archive.msdn.microsoft.com/RiaServices/Release/ProjectReleases.aspx?ReleaseId=5563"&gt;The code is available here.&lt;/a&gt; Note that you need the following installed on your machine for this to work:&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;Visual Studio 2010&lt;/li&gt;
&lt;li&gt;WCF RIA Services V1 SP1&lt;/li&gt;
&lt;li&gt;WCF RIA Services Tookit December 2010&lt;/li&gt;
&lt;li&gt;&lt;a title="AdventureWorks LT database sample" href="http://msftdbprodsamples.codeplex.com/releases/view/55926"&gt;The AdventureWorks LT database for SQL Server Express 2008 R2.&lt;/a&gt; You only need this if you want to actually run the sample.&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;Hope you find this useful!&lt;/p&gt;</description><link>http://hashtagfail.com/post/4374567871</link><guid>http://hashtagfail.com/post/4374567871</guid><pubDate>Tue, 05 Apr 2011 15:01:00 -0700</pubDate><category>WCF RIA Services</category><category>Silverlight</category></item><item><title>Презентацията ми за WCF и Silverlight от Дни на Microsoft '11</title><description>&lt;p&gt;Ето и презентацията ми за Silverlight и WCF услуги в Windows Azure. Очаквайте и демонстрациите скоро! Отдолу ще намерите презентацията и примерите които показах.&lt;/p&gt;
&lt;p&gt;&lt;iframe scrolling="no" frameborder="0" height="327" width="402" src="http://r.office.microsoft.com/r/rlidPowerPointEmbed?p1=1&amp;p2=1&amp;p3=SD6CE8988AF2E2E7C0!1854&amp;p4="&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Примери&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;&lt;a title="Hosting WCF NetTcp services in Azure with a Silverlight client" href="http://hashtagfail.com/post/5560439794/nettcp-azure-silverlight"&gt;Използване на WCF NetTcp услуги в Azure от Silverlight&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a title="Active Federation with Silverlight, WCF, and WIF" href="http://hashtagfail.com/post/5441929717/ria-services-active-federation"&gt;Федеративна сигурност с WCF и WIF&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</description><link>http://hashtagfail.com/post/4355823541</link><guid>http://hashtagfail.com/post/4355823541</guid><pubDate>Mon, 04 Apr 2011 19:20:00 -0700</pubDate><category>WCF</category><category>Silverlight</category><category>Presentations</category></item><item><title>Презентацията ми за WCF RIA Servces от Дни на Microsoft '11</title><description>&lt;p&gt;Благодаря на всички които дойдоха на моята презентация за RIA Services миналата седмица по време на &lt;a title="Дни на Microsoft '11" href="http://msbgregistration.com/"&gt;Дни на Microsoft ‘11&lt;/a&gt;. Отдолу ще намерите презентацията и примерите които показах.&lt;/p&gt;
&lt;p&gt;&lt;iframe scrolling="no" frameborder="0" height="327" width="402" src="http://r.office.microsoft.com/r/rlidPowerPointEmbed?p1=1&amp;p2=1&amp;p3=SD6CE8988AF2E2E7C0!1855&amp;p4="&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Примери&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;&lt;a title="T4 templates comments sample" href="http://hashtagfail.com/post/4374567871/t4-template-ria-services-comments"&gt;T4 templates за копиране на описания от сървърския RIA Services проект в Silverlight проекта&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a title="Active Federation using RIA Services and WIF" href="http://hashtagfail.com/post/5441929717/ria-services-active-federation"&gt;Федеративна сигурност с RIA Services и WIF&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</description><link>http://hashtagfail.com/post/4355678373</link><guid>http://hashtagfail.com/post/4355678373</guid><pubDate>Mon, 04 Apr 2011 19:15:00 -0700</pubDate><category>Presentations</category><category>WCF RIA Services</category><category>Silverlight</category></item><item><title>Accessing SharePoint UserProfileService from Windows Phone 7</title><description>&lt;p&gt;&lt;em&gt;&lt;strong&gt;UPDATE: … and it wasn’t long before Matthew McDermott went ahead and implemented ths as an actual sample, which you can get &lt;a title="Matthew's sample showing how to do this" href="http://www.ableblue.com/blog/archive/2011/03/18/silverlight-and-sharepoint-user-profile-service-guids.aspx"&gt;here&lt;/a&gt;.&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;A while back I &lt;a title="Workaround ASMX services using char and guid for Silverlight 4" href="http://blogs.msdn.com/b/silverlightws/archive/2010/05/26/workaround-for-accessing-some-asmx-services-from-silverlight-4.aspx"&gt;blogged a workaround&lt;/a&gt;for accessing some ASMX services from Silverlight 4. The problem was that the &lt;strong&gt;guid&lt;/strong&gt; and &lt;strong&gt;char &lt;/strong&gt;types that those services return are not recognized by Silverlight and you end up with the exception below. One of the important services affected by this is SharePoint’s UserProfileService, which I realize is pretty important to a lot of developers.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;System.ServiceModel.Dispatcher.NetDispatcherFaultException was unhandled by user code. The formatter threw an exception while trying to deserialize the message: There was an error while trying to deserialize parameter &lt;a href="http://tempuri.org/:HelloWorldResponse"&gt;&lt;a href="http://tempuri.org/:HelloWorldResponse"&gt;http://tempuri.org/:HelloWorldResponse&lt;/a&gt;&lt;/a&gt;. The InnerException message was ‘Error in line 1 position 268. Element ‘&lt;a href="http://tempuri.org/:HelloWorldResult'"&gt;&lt;a href="http://tempuri.org/:HelloWorldResult'"&gt;http://tempuri.org/:HelloWorldResult’&lt;/a&gt;&lt;/a&gt; contains data of the ‘&lt;a href="http://microsoft.com/wsdl/types/:guid'"&gt;&lt;a href="http://microsoft.com/wsdl/types/:guid'"&gt;http://microsoft.com/wsdl/types/:guid’&lt;/a&gt;&lt;/a&gt;data contract. The deserializer has no knowledge of any type that maps to this contract. Add the type corresponding to ‘guid’ to the list of known types - for example, by using the KnownTypeAttribute attribute or by adding it to the list of known types passed to DataContractSerializer.’.  Please see InnerException for more details.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;(Same goes for &lt;a href="http://microsoft.com/wsdl/types/:char"&gt;&lt;a href="http://microsoft.com/wsdl/types/:char"&gt;http://microsoft.com/wsdl/types/:char&lt;/a&gt;&lt;/a&gt;)&lt;/p&gt;
&lt;p&gt;We have already fixed this issue and you will not need the workaround anymore in the next version of Silverlight.&lt;/p&gt;
&lt;p&gt;In implementing the workaround, I used an &lt;a title="IClientMessageInspector over at MSDN" href="http://msdn.microsoft.com/en-us/library/system.servicemodel.dispatcher.iclientmessageinspector(v=VS.95).aspx"&gt;IClientMessageInspector&lt;/a&gt;, which unfortunately is only available starting in Silverlight 4. So all of our developers using Silverlight 3 (and in particular folks writing apps for Windows Phone 7) cannot use the workaround.&lt;/p&gt;
&lt;p&gt;Fortunately, there is a way to “fake” an IClientMessageInspector on older versions of Silverlight, and I wrote a sample for that back in the Silverlight 2 days. So combining these two samples together, you can be on your way:&lt;/p&gt;
&lt;ol&gt;&lt;li&gt;Create a “fake” IClientMessageInspector like in &lt;a title="Fake IClientMessageInspector sample for Silverlight 2" href="http://code.msdn.microsoft.com/Project/Download/FileDownload.aspx?ProjectName=silverlightws&amp;DownloadId=3473"&gt;this sample&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Use the IClientMessageInspector implementation that treats the &lt;strong&gt;guid&lt;/strong&gt; and &lt;strong&gt;char&lt;/strong&gt; types emitted by ASMX from &lt;a title="ASMX workaround sample for Silverlight 4" href="http://code.msdn.microsoft.com/Project/Download/FileDownload.aspx?ProjectName=silverlightws&amp;DownloadId=11647"&gt;this sample&lt;/a&gt;.&lt;/li&gt;
&lt;/ol&gt;&lt;p&gt;Hopefully this will unblock folks out there, if there is significant interest here I can create a combined sample that shows the whole thing end-to-end.&lt;/p&gt;</description><link>http://hashtagfail.com/post/3706541868</link><guid>http://hashtagfail.com/post/3706541868</guid><pubDate>Mon, 07 Mar 2011 12:05:00 -0800</pubDate><category>WCF</category><category>Silverlight</category><category>Windows Phone</category></item><item><title>Some cool shots from the Silverlight Firestarter event.</title><description>&lt;img src="http://26.media.tumblr.com/tumblr_lxekt1PAgm1qd717fo1_500.jpg"/&gt;&lt;br/&gt; &lt;br/&gt;&lt;img src="http://26.media.tumblr.com/tumblr_lxekt1PAgm1qd717fo2_500.jpg"/&gt;&lt;br/&gt; &lt;br/&gt;&lt;p&gt;Some &lt;a href="http://www.flickr.com/photos/johnpapa/5256583949/"&gt;cool&lt;/a&gt; &lt;a href="http://www.flickr.com/photos/johnpapa/5257194492/"&gt;shots&lt;/a&gt; from the Silverlight Firestarter event.&lt;/p&gt;</description><link>http://hashtagfail.com/post/15424013620</link><guid>http://hashtagfail.com/post/15424013620</guid><pubDate>Mon, 13 Dec 2010 00:00:00 -0800</pubDate><category>WCF</category><category>Silverlight</category><category>Presentations</category></item><item><title>Silverlight Firestarter demo</title><description>&lt;p&gt;In my &lt;a href="http://hashtagfail.com/post/2151677357/silverlight-firestarter-2010-talk-and-demo" title="Talk slides and video"&gt;previous post&lt;/a&gt; I linked to the video and slides from my talk. &lt;a href="http://code.msdn.microsoft.com/Project/Download/FileDownload.aspx?ProjectName=silverlightws&amp;DownloadId=14622" title="BookShelf app"&gt;This point contains the code sample, which is available here.&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;Setting up your machine&lt;/h3&gt;
&lt;p&gt;Here is what you need on the machine before you get started:&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;Windows 7&lt;/li&gt;
&lt;li&gt;Visual Studio 2010&lt;/li&gt;
&lt;li&gt;Silverlight 4 tools for Visual Studio 2010&lt;/li&gt;
&lt;li&gt;SQL Server 2008 Express (which I’m pretty sure comes with Visual Studio 2010 by default)&lt;/li&gt;
&lt;li&gt;IIS7&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;Before you proceed, make sure the user account under which SQL Server Express is running is &lt;strong&gt;NETWORK SERVICE&lt;/strong&gt;. If you don’t remember how this was installed, open up &lt;strong&gt;Task Manager&lt;/strong&gt; (make sure you select “Show processes from all users”) and look for the sqlsevr.exe process. If you find that you need to change the user, &lt;a href="http://msdn.microsoft.com/en-us/library/ms345578.aspx" title="How to: Change the Service Startup Account for SQL Server"&gt;this topic on MSDN should come in handy&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The other tricky part is installing/configuring IIS. Go to the search box in the Start menu and type “Turn Windows features on or off”, then select top result. In the box shown, make sure the following are checked.&lt;/p&gt;
&lt;p&gt;&lt;img src="http://media.tumblr.com/tumblr_ld54puktoj1qccglw.png"/&gt;&lt;/p&gt;
&lt;h3&gt;Deploying the basic app&lt;/h3&gt;
&lt;ol&gt;&lt;li&gt;Download the zip file and unzip the content in a folder such as &lt;span&gt;C:\Firestarter&lt;/span&gt;. It is actually &lt;u&gt;very important&lt;/u&gt; to download this in a location other than your &lt;span&gt;C:\Users\YourUser&lt;/span&gt; folder, due to &lt;a href="http://support.microsoft.com/kb/2002980" title="Problems with SQL Server Express user instancing and ASP.NET Web Application Projects"&gt;an apparent bug with SQL Server Express&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Open Visual Studio as &lt;strong&gt;Administrator&lt;/strong&gt; and open the solution file. You will be prompted to create a new website in IIS, and you should agree. If this succeeds you should see the solution open with both projects loaded correctly. But we’re not quite done yet.&lt;/li&gt;
&lt;li&gt;We need to make sure the account under which IIS is running has access to SQL Express. Go into the IIS Manager (type &lt;strong&gt;inetmgr&lt;/strong&gt; into the Start menu search box) and click on &lt;strong&gt;Application Pools&lt;/strong&gt;. Find the &lt;strong&gt;ASP.NET v4.0&lt;/strong&gt; application pool and then select &lt;strong&gt;Advanced Settings&lt;/strong&gt; on the right side. Find the &lt;strong&gt;Identity&lt;/strong&gt; row and change that to &lt;strong&gt;NetworkService&lt;/strong&gt;.&lt;br/&gt;&lt;br/&gt;&lt;img src="http://media.tumblr.com/tumblr_ld5688WyHC1qccglw.png"/&gt;&lt;/li&gt;
&lt;li&gt;We also need to make sure that the &lt;strong&gt;NETWORK SERVICE&lt;/strong&gt; user has access to the location where we put our files. Let’s assume you used &lt;span&gt;C:\Firestarter&lt;/span&gt; as I recommended above. Go to the the folder properties, then go to the &lt;strong&gt;Security&lt;/strong&gt; tab. &lt;strong&gt;NETWORK SERVICE &lt;/strong&gt;is part of the &lt;strong&gt;Users&lt;/strong&gt; group on any machine, so we can just make sure that the &lt;strong&gt;Users&lt;/strong&gt; group has &lt;span&gt;read and write  permission&lt;/span&gt;. If you don’t see  the &lt;strong&gt;Users&lt;/strong&gt; group go ahead and add the &lt;strong&gt;NETWORK SERVICE &lt;/strong&gt;account explicitly here and give it read and write permission. Make sure the permissions are inherited all the way down, especially to the &lt;strong&gt;App_Data&lt;/strong&gt; folder and the &lt;strong&gt;.mdf&lt;/strong&gt; files inside that folder. You should double-check that every &lt;strong&gt;.mdf&lt;/strong&gt; file allows the &lt;strong&gt;Users&lt;/strong&gt; group or the &lt;strong&gt;NETWORK SERVICE&lt;/strong&gt; account read and write permission. Otherwise you will get a stream of inexplicable errors as you attempt to follow the rest of this post.&lt;/li&gt;
&lt;/ol&gt;&lt;p&gt;You should now be able to hit F5 in Visual Studio, the application should pop up and you should be able to see the book categories and click on individual books.&lt;/p&gt;
&lt;p&gt;At this point you can also try and use the demo to enable the debugging features I cover in the video.&lt;/p&gt;
&lt;h3&gt;Setting up Windows Authentication&lt;/h3&gt;
&lt;p&gt;Needless to say, before we can demonstrate this scenario, we need to make sure the machine we are using is joined to a domain.&lt;/p&gt;
&lt;p&gt;We need to do the IIS configuration step that I refer to in the video, but I don’t show. We can open &lt;strong&gt;IIS Manager&lt;/strong&gt; and find our web application, then double-click the &lt;strong&gt;Authentication&lt;/strong&gt; icon and make sure &lt;strong&gt;Windows Authentication&lt;/strong&gt; is enabled.&lt;/p&gt;
&lt;p&gt;&lt;img src="http://media.tumblr.com/tumblr_ld56ejv6tg1qccglw.png"/&gt;&lt;/p&gt;
&lt;p&gt;We can then follow the rest of the steps as shown in the video. One exception is that instead of my personal domain credential, you will need to specify your own domain credential in the &lt;strong&gt;BookService.svc.cs &lt;/strong&gt;code behind file. In the download I’ve changed it to &lt;span&gt;domain\user&lt;/span&gt;.&lt;/p&gt;
&lt;h3&gt;Setting up Forms Authentication&lt;/h3&gt;
&lt;p&gt;Before we can get this to work, we need to first configure our website for access over HTTPS. Like I mention in the video, this authentication scheme requires HTTPS.&lt;/p&gt;
&lt;ol&gt;&lt;li&gt;Back in &lt;strong&gt;IIS Manager&lt;/strong&gt; we need to enable HTTPS on the Default Web Site bindings list. You can follow &lt;a href="http://weblogs.asp.net/scottgu/archive/2007/04/06/tip-trick-enabling-ssl-on-iis7-using-self-signed-certificates.aspx" title="Setting up HTTPS in IIS using self-signed certs"&gt;this tutorial by ScottGu&lt;/a&gt;. &lt;/li&gt;
&lt;li&gt;Once the HTTPS binding is created for the parent website, we need to enable the HTTPS protocol for our &lt;strong&gt;BookService.Web&lt;/strong&gt; site. We can do that by going to &lt;strong&gt;Advanced Settings &lt;/strong&gt;and adding &lt;strong&gt;https &lt;/strong&gt;in the list of &lt;strong&gt;Enabled Protocols&lt;/strong&gt;. The values are comma-separated in case you were wondering.&lt;br/&gt;&lt;br/&gt;&lt;img src="http://media.tumblr.com/tumblr_ld56ykc01s1qccglw.png"/&gt;&lt;/li&gt;
&lt;li&gt;If you end up using a self-signed certificate, realize the IE will display an error page warning you that the cert is not signed. That means that any calls that Silverlight tries to make to that page will be blocked automatically. The easiest way to fix this is to go over to&lt;strong&gt; Internet Options &lt;/strong&gt;&gt; &lt;strong&gt;Advanced&lt;/strong&gt; and in the Security section deselect “Warn about certificate address mismatch”. Don’t forget to restart IE afterwards, and most importantly, don’t forget to reenable this option when you are done playing with the demo.&lt;/li&gt;
&lt;li&gt;The last thing we need to realize is that we will be accessing the SL application over HTTP, but internally it will be making calls to HTTPS services. This is cross-scheme access and is normally disabled, even for same-domain calls. To address this we need a special &lt;strong&gt;clientaccesspolicy.xml&lt;/strong&gt; file, which we place at the root of our IIS install, in my case that is C:\inetpub\wwwroot. The file looks like this:&lt;br/&gt;&lt;pre class="brush: xml"&gt;&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;access-policy&gt;
   &lt;cross-domain-access&gt;
      &lt;policy&gt;
         &lt;allow-from http-request-headers="SOAPAction"&gt;
            &lt;domain uri="http://localhost"/&gt;
         &lt;/allow-from&gt;
         &lt;grant-to&gt;
            &lt;resource path="/BookShelf.Web" include-subpaths="true"/&gt;
         &lt;/grant-to&gt;
      &lt;/policy&gt;
   &lt;/cross-domain-access&gt;
&lt;/access-policy&gt;
&lt;/pre&gt;
&lt;/li&gt;
&lt;/ol&gt;&lt;p&gt;Once all of this is done, we can go ahead and follow the steps in the video. Please look carefully at both &lt;strong&gt;Web.config&lt;/strong&gt; and &lt;strong&gt;ServiceReferences.ClientConfig&lt;/strong&gt; to make sure you comment out all sections that refer to ASP.NET authentication.&lt;/p&gt;
&lt;p&gt;That is it, please let me know if you hit any issues in the comments.&lt;/p&gt;
&lt;p&gt;Cheers,&lt;br/&gt;-Yavor&lt;/p&gt;</description><link>http://hashtagfail.com/post/15441242450</link><guid>http://hashtagfail.com/post/15441242450</guid><pubDate>Thu, 09 Dec 2010 00:00:00 -0800</pubDate><category>Silverlight</category><category>WCF</category></item></channel></rss>

