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

<channel>
	<title>Nathan Totten</title>
	<atom:link href="http://blog.ntotten.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.ntotten.com</link>
	<description>Thoughts and Experiences with Software Development.</description>
	<lastBuildDate>Sat, 18 Feb 2012 05:26:44 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='blog.ntotten.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://0.gravatar.com/blavatar/4467e37d91705aa956f90e6c2e16e118?s=96&#038;d=http%3A%2F%2Fs2.wp.com%2Fi%2Fbuttonw-com.png</url>
		<title>Nathan Totten</title>
		<link>http://blog.ntotten.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://blog.ntotten.com/osd.xml" title="Nathan Totten" />
	<atom:link rel='hub' href='http://blog.ntotten.com/?pushpress=hub'/>
		<item>
		<title>Facebook C# SDK Road Map</title>
		<link>http://blog.ntotten.com/2012/02/07/facebook-c-sdk-road-map/</link>
		<comments>http://blog.ntotten.com/2012/02/07/facebook-c-sdk-road-map/#comments</comments>
		<pubDate>Tue, 07 Feb 2012 20:14:01 +0000</pubDate>
		<dc:creator>Nathan Totten</dc:creator>
				<category><![CDATA[Facebook C# SDK]]></category>
		<category><![CDATA[Facebook]]></category>

		<guid isPermaLink="false">http://blog.ntotten.com/?p=1111</guid>
		<description><![CDATA[Disclaimer &#8211; The Facebook C# SDK is not a Microsoft project. The Facebook C# SDK as well as this post are the work and opinions of myself and not those of Microsoft. It has been a while since I have &#8230; <a href="http://blog.ntotten.com/2012/02/07/facebook-c-sdk-road-map/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.ntotten.com&amp;blog=30834763&amp;post=1111&amp;subd=nathantotten&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong><em>Disclaimer &#8211; The Facebook C# SDK is not a Microsoft project. The Facebook C# SDK as well as this post are the work and opinions of myself and not those of Microsoft.</em></strong></p>
<p>It has been a while since I have written a post on the <a href="http://github.com/facebook-csharp-sdk">Facebook C# SDK</a>. For those that follow my blog and the sdk you probably know that since I have moved to Microsoft I have spent less time on the Facebook C# SDK and more time on Windows Azure. Fortunately, the Facebook C# SDK was left in the very capable hands of Prabir Shrestha and it has continued to thrive. While I haven&#8217;t been spending much time with the SDK, it is still a project I care about and as such I wanted to share our plans to keep the project moving forward.</p>
<p><strong>Moving to Github</strong></p>
<p><a href="http://github.com/facebook-csharp-sdk"><img class="size-thumbnail wp-image-1112 alignright" title="octocat" src="http://nathantotten.files.wordpress.com/2012/02/octocat.png?w=150&#038;h=150" alt="" width="150" height="150" /></a>In the past few days we have been in the process of moving the Facebook C# SDK project to Github. Since the project was founded nearly two years ago we have hosted the SDK on Codeplex. Codeplex has been a great place for our project and on Codeplex we have recieved nearly 120,000 downloads. However, since the project was founded we have seen more and more projects and developers migrated to Github. Github offers a great set of collaboration tools that make managing a project like the Facebook C# SDK a breeze. We believe Github will enable the community to more easily contribute back code to the SDK through forks and pull requests. As such, the new home for the Facebook C# SDK will be at <a href="http://github.com/facebook-csharp-sdk">http://github.com/facebook-csharp-sdk</a>.</p>
<h1>Platforms and Frameworks</h1>
<p>When the Facebook C# SDK was started we supported only .Net 4.0 Full Profile. This was primarily because the SDK relied heavily on dynamic objects and the reliance on objects found in ASP.NET libraries. Over time the SDK has evolved to support .Net 3.5, .Net 3.5 Client Profile, .Net 4.0 Client Profile, Silverlight 3, Silverlight 4, Silverlight 5, MVC 2, MVC 3, Windows Phone 7.0, Windows Phone 7.1, and most recently WinRT (Windows 8 Metro Style Apps). This is obviously a huge amount of code to write and maintain. If you have seen the code of the SDK you will notice there are lots of <a href="http://msdn.microsoft.com/en-us/library/ed8yd1ha.aspx">preprocessor directives</a> that help us work around the differences in the various platforms. You can see an example of this in the code below.</p>
<p><pre class="brush: csharp;">
    request.ContentType = contentType;
    if (!string.IsNullOrEmpty(etag))
        request.Headers[HttpRequestHeader.IfNoneMatch] =
             string.Concat('&quot;', etag, '&quot;');
#if !(SILVERLIGHT || WINRT)
    request.AutomaticDecompression =
        DecompressionMethods.GZip | DecompressionMethods.Deflate;
#endif
#if WINRT
    request.Headers[HttpRequestHeader.AcceptEncoding] = &quot;gzip,deflate&quot;;
#endif
    if (input != null)
        request.TrySetContentLength(input.Length);
#if (!(SILVERLIGHT || WINRT) || WINDOWS_PHONE)
    request.UserAgent = &quot;Facebook C# SDK&quot;;
#endif
    return new HttpHelper(request);
</pre></p>
<p>As you can see this code can be difficult to maintain, test, and debug. The good news is that through Prabir&#8217;s excellent work of abstracting the most difficult portions of this code we have been able to keep these proprocessor directives to a minimum. I will go into more details about this later in the article. What this means though is that we will do our best to keep supporting all of the current and future .Net and Windows platforms.</p>
<p>However, the reason I wanted to discuss this is to note that with this support there is generally a trade-off. At times we must decided whether to implement the new features of a particular platforms or maintain compatibility. So as I said, we will try to maintain compatibility with the various platforms, but moving forward we will be focusing our efforts on a few areas.</p>
<p>We want to make sure developers have a great experience with the Facebook C# SDK when developing web apps, Windows Phone Apps, and Windows 8 Metro Style Apps. This means that we will focus our energies on ASP.NET, Windows Phone, and WinRT support. We will be building out high quality samples and writing better documentation primarily around these three platforms and frameworks. While we aren&#8217;t explicitly not supporting the other platforms, our efforts will be minimal. We definitely welcome community contributions so if you have a great Silverlight sample please form the repo and contribute it back.</p>
<h1>License</h1>
<p>We have also decided to redistribute the Facebook C# SDK under the Apache 2.0 license. This license is more popular than the Ms-Pl license and is consistent with the license for  Facebook&#8217;s official SDKs and samples. While I am no lawyer, my understanding is that the Apache 2.0 license is the same in nearly every respect to Ms-Pl so this shouldn&#8217;t require any change on your part. You are still free to redistribute the SDK, use it in commercial projects, etc.</p>
<h1>Facebook C# SDK and Web Apps</h1>
<p>For those that have used the Facebook C# SDK in the past to develop web apps you have probably used the Facebook.Web and Facebook.Web.Mvc libraries. These libraries provide helper methods that were designed to make it easier to perform tasks such as authentication with Facebook in ASP.NET WebForms and MVC apps. Unfortunately, with the many changes to the Facebook platform, the new versions of MVC, and the new features added to the core Facebook C# SDK these libraries evolved in a way that we believe made them no so easy to use.</p>
<p>Instead of trying to patch and fix these libraries once again, we decided that it was time to take a step back and reevaluate how we handle web apps with the Facebook C# SDK. As such, we have decided that going forward we will be removing the Facebook.Web and Facebook.Web.Mvc libraries from the SDK. This change will happen in the 6.0 release and will not effect developers still using the 5.0 release. I will discuss our version plans later in this post in more detail.</p>
<p>So with the removal of the Facebook.Web and Facebook.Web.Mvc libraries you are probably wondering how will you develop Facebook Apps using ASP.NET WebForms and MVC. First, we are moving some of the more critical parts of the Facebook.Web and Facebook.Web.Mvc libraries into the core Facebook.dll. Second, we are going to be providing much higher quality samples for ASP.NET WebForms and MVC developers. Last, we intend to ship various NuGet packages that contain smaller parts of the Facebook  web libraries.</p>
<p>We believe the approach of having only a single Facebook.dll library will greatly simplify the  process of getting started developing your app. It will reduce the API surface and thus reduce the complexity. Additionally, we have found that developers often tweak the code in the web libraries to fit their application. For this reason we believe that shipping the web code as samples, simple NuGet packages, and general guidance will better allow developers to integrate and understand Facebook development in ASP.NET.</p>
<p>Now, we do understand this change may be difficult for some people. Many apps have already been built with the Facebook C# SDK and breaking changes can be tough. We have always tried to avoid breaking changes and generally have done so except in the case where Facebook introduced breaking changes. To this end we will keep updating Version 5.X of the Facebook C# SDK. We won&#8217;t be adding new feature to version 5, but we will ensure that it keeps working for you in the foreseeable future. You can find the code for version 5.x on github in a branch called &#8216;v5&#8242;. You can see that branch here: <a href="https://github.com/facebook-csharp-sdk/facebook-csharp-sdk/tree/v5">https://github.com/facebook-csharp-sdk/facebook-csharp-sdk/tree/v5</a>.</p>
<h1>Version 6.0</h1>
<p>As mentioned earlier, we are starting work on version 6.0 of the Facebook C# SDK. Today, Prabir released Version 6.0 Alpha. This is a preview of where we are heading with the SDK. The overall goal of Version 6.0 is simplicity. We are reducing the API surface, improving the documentation, and building out better samples to make it even easier to build a Facebook app for .Net or any flavor of Windows.</p>
<p>Prabir has written an <a href="http://blog.prabir.me/post/Facebook-CSharp-SDK-Glimpse-into-the-Future.aspx">excellent post</a> that goes into more detail about the technical changes to version 6.0, but below are a few highlights.</p>
<ul>
<li>You can now use anonymous objects as parameters. Before you had to either create a Dictionary or ExpandoObject.</li>
<li>GZip/Deflate has been enabled for desktop client profiles.</li>
<li>We have introduced FacebookMediaStream to replace FacebookMediaObject. You can now work with this object like a normal stream rather than converting back and forth to a byte array.</li>
<li>You can now optimize your request to the graph with ETags.</li>
</ul>
<p>Version 6.0 is an exciting step forward for Facebook developers on the Microsoft stack. We hope version 6.0 will greatly simplify your experience and help you create great Facebook apps. As I mentioned, the currently release is only an alpha release so we look forward to your feedback.</p>
<h1>Documentation</h1>
<p>Documentation has always been one of the biggest complaints for our developers. Admittedly, we have not always been able to keep our documents up to date to the SDK. We are hoping to correct this problem moving forward. With Prabir taking over in the last months as the lead developer on the Facebook C# SDK this has left me free to focus on other areas. Moving forward my contributions to the Facebook C# SDK will be primarily on writing documentation, tutorials, and building samples. My hope is that we can get even more developers using the Facebook C# SDK to build great Facebook apps.</p>
<p>When moving to Github we evaluated the various options for documentation. We thought about using the Github wiki, but in the end it felt a bit too constrained. Additionally, we are starting to split the code of the Facebook C# SDK into a variety of Github repositories. However, we didn&#8217;t want to also split up the documentation. We thought there should be a high quality, customizable, and centralized space for documentation. We decided that Github pages would work nicely for our needs. Many other projects use Github pages to build out rich and high quality documentation. You can see our early efforts at <a href="http://docs.csharpsdk.org">http://docs.csharpsdk.org</a>. This is just an early start, but in the coming weeks expect to see this resource grow to provide lots of great content.</p>
<p><a href="http://docs.csharpsdk.org"><img class="alignleft size-full wp-image-1119" title="docspage" src="http://nathantotten.files.wordpress.com/2012/02/docspage.png?w=584&#038;h=441" alt="" width="584" height="441" /></a></p>
<h1>Issues and Discussions</h1>
<p>One thing you will notice on Github is that there is no discussions area. The old Codeplex project had a discussions area where many people asked questions and provided feedback. While we know that many of you liked that model we always have tried to discourage using Codeplex for discussions because of the problems associated with threaded conversations. First, information was quickly outdated. Often times you could find a discussion in a search that would seem like it solved your problem, but the answer would be outdated. Additionally, there is no way of noting which answer is the correct answer. You had to read the entire conversation to figure out the solution (if there was even one). For these reasons we have all come to know and love StackOverflow.</p>
<p>Recently, Facebook showed some love for StackOverflow and moved their developer forums to http://facebook.stackoverflow.com. We have decided to do the same. Going forward we will not offer a discussion area outside of Stackoverflow. We believe this will help keep questions and answered organized, relevant, and make it easier for developers to find the answers they are looking for. We will continue to monitor and answer questions on StackOverflow.</p>
<p>The one issue StackOverflow does not solve is bugs. The old Codeplex discussions were often the first place a bug was reported. This made it really difficult for us to keep track of these bugs. Going forward, we are going to be using Github issues for all bugs. If you find a bug or even think you have a bug file an issue. Users can then comment on issues, track issues, and we can tag issues, and mark them as fixed as appropriate. This will make our jobs easier and help ensure that your bug/issue gets fixed as soon as possible.</p>
<p>Also, issues are not just for bugs. Please add feature requests, documentation request/issues, sample requests/issues to the project issues as well. Don&#8217;t worry that your issues maybe isn&#8217;t really a bug or that your request might seem too specific. We love the feedback and want your help to improve the SDK.</p>
<h1>Utility Libraries</h1>
<p>As we built out the Facebook C# SDK we also created several utility libraries as well. The first of these libraries is <a href="https://github.com/facebook-csharp-sdk/simple-json">SimpleJson </a>which is a very robust yet very simple JSON serializer. Next is HttpHelper which simplifies making HTTP requests from various .Net/Windows platforms. <a href="https://github.com/facebook-csharp-sdk/ReflectionUtils">ReflectionUtils </a>which is a simple set of tools for performing reflection. Finally, there is <a href="https://github.com/facebook-csharp-sdk/CombinationStream">CombinationStream </a>which allows you to represent multiple streams as a single stream. We have moved these projects to repositories under the facebook-csharp-sdk organization on Github. Feel free to use these in your libraries or applications as well.</p>
<h1>Community Contributions</h1>
<p>Please fork our repositories. If you aren&#8217;t familiar with Github there are some awesome <a href="http://help.github.com/">documents </a>on their website. Additionally, Tekpub has a great video on getting started with Git <a href="http://tekpub.com/productions/git">here</a>. The video costs $15, but if you like learning through videos it is definitely worth it.</p>
<p>If you want to submit a patch, please send us a pull request. We would love help with bug fixes, documentation, samples, or anything else. With github these sort of contributions are really easy to manage so please feel free to jump in and help out.</p>
<h1>Wrapping Up</h1>
<p>This post ended up being a lot longer than I had planned, but I hope you are excited about where the Facebook C# SDK is heading. There were a lot of big announcements today and we have a few more exciting announcements in the next few weeks. As always, please feel free to leave feedback. We would love to hear from you.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nathantotten.wordpress.com/1111/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nathantotten.wordpress.com/1111/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nathantotten.wordpress.com/1111/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nathantotten.wordpress.com/1111/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nathantotten.wordpress.com/1111/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nathantotten.wordpress.com/1111/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nathantotten.wordpress.com/1111/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nathantotten.wordpress.com/1111/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nathantotten.wordpress.com/1111/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nathantotten.wordpress.com/1111/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nathantotten.wordpress.com/1111/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nathantotten.wordpress.com/1111/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nathantotten.wordpress.com/1111/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nathantotten.wordpress.com/1111/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.ntotten.com&amp;blog=30834763&amp;post=1111&amp;subd=nathantotten&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.ntotten.com/2012/02/07/facebook-c-sdk-road-map/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d48b998c2dce49ca309710eba498c562?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">ntotten</media:title>
		</media:content>

		<media:content url="http://nathantotten.files.wordpress.com/2012/02/octocat.png?w=150" medium="image">
			<media:title type="html">octocat</media:title>
		</media:content>

		<media:content url="http://nathantotten.files.wordpress.com/2012/02/docspage.png" medium="image">
			<media:title type="html">docspage</media:title>
		</media:content>
	</item>
		<item>
		<title>Windows Azure Toolkit for Social Games Version 1.2.2 Released</title>
		<link>http://blog.ntotten.com/2012/01/26/windows-azure-toolkit-for-social-games-version-1-2-2-released/</link>
		<comments>http://blog.ntotten.com/2012/01/26/windows-azure-toolkit-for-social-games-version-1-2-2-released/#comments</comments>
		<pubDate>Thu, 26 Jan 2012 22:19:59 +0000</pubDate>
		<dc:creator>Nathan Totten</dc:creator>
				<category><![CDATA[Windows Azure]]></category>
		<category><![CDATA[Github]]></category>
		<category><![CDATA[Social Gaming Toolkit]]></category>

		<guid isPermaLink="false">http://nathantotten.wordpress.com/?p=1093</guid>
		<description><![CDATA[Today, I released version 1.2.2 of the Windows Azure Toolkit for Social Games. You can download the self-extracting package here. This version does not add any new features compared to the last (Version 1.2.0 &#8211; Beta), but this release is &#8230; <a href="http://blog.ntotten.com/2012/01/26/windows-azure-toolkit-for-social-games-version-1-2-2-released/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.ntotten.com&amp;blog=30834763&amp;post=1093&amp;subd=nathantotten&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Today, I released version 1.2.2 of the <a href="https://github.com/WindowsAzure-Toolkits/wa-toolkit-games">Windows Azure Toolkit for Social Games</a>. You can download the self-extracting package <a href="https://github.com/downloads/WindowsAzure-Toolkits/wa-toolkit-games/WATGames-v1.2.2.exe">here</a>. This version does not add any new features compared to the last (Version 1.2.0 &#8211; Beta), but this release is considered stable. We added a number of performance enhancements as well as optimized the setup of the Autofac dependency injection. The big news with this release is that we have moved the project to <a href="https://github.com/WindowsAzure-Toolkits/wa-toolkit-games">Github</a>.</p>
<p>For those who haven&#8217;t downloaded or used the social gaming toolkit yet I would encourage you to check it out. There are a lot of common patterns and tons of reusable code in the toolkit that applies for many scenarios besides the gaming space. With more and more applications relying on real-time communication, sharing, and feedback the mechanisms that are used in games can be applied to many kinds of software.</p>
<h2>Github</h2>
<p>Since we started this project Github has become an increasingly popular place to host the open source projects. Additionally, the <a href="https://github.com/WindowsAzure">Windows Azure SDKs</a> are now open sourced and available on Github. We have seen a great deal of support from the community in this move and believe that Github is the right place to host this toolkit. Our hope is that with the amazing support Github offers for social coding such as forking, pull requests, etc. more users will be able to utilize and contribute to this project.</p>
<p>For those of you that have not used git or Github before I highly recommend watching the <a href="http://tekpub.com/productions/git">Mastering Git video</a> on <a href="http://tekpub.com">Tekpub</a>. It costs $15, but it is worth it if you like learning though videos. If you like learning by doing and reading the instructions Github has a great set of help documentation on there <a href="http://help.github.com/">site</a>.</p>
<h2>Cloning a Repository</h2>
<p>Rather than simply downloading the zip or self-extracting package of the Social Gaming Toolkit, you may want to clone the repository. Doing this will make it easier to pull in changes when we release future updates. It also allows you to make local changes to the toolkit and still update code that changes in future versions without loosing all your work.</p>
<p>In order to clone a repository first you must have git installed on your computer. You can download git <a href="http://git-scm.com/">here</a>. After you have git installed simply open the command prompt and clone the repository using the following command.</p>
<pre>git clone git@github.com:WindowsAzure-Toolkits/wa-toolkit-games.git</pre>
<h2>Forking a Project</h2>
<p>One of the best features of Github is that you can easily <a href="http://help.github.com/fork-a-repo/">fork projects</a> and make your own edits. If you use this toolkit and want to keep your own version simply create a fork and make your edits. Additionally, if you make a change that you think everyone would benefit from simply<a href="http://help.github.com/send-pull-requests/"> send a pull request</a> and request that we add your change to our fork.</p>
<p>Forking a repository is easy. Simply click the fork button and select where you want the fork to live.</p>
<p><img class="alignnone size-full wp-image-1102" title="forks" src="http://nathantotten.files.wordpress.com/2012/01/forks.png?w=584&#038;h=236" alt="" width="584" height="236" /></p>
<p>After you have forked the project, you can push changed to your own repository. If you have a change that you want to be added to the original repository all you have to do is send a pull request.</p>
<p><img class="alignnone size-full wp-image-1103" title="pullrequest" src="http://nathantotten.files.wordpress.com/2012/01/pullrequest.png?w=584" alt=""   /></p>
<p>If your pull request is accepted, your changes will be added to the original repository for everybody to use. Feel free to add features or fix any bugs you find and send us a pull request.</p>
<p>As always, feel free to leave comments, feedback, or suggestions. I would love to hear how you are using the toolkit and what you think about using Github.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nathantotten.wordpress.com/1093/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nathantotten.wordpress.com/1093/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nathantotten.wordpress.com/1093/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nathantotten.wordpress.com/1093/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nathantotten.wordpress.com/1093/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nathantotten.wordpress.com/1093/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nathantotten.wordpress.com/1093/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nathantotten.wordpress.com/1093/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nathantotten.wordpress.com/1093/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nathantotten.wordpress.com/1093/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nathantotten.wordpress.com/1093/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nathantotten.wordpress.com/1093/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nathantotten.wordpress.com/1093/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nathantotten.wordpress.com/1093/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.ntotten.com&amp;blog=30834763&amp;post=1093&amp;subd=nathantotten&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.ntotten.com/2012/01/26/windows-azure-toolkit-for-social-games-version-1-2-2-released/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
	
		<media:thumbnail url="http://nathantotten.files.wordpress.com/2011/11/tankster-game-play.png?w=150" />
		<media:content url="http://nathantotten.files.wordpress.com/2011/11/tankster-game-play.png?w=150" medium="image">
			<media:title type="html">tankster-game-play.png</media:title>
		</media:content>

		<media:content url="http://1.gravatar.com/avatar/d48b998c2dce49ca309710eba498c562?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">ntotten</media:title>
		</media:content>

		<media:content url="http://nathantotten.files.wordpress.com/2012/01/forks.png" medium="image">
			<media:title type="html">forks</media:title>
		</media:content>

		<media:content url="http://nathantotten.files.wordpress.com/2012/01/pullrequest.png" medium="image">
			<media:title type="html">pullrequest</media:title>
		</media:content>
	</item>
		<item>
		<title>Unlocking files that are in use.</title>
		<link>http://blog.ntotten.com/2012/01/18/unlocking-files-that-are-in-use/</link>
		<comments>http://blog.ntotten.com/2012/01/18/unlocking-files-that-are-in-use/#comments</comments>
		<pubDate>Thu, 19 Jan 2012 06:09:25 +0000</pubDate>
		<dc:creator>Nathan Totten</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.ntotten.com/2012/01/18/unlocking-files-that-are-in-use/</guid>
		<description><![CDATA[<p><a href="http://www.microsoftnow.com/2008/10/unlocking-files-that-are-in-use.html" title="Unlocking files that are in use.">Unlocking files that are in use.</a></p>
This is more of a note to myself, but I thought other may find it useful. You can use the Process Explorer tool that is part of SysInternals to figure out which program is holding the lock on your file and kill it. Very handy. <a href="http://blog.ntotten.com/2012/01/18/unlocking-files-that-are-in-use/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.ntotten.com&amp;blog=30834763&amp;post=1080&amp;subd=nathantotten&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.microsoftnow.com/2008/10/unlocking-files-that-are-in-use.html" title="Unlocking files that are in use.">Unlocking files that are in use.</a></p>
<p>This is more of a note to myself, but I thought others may find it useful. You can use the Process Explorer tool that is part of SysInternals to figure out which program is holding the lock on your file and kill it. Very handy.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nathantotten.wordpress.com/1080/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nathantotten.wordpress.com/1080/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nathantotten.wordpress.com/1080/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nathantotten.wordpress.com/1080/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nathantotten.wordpress.com/1080/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nathantotten.wordpress.com/1080/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nathantotten.wordpress.com/1080/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nathantotten.wordpress.com/1080/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nathantotten.wordpress.com/1080/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nathantotten.wordpress.com/1080/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nathantotten.wordpress.com/1080/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nathantotten.wordpress.com/1080/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nathantotten.wordpress.com/1080/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nathantotten.wordpress.com/1080/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.ntotten.com&amp;blog=30834763&amp;post=1080&amp;subd=nathantotten&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.ntotten.com/2012/01/18/unlocking-files-that-are-in-use/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d48b998c2dce49ca309710eba498c562?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">ntotten</media:title>
		</media:content>
	</item>
		<item>
		<title>Windows Azure Toolkit for Social Games Version 1.2.0 (beta) Released</title>
		<link>http://blog.ntotten.com/2011/12/07/windows-azure-toolkit-for-social-games-version-1-2-0-beta-released/</link>
		<comments>http://blog.ntotten.com/2011/12/07/windows-azure-toolkit-for-social-games-version-1-2-0-beta-released/#comments</comments>
		<pubDate>Wed, 07 Dec 2011 19:46:42 +0000</pubDate>
		<dc:creator>Nathan Totten</dc:creator>
				<category><![CDATA[Windows Azure]]></category>
		<category><![CDATA[Social Gaming Toolkit]]></category>

		<guid isPermaLink="false">http://ntotten.com/?p=1010</guid>
		<description><![CDATA[Today, I released version 1.2.0 (beta) of the Windows Azure Toolkit for Social Games. You can download the self-extracting exe here or get the source directly here. This release is primarily a maintenance release that includes bug fixes and enhancements &#8230; <a href="http://blog.ntotten.com/2011/12/07/windows-azure-toolkit-for-social-games-version-1-2-0-beta-released/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.ntotten.com&amp;blog=30834763&amp;post=1010&amp;subd=nathantotten&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Today, I released version 1.2.0 (beta) of the <a href="http://go.microsoft.com/fwlink/?LinkID=234210">Windows Azure Toolkit for Social Games</a>. You can download the self-extracting exe <a href="http://go.microsoft.com/fwlink/?LinkID=234062">here</a> or get the source directly <a href="http://go.microsoft.com/fwlink/?LinkID=234213">here</a>. This release is primarily a maintenance release that includes bug fixes and enhancements to the code base. There aren’t any additional features in the release, but you should notice improved performance and stability. This is a ‘point’ release because there are a few breaking changes with the APIs that were made&nbsp;to clean up the overall code base.</p>
<p>This release is&nbsp;a ‘beta’ release because it did not go through our full QA process, but all the tests pass and it should be stable. I will be releasing a stable version of the 1.2.x branch shortly that has undergone the full QA tests to ensure the quality is up to par.</p>
<p>The biggest changes&nbsp;in this release is that we are now using dependency injection throughout the solution. The toolkit uses the great <a href="http://code.google.com/p/autofac/">Autofac</a> library for injection, but you could easily swap out another library if you prefer.</p>
<p>Below you will see how we setup MVC3 and the WCF Web APIs to use Autofac for DI.</p>
<p><pre class="brush: csharp;">// Setup AutoFac
var builder = new ContainerBuilder();
DependancySetup(builder);
var container = builder.Build();

DependencyResolver.SetResolver(
new AutofacDependencyResolver(container));

// Setup WCF Web API Config
var config = new WebApiConfiguration();
config.EnableTestClient = true;
config.CreateInstance = ((t, i, h) =&gt;
DependencyResolver.Current.GetService(t));
RouteTable.Routes.SetDefaultHttpConfiguration(config);</pre></p>
<p>Additionally, we updated all the Nuget packages to their most recent versions. This includes the <a href="http://wcf.codeplex.com">WCF Web APIs</a> to Preview 6 and jQuery to version 1.7.1. Finally, we fixed a few bugs. There was a memory leak that some people were seeing in the worker role that should be fixed.</p>
<p><a href="http://go.microsoft.com/fwlink/?LinkID=234062">Download</a> and deploy the toolkit to Windows Azure today. Let me know if you have any feedback, questions, or if you find any bugs.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nathantotten.wordpress.com/1010/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nathantotten.wordpress.com/1010/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nathantotten.wordpress.com/1010/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nathantotten.wordpress.com/1010/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nathantotten.wordpress.com/1010/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nathantotten.wordpress.com/1010/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nathantotten.wordpress.com/1010/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nathantotten.wordpress.com/1010/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nathantotten.wordpress.com/1010/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nathantotten.wordpress.com/1010/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nathantotten.wordpress.com/1010/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nathantotten.wordpress.com/1010/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nathantotten.wordpress.com/1010/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nathantotten.wordpress.com/1010/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.ntotten.com&amp;blog=30834763&amp;post=1010&amp;subd=nathantotten&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.ntotten.com/2011/12/07/windows-azure-toolkit-for-social-games-version-1-2-0-beta-released/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d48b998c2dce49ca309710eba498c562?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">ntotten</media:title>
		</media:content>
	</item>
		<item>
		<title>Windows Azure Toolkit for Social Games Version 1.1.1</title>
		<link>http://blog.ntotten.com/2011/11/18/windows-azure-toolkit-for-social-games-version-1-1-1/</link>
		<comments>http://blog.ntotten.com/2011/11/18/windows-azure-toolkit-for-social-games-version-1-1-1/#comments</comments>
		<pubDate>Fri, 18 Nov 2011 21:38:54 +0000</pubDate>
		<dc:creator>Nathan Totten</dc:creator>
				<category><![CDATA[Windows Azure]]></category>
		<category><![CDATA[Social Gaming Toolkit]]></category>

		<guid isPermaLink="false">http://ntotten.com/?p=1000</guid>
		<description><![CDATA[I just released a minor update to the Windows Azure Toolkit for Social Games Version 1.1. You can download this release here. This release updates the toolkit to use Windows Azure Tools and SDK Version 1.6. Additionally, this release includes a &#8230; <a href="http://blog.ntotten.com/2011/11/18/windows-azure-toolkit-for-social-games-version-1-1-1/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.ntotten.com&amp;blog=30834763&amp;post=1000&amp;subd=nathantotten&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I just released a minor update to the <a href="http://go.microsoft.com/fwlink/?LinkID=234210">Windows Azure Toolkit for Social Games</a> Version 1.1. You can download this release <a href="http://go.microsoft.com/fwlink/?LinkID=234062">here</a>. This release updates the toolkit to use <a href="http://blogs.msdn.com/b/windowsazure/archive/2011/11/14/updated-windows-azure-sdk-amp-windows-azure-hpc-scheduler-sdk.aspx">Windows Azure Tools and SDK Version 1.6</a>. Additionally, this release includes a few minor, but significant, performance enhancements.</p>
<p><a href="http://blogs.msdn.com/b/benjguin/">Benjamin Guinebertière</a> discovered the performance issues and was kind enough to share the results. Benjamin noticed that the response time between when the server gets a request to the time when the response begins was about 4 seconds. You can see this below by measuring the difference between “ServerGotRequest” and “ServerBeginResponse”.</p>
<pre>Request Count:  1
Bytes Sent:     3 011	(headers:2938; body:73)
Bytes Received: 228	(headers:225; body:3)

ACTUAL PERFORMANCE
--------------
ClientConnected:    	16:33:24.848
ClientBeginRequest: 	16:33:45.247
ClientDoneRequest:   	16:33:45.247
Determine Gateway:  	0ms
DNS Lookup:           	0ms
TCP/IP Connect:      	1ms
HTTPS Handshake: 	0ms
ServerConnected:   	16:33:45.249
FiddlerBeginRequest:  	16:33:45.249
ServerGotRequest: 	16:33:45.249
ServerBeginResponse: 	16:33:49.973
ServerDoneResponse: 	16:33:49.973
ClientBeginResponse: 	16:33:49.973
ClientDoneResponse:   	16:33:49.973

Overall Elapsed:     	00:00:04.7260980

RESPONSE CODES
--------------
HTTP/200:		1

RESPONSE BYTES (by Content-Type)
--------------
       ~headers~:	225
application/json:	3</pre>
<p>Benjamin setup and ran some tests to investigate the bottleneck. You can see how he added the traces below.</p>
<p><a href="http://nathantotten.files.wordpress.com/2011/11/image.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border-width:0;" title="image" src="http://nathantotten.files.wordpress.com/2011/11/image_thumb.png?w=525&#038;h=665" alt="image" width="525" height="665" border="0" /></a></p>
<p>The results of this trace are show below. Notice that the action takes less than half a second to run. This meant that there was something outside of the action that was causing the problem.</p>
<p><a href="http://nathantotten.files.wordpress.com/2011/11/image1.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border-width:0;" title="image" src="http://nathantotten.files.wordpress.com/2011/11/image_thumb1.png?w=648&#038;h=51" alt="image" width="648" height="51" border="0" /></a></p>
<p>After some investigation we discovered that we were calling the <code>EnsureExists()</code> method on every request in the game service. This was a mistake on our part and definitely not a best practice. You can see how the <code>EnsureExists()</code> method is called every time the repository is instantiated.</p>
<p><pre class="brush: csharp;">
public GameRepository(
    IAzureBlobContainer gameContainer,
    IAzureBlobContainer gameQueueContainer,
    IAzureQueue skirmishGameMessageQueue,
    IAzureQueue leaveGameMessageQueue,
    IAzureBlobContainer userContainer,
    IAzureQueue inviteQueue)
{
    this.skirmishGameQueue = skirmishGameMessageQueue;
    this.leaveGameQueue = leaveGameMessageQueue;

    this.gameContainer = gameContainer;
    this.gameContainer.EnsureExist(true);

    this.gameQueueContainer = gameQueueContainer;
    this.gameQueueContainer.EnsureExist(true);

    this.userContainer = userContainer;
    this.userContainer.EnsureExist(true);

    this.inviteQueue = inviteQueue;
    this.inviteQueue.EnsureExist();
}
</pre></p>
<p>To fix this issue we created an <code>EnsureExists()</code> method on the GameRepository and moved all the queue and storage initialization methods there.</p>
<p><pre class="brush: csharp;">
public void EnsureExist()
{
    this.gameContainer.EnsureExist(true);
    this.gameQueueContainer.EnsureExist(true);
    this.userContainer.EnsureExist(true);
    this.inviteQueue.EnsureExist();
    this.skirmishGameQueue.EnsureExist();
    this.leaveGameQueue.EnsureExist();
}
</pre></p>
<p>Next, we call this new method only once in our Global.asax Application_Startup. You can see that below.</p>
<p><pre class="brush: csharp;">
protected void Application_Start()
{
    CloudStorageAccount.SetConfigurationSettingPublisher(
       (configName, configSetter) =&gt;
    {
        string configuration = RoleEnvironment.IsAvailable ?
            RoleEnvironment
                 .GetConfigurationSettingValue(configName) :
            ConfigurationManager.AppSettings[configName];

        configSetter(configuration);
    });

    AreaRegistration.RegisterAllAreas();

    RegisterGlobalFilters(GlobalFilters.Filters);
    RegisterRoutes(RouteTable.Routes);

    FederatedAuthentication.ServiceConfigurationCreated +=
        this.OnServiceConfigurationCreated;

    // initialize blob and queue resources
    new GameRepository().EnsureExist();
    new UserRepository().EnsureExist();
}
</pre></p>
<p>After these changes the time for a request went down to less than 2 seconds. You can see the request and response times below.</p>
<p><a href="http://nathantotten.files.wordpress.com/2011/11/clip_image0028.jpg"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border-width:0;" title="clip_image002[8]" src="http://nathantotten.files.wordpress.com/2011/11/clip_image0028_thumb.jpg?w=342&#038;h=308" alt="clip_image002[8]" width="342" height="308" border="0" /></a></p>
<p>This is a good improvement, but there are still several more changes like this we can do. I hope to release a new version in the next week or so that improves performance even more. Until then, give the updated version a try and let me know if you have any feedback.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nathantotten.wordpress.com/1000/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nathantotten.wordpress.com/1000/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nathantotten.wordpress.com/1000/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nathantotten.wordpress.com/1000/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nathantotten.wordpress.com/1000/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nathantotten.wordpress.com/1000/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nathantotten.wordpress.com/1000/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nathantotten.wordpress.com/1000/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nathantotten.wordpress.com/1000/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nathantotten.wordpress.com/1000/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nathantotten.wordpress.com/1000/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nathantotten.wordpress.com/1000/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nathantotten.wordpress.com/1000/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nathantotten.wordpress.com/1000/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.ntotten.com&amp;blog=30834763&amp;post=1000&amp;subd=nathantotten&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.ntotten.com/2011/11/18/windows-azure-toolkit-for-social-games-version-1-1-1/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d48b998c2dce49ca309710eba498c562?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">ntotten</media:title>
		</media:content>

		<media:content url="http://nathantotten.files.wordpress.com/2011/11/image_thumb.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://nathantotten.files.wordpress.com/2011/11/image_thumb1.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://nathantotten.files.wordpress.com/2011/11/clip_image0028_thumb.jpg" medium="image">
			<media:title type="html">clip_image002[8]</media:title>
		</media:content>
	</item>
		<item>
		<title>Windows Azure Toolkit for Social Games Version 1.1</title>
		<link>http://blog.ntotten.com/2011/11/16/windows-azure-toolkit-for-social-games-version-1-1/</link>
		<comments>http://blog.ntotten.com/2011/11/16/windows-azure-toolkit-for-social-games-version-1-1/#comments</comments>
		<pubDate>Wed, 16 Nov 2011 18:09:51 +0000</pubDate>
		<dc:creator>Nathan Totten</dc:creator>
				<category><![CDATA[Windows Azure]]></category>
		<category><![CDATA[Social Gaming Toolkit]]></category>

		<guid isPermaLink="false">http://ntotten.com/2011/11/windows-azure-toolkit-for-social-games-version-1-1/</guid>
		<description><![CDATA[I am happy to report that we have updated the Windows Azure Toolkit for Social Games to version 1.1. You can download the release here. This version is a significant step forward and enables developers to more easily and quickly &#8230; <a href="http://blog.ntotten.com/2011/11/16/windows-azure-toolkit-for-social-games-version-1-1/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.ntotten.com&amp;blog=30834763&amp;post=988&amp;subd=nathantotten&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I am happy to report that we have updated the <a href="http://go.microsoft.com/fwlink/p/?LinkID=234210">Windows Azure Toolkit for Social Games</a> to version 1.1. You can download the release <a href="http://go.microsoft.com/fwlink/p/?LinkID=234062">here</a>. This version is a significant step forward and enables developers to more easily and quickly build out their social games on the Windows Azure Platform. </p>
<p>The biggest change we have made in this release is to separate the core toolkit from the <a href="http://www.tankster.net">Tankster</a> game. After we released the Tankster sample game we received a lot of feedback asking for a simpler game that developers could use to learn. To meet this need we developed two simple games, Tic-Tac-Toe and Four in a Row, and included in the toolkit. The Tankster game is now available separately as a sample built on top of the toolkit. </p>
<p>Below you can see the sample Tic-Tac-Toe game.    <br /><a href="http://nathantotten.files.wordpress.com/2011/11/snaghtml377dc3c1.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border-width:0;" title="SNAGHTML377dc3c" border="0" alt="SNAGHTML377dc3c" src="http://nathantotten.files.wordpress.com/2011/11/snaghtml377dc3c_thumb1.png?w=554&#038;h=588" width="554" height="588" /></a></p>
<p>While the new games included in the toolkit are much simpler than Tankster, they still show the same core concepts. You can easily use these samples as a starting point to build out any number of types of games. Additionally, you will find that many of the core components of the game such as the leaderboard services, game command services can be used without any modification to the server side or client side code.</p>
<p>The features included in the new version of the Windows Azure Toolkit for Social Gaming are listed below.</p>
<ul>
<li>Sample Games: Tic-Tac-Toe and Four in a Row </li>
<li>Game Invitations </li>
<li>Leaderboards </li>
<li>Game Friends </li>
<li>User Profile </li>
<li>Tests for both server and client code </li>
<li>Reusable JavaScript libraries </li>
</ul>
<p>In order to make the toolkit easy to setup and start using we have included our improved dependency checker and setup scripts. When you run the default setup you simply have to open the toolkit solution and run it. Everything is preconfigured to run on your local developer machine. You can read the full instructions for the setup <a href="http://go.microsoft.com/fwlink/p/?LinkID=223729">here</a>.<a href="http://nathantotten.files.wordpress.com/2011/11/dependancy-checker.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border-width:0;" title="dependancy-checker" border="0" alt="dependancy-checker" src="http://nathantotten.files.wordpress.com/2011/11/dependancy-checker_thumb.png?w=566&#038;h=424" width="566" height="424" /></a>     <br /><em>Windows Azure Toolkit for Social Games dependency checker.</em></p>
<p>In addition to running the toolkit locally you can also use the setup tools to configuration the toolkit for deployment to Windows Azure. You can read the full instructions for deploying the toolkit <a href="http://go.microsoft.com/fwlink/p/?LinkID=234206">here</a>. Publishing the toolkit is even easier than before with the updated Windows Azure Tools and SDK Version 1.6. You can see the updated publish dialog below.     <br /><a href="http://nathantotten.files.wordpress.com/2011/11/snaghtml3814174.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border-width:0;" title="SNAGHTML3814174" border="0" alt="SNAGHTML3814174" src="http://nathantotten.files.wordpress.com/2011/11/snaghtml3814174_thumb.png?w=685&#038;h=463" width="685" height="463" /></a>     <br /><em>Windows Azure Publish Dialog</em></p>
<p>As I mentioned previously, the Tankster game is still available for download as a sample. We will continue to update and release future versions of the Tankster game. For now, you can download Version 1.0 of Tankster <a href="http://go.microsoft.com/fwlink/p/?LinkID=234063">here</a>.</p>
<p><a href="http://nathantotten.files.wordpress.com/2011/11/tankster-game-play.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border-width:0;" title="tankster-game-play" border="0" alt="tankster-game-play" src="http://nathantotten.files.wordpress.com/2011/11/tankster-game-play_thumb.png?w=499&#038;h=365" width="499" height="365" /></a></p>
<p>Finally, if you want to see the toolkit in action you can access it at <a href="http://watgames4.cloudapp.net/">http://watgames4.cloudapp.net/</a>. Feel free to login and play a couple games of Tic-Tac-Toe or Four in a Row. If you use multiple browsers you can even challenge yourself to a game!</p>
<p>As always, please let me know if you have any comments or feedback.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nathantotten.wordpress.com/988/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nathantotten.wordpress.com/988/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nathantotten.wordpress.com/988/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nathantotten.wordpress.com/988/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nathantotten.wordpress.com/988/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nathantotten.wordpress.com/988/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nathantotten.wordpress.com/988/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nathantotten.wordpress.com/988/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nathantotten.wordpress.com/988/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nathantotten.wordpress.com/988/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nathantotten.wordpress.com/988/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nathantotten.wordpress.com/988/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nathantotten.wordpress.com/988/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nathantotten.wordpress.com/988/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.ntotten.com&amp;blog=30834763&amp;post=988&amp;subd=nathantotten&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.ntotten.com/2011/11/16/windows-azure-toolkit-for-social-games-version-1-1/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d48b998c2dce49ca309710eba498c562?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">ntotten</media:title>
		</media:content>

		<media:content url="http://nathantotten.files.wordpress.com/2011/11/snaghtml377dc3c_thumb1.png" medium="image">
			<media:title type="html">SNAGHTML377dc3c</media:title>
		</media:content>

		<media:content url="http://nathantotten.files.wordpress.com/2011/11/dependancy-checker_thumb.png" medium="image">
			<media:title type="html">dependancy-checker</media:title>
		</media:content>

		<media:content url="http://nathantotten.files.wordpress.com/2011/11/snaghtml3814174_thumb.png" medium="image">
			<media:title type="html">SNAGHTML3814174</media:title>
		</media:content>

		<media:content url="http://nathantotten.files.wordpress.com/2011/11/tankster-game-play_thumb.png" medium="image">
			<media:title type="html">tankster-game-play</media:title>
		</media:content>
	</item>
		<item>
		<title>Command-Query Separation on Windows Azure</title>
		<link>http://blog.ntotten.com/2011/10/24/command-query-separation-on-windows-azure/</link>
		<comments>http://blog.ntotten.com/2011/10/24/command-query-separation-on-windows-azure/#comments</comments>
		<pubDate>Mon, 24 Oct 2011 15:19:57 +0000</pubDate>
		<dc:creator>Nathan Totten</dc:creator>
				<category><![CDATA[Windows Azure]]></category>

		<guid isPermaLink="false">http://ntotten.com/?p=934</guid>
		<description><![CDATA[Command-query separation is a fairly common approach to software development. There are a lot of different flavors and opinions on how it should be implemented, but at the core it is about separating your write methods from your read methods. This post &#8230; <a href="http://blog.ntotten.com/2011/10/24/command-query-separation-on-windows-azure/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.ntotten.com&amp;blog=30834763&amp;post=934&amp;subd=nathantotten&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://en.wikipedia.org/wiki/Command-query_separation">Command-query separation</a> is a fairly common approach to software development. There are a lot of different flavors and opinions on how it should be implemented, but at the core it is about separating your write methods from your read methods. This post will discuss one of the most common ways to use that pattern on Windows Azure. I am going to focus on the big picture of this rather than some of the finer details. There are plenty of <a href="http://abdullin.com/cqrs">articles</a> out there on building hard-core CQRS systems if you want to dive into the details.</p>
<p>To begin, lets review a few of the concepts behind the command-query pattern. First, the core principle is that every method should either send data or receive data, but never both. Second, while the pattern itself isn&#8217;t focused on building to scale it works very well for many high scale applications. By combining the command-query pattern with some of our Windows Azure best practices we can create a highly reliable and scalable system that is both easy to design and easy to maintain.</p>
<p>Below you will see the basic steps in the command-query process.</p>
<p><a href="http://nathantotten.files.wordpress.com/2011/10/image1.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border:0;" title="image" src="http://nathantotten.files.wordpress.com/2011/10/image_thumb1.png?w=565&#038;h=504" alt="image" width="565" height="504" border="0" /></a></p>
<p>When you review the diagram there are a few things to note. First, is that we are performing our read operations directly from blob storage. This allows us to rely on the high scale of the Windows Azure storage systems and offload some of our HTTP requests from our Web Role.</p>
<p>Second, the heavy lifting of this application (Step 7) occurs in a Worker Role. This allows us to have fewer Web Roles and to ensure our web server is doing minimal work so that it is always extremely responsive.</p>
<p>Finally, because every command goes through our Windows Azure storage queues we can control the rate at which data is processed more easily. For example, if we had a third-party web service that could only handle say 100 requests per second and our system was processing 200 requests per second we could throttle the worker processing back to ensure we don’t overload the third party server.</p>
<p>Before we dive into the example, I want to setup the scenario. For the purposes of this article we are going to build a simple command-query user registration system. The user registration will contain a simple form with first name, last name, email, and date of birth. The goal will be to register the user and return a registration token to the client after the registration is successful.</p>
<p>To begin the user is presented with the simple registration form.</p>
<p><a href="http://nathantotten.files.wordpress.com/2011/10/snaghtmlc081df.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border:0;" title="SNAGHTMLc081df" src="http://nathantotten.files.wordpress.com/2011/10/snaghtmlc081df_thumb.png?w=565&#038;h=405" alt="SNAGHTMLc081df" width="565" height="405" border="0" /></a></p>
<p><em>(Step 1)</em> After the user clicks register, we submit the form using some simple ajax. The sample uses ASP.NET MVC3 for the single service, but you could use anything you like. Below you will find the controller action.</p>
<p><pre class="brush: csharp;">
[HttpPost]
public ActionResult Register(RegisterModel model)
{
	var queue =
		new AzureQueue&lt;UserRegistrationMessage&gt;
		(account);
	var registrationBlob =
		new AzureBlobContainer&lt;RegistrationTokenEntity&gt;
		(account, true);

	var containerId = Guid.NewGuid().ToString();
	registrationBlob.Save
	(containerId, new RegistrationTokenEntity
	{
		RegistrationToken = null,
	});

	var expires = DateTime.Now.AddHours(1);

	var blobContainer = registrationBlob
		.GetSharedAccessSignature(containerId, expires);

	queue.AddMessage(new UserRegistrationMessage
	{
		DateOfBirth = model.DateOfBirth,
		Email = model.Email,
		FirstName = model.FirstName,
		LastName = model.LastName,
		ContainerId = containerId,
	});

	return Json(new { container = blobContainer });
}
</pre></p>
<p><em>(Steps 2, 3, and 4)</em> As you can see a few things are happening here. First, we are creating a random ID for the container. Next, we save the the blob container. The container we save has our token value set to null. Finally, we create the shared access token for the blob and return the blob url to the client. Below you can see the contents of the registration result blob in its initial state.</p>
<p><pre class="brush: jscript;">
registrationtokenentityCallback({&quot;RegistrationToken&quot;:null})
</pre></p>
<p><em>(Step 5) </em>After we send the register post to the server our browser will show us a waiting page. In the background the browser is continually requesting the contents of the registration result blob. If the registration token is set to null, the client continues to poll the blob. This continues indefinitely. Note, in the real world you would want to handle the situation where there is either a failure and the blob doesn’t update or the processing is taking longer than usual.</p>
<p><a href="http://nathantotten.files.wordpress.com/2011/10/snaghtmlc200af.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border:0;" title="SNAGHTMLc200af" src="http://nathantotten.files.wordpress.com/2011/10/snaghtmlc200af_thumb.png?w=565&#038;h=405" alt="SNAGHTMLc200af" width="565" height="405" border="0" /></a></p>
<p><em>(Steps 6,7, and 8)</em> While the client is waiting for the registration result blob to update our worker role is polling the registration queue for new registrations. In this case a new registration is in the queue so the worker role reads the message. This is the point where you would do your heavy lifting. This could be anything from saving the registration to a database, sending it to a web service, validating for duplicates, etc. After your worker role is done processing the registration it creates a token for the registration. The worker then updates the registration result blob with the token.</p>
<p><pre class="brush: jscript;">
registrationtokenentityCallback(
   {&quot;RegistrationToken&quot;:&quot;665864095&quot;}
)
</pre></p>
<p>After the registration result blob is updated with the registration token the client stops polling the blob and displays the result. You can see the polling script below.</p>
<p><pre class="brush: jscript;">
var waitingId = null;
var tokenUrl = null;
$(document).ready(function () {
	step(0);
	$('#register').validate({
		submitHandler: function (form) {
			$(form).ajaxSubmit(function (result) {
				tokenUrl = result.container;
				waitingId =
                   setInterval('checkForToken()', 1000);
				step(1);
			});
		}
	})
});

function checkForToken() {
	try {
		$.ajax({
			type: &quot;GET&quot;,
			url: tokenUrl,
			dataType: &quot;jsonp&quot;,
			jsonpCallback: 'registrationtokenentityCallback'
		});
	} catch (ex) { }
}

function registrationtokenentityCallback(data) {
	var regToken = data.RegistrationToken;
	if (regToken != null) {
		clearInterval(waitingId);
		$('#txtToken').text(regToken);
		step(2);
	}
}
</pre></p>
<p><a href="http://nathantotten.files.wordpress.com/2011/10/snaghtmlc5cd12.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border:0;" title="SNAGHTMLc5cd12" src="http://nathantotten.files.wordpress.com/2011/10/snaghtmlc5cd12_thumb.png?w=565&#038;h=404" alt="SNAGHTMLc5cd12" width="565" height="404" border="0" /></a></p>
<p>That is the entire process for this basic command query example. The result is a flexible and distributed systems that allows you to handle even the largest scale.</p>
<p>You can find the entire source for this example on GitHub <a href="https://github.com/ntotten/Samples/tree/master/SimpleCommandQuery">here</a> or download the zip file <a href="https://github.com/ntotten/Samples/zipball/master">here</a>. Additionally, you can find a deployed version at <a href="http://simplecq.cloudapp.net">http://simplecq.cloudapp.net</a>.</p>
<p>Let me know if you have any questions.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nathantotten.wordpress.com/934/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nathantotten.wordpress.com/934/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nathantotten.wordpress.com/934/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nathantotten.wordpress.com/934/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nathantotten.wordpress.com/934/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nathantotten.wordpress.com/934/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nathantotten.wordpress.com/934/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nathantotten.wordpress.com/934/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nathantotten.wordpress.com/934/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nathantotten.wordpress.com/934/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nathantotten.wordpress.com/934/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nathantotten.wordpress.com/934/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nathantotten.wordpress.com/934/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nathantotten.wordpress.com/934/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.ntotten.com&amp;blog=30834763&amp;post=934&amp;subd=nathantotten&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.ntotten.com/2011/10/24/command-query-separation-on-windows-azure/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	

		<media:content url="http://1.gravatar.com/avatar/d48b998c2dce49ca309710eba498c562?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">ntotten</media:title>
		</media:content>

		<media:content url="http://nathantotten.files.wordpress.com/2011/10/image_thumb1.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://nathantotten.files.wordpress.com/2011/10/snaghtmlc081df_thumb.png" medium="image">
			<media:title type="html">SNAGHTMLc081df</media:title>
		</media:content>

		<media:content url="http://nathantotten.files.wordpress.com/2011/10/snaghtmlc200af_thumb.png" medium="image">
			<media:title type="html">SNAGHTMLc200af</media:title>
		</media:content>

		<media:content url="http://nathantotten.files.wordpress.com/2011/10/snaghtmlc5cd12_thumb.png" medium="image">
			<media:title type="html">SNAGHTMLc5cd12</media:title>
		</media:content>
	</item>
		<item>
		<title>Editing a Local Windows Azure Project with the Emulator Running</title>
		<link>http://blog.ntotten.com/2011/10/21/editing-a-local-windows-azure-project-with-the-emulator-running/</link>
		<comments>http://blog.ntotten.com/2011/10/21/editing-a-local-windows-azure-project-with-the-emulator-running/#comments</comments>
		<pubDate>Fri, 21 Oct 2011 19:57:24 +0000</pubDate>
		<dc:creator>Nathan Totten</dc:creator>
				<category><![CDATA[Windows Azure]]></category>

		<guid isPermaLink="false">http://ntotten.com/2011/10/editing-websites-while-running-in-the-local-windows-azure-emulator/</guid>
		<description><![CDATA[While working on another blog post today I just discovered a hidden gem in the Windows Azure Emulator. You can now edit projects and files while the emulator is running and view these changes without restarting the Windows Azure emulator. &#8230; <a href="http://blog.ntotten.com/2011/10/21/editing-a-local-windows-azure-project-with-the-emulator-running/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.ntotten.com&amp;blog=30834763&amp;post=935&amp;subd=nathantotten&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>While working on another blog post today I just discovered a hidden gem in the Windows Azure Emulator. You can now edit projects and files while the emulator is running and view these changes without restarting the Windows Azure emulator. For anyone who does lots of local development for Windows Azure this is a huge time saver. These changes were actually made in SDK 1.3 and refreshed in SDK 1.4.1, but somehow I did not notice them.</p>
<p>To refresh your memory on how inconvenient this used to be here are the steps you would have had to go through to make a minor CSS change and preview it while running in the local emulator.</p>
<ol>
<li>Make your edit</li>
<li>Run your application either through debugging (F5) or just by running it (Ctrl+F5).</li>
<li>Wait for the Windows Azure emulator to redeploy and start</li>
<li>Load your site.</li>
<li>Repeat.</li>
</ol>
<p>In all this process would take 30 seconds to a minute or so depending on the machine you are on. While generally not a huge deal for most work, when you are doing something like testing your CSS design or fine tuning some JavaScript this could become very inconvenient.</p>
<p>With the changes to the local emulator you can now edit static content while debugging your project and simply refresh the browser to see the changes. If you are just running your project (not debugging) you can actually make changes to your code as well. You can rebuild any of your project files and the changes will be immediately available to preview or test in the browser. The only thing you can not do is rebuild your entire solution.</p>
<p>This is a small minor change, but hopefully this helps you save a little time when developing on Windows Azure.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nathantotten.wordpress.com/935/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nathantotten.wordpress.com/935/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nathantotten.wordpress.com/935/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nathantotten.wordpress.com/935/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nathantotten.wordpress.com/935/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nathantotten.wordpress.com/935/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nathantotten.wordpress.com/935/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nathantotten.wordpress.com/935/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nathantotten.wordpress.com/935/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nathantotten.wordpress.com/935/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nathantotten.wordpress.com/935/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nathantotten.wordpress.com/935/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nathantotten.wordpress.com/935/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nathantotten.wordpress.com/935/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.ntotten.com&amp;blog=30834763&amp;post=935&amp;subd=nathantotten&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.ntotten.com/2011/10/21/editing-a-local-windows-azure-project-with-the-emulator-running/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d48b998c2dce49ca309710eba498c562?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">ntotten</media:title>
		</media:content>
	</item>
		<item>
		<title>Windows Azure at Seattle Interactive Conference</title>
		<link>http://blog.ntotten.com/2011/10/14/windows-azure-at-seattle-interactive-conference/</link>
		<comments>http://blog.ntotten.com/2011/10/14/windows-azure-at-seattle-interactive-conference/#comments</comments>
		<pubDate>Fri, 14 Oct 2011 16:50:54 +0000</pubDate>
		<dc:creator>Nathan Totten</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://ntotten.com/2011/10/windows-azure-at-seattle-interactive-conference/</guid>
		<description><![CDATA[The Cloud Experience track at SIC is for experienced developers who want to learn how to leverage the cloud for mobile, social and web app scenarios.&#160; No matter what platform or technology you choose to develop for, these sessions will &#8230; <a href="http://blog.ntotten.com/2011/10/14/windows-azure-at-seattle-interactive-conference/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.ntotten.com&amp;blog=30834763&amp;post=933&amp;subd=nathantotten&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://nathantotten.files.wordpress.com/2011/10/windowsazure.png"><img style="float:left;display:inline;background-image:none;border-width:0;" title="windowsazure" border="0" alt="windowsazure" align="left" src="http://nathantotten.files.wordpress.com/2011/10/windowsazure_thumb.png?w=240&#038;h=122" width="240" height="122" /></a>The <a href="http://www.seattleinteractive.com/conference/cloud-experience">Cloud Experience track</a> at SIC is for experienced developers who want to learn how to leverage the cloud for mobile, social and web app scenarios.&#160; No matter what platform or technology you choose to develop for, these sessions will provide you with a deeper understanding of cloud architecture, back end services and business models so you can scale for user demand and grow your business.</p>
<p><b><a href="http://seattleinteractive.eventbrite.com/">Register today</a> using the promo code “azure 200” and attend SIC for only $150 (a $200 savings).</b></p>
<ul>
<li>Attend a full day of technical sessions and learn more about leveraging the cloud for mobile, web and social scenarios. View the list of confirmed <a href="http://www.seattleinteractive.com/conference/speakers/cld">Cloud Experience speakers</a>.&#160; Sessions include:
<ul>
<li>Great Mobile Apps Make Money – Intro to Cloud Experience Track</li>
<li>Mobile + Cloud, Building Mobile Applications with Windows Azure</li>
<li>Zero to Hero: Windows Phone, Android, iOS Development in the Cloud</li>
<li>Building Web Applications with Windows Azure</li>
<li>Building Social Games on Windows Azure </li>
</ul>
</li>
<li>Cloud Experience speakers and technical experts will be available to provide technical assistance and resources for developing, deploying and managing mobile, social and web apps in the cloud. <a name="cloudtopics"></a></li>
</ul>
<p><b><a href="http://www.seattleinteractive.com/">Seattle Interactive Conference (SIC):</a></b><b> </b>November 2-3, 2011, The Conference Center at WSCC</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nathantotten.wordpress.com/933/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nathantotten.wordpress.com/933/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nathantotten.wordpress.com/933/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nathantotten.wordpress.com/933/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nathantotten.wordpress.com/933/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nathantotten.wordpress.com/933/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nathantotten.wordpress.com/933/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nathantotten.wordpress.com/933/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nathantotten.wordpress.com/933/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nathantotten.wordpress.com/933/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nathantotten.wordpress.com/933/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nathantotten.wordpress.com/933/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nathantotten.wordpress.com/933/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nathantotten.wordpress.com/933/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.ntotten.com&amp;blog=30834763&amp;post=933&amp;subd=nathantotten&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.ntotten.com/2011/10/14/windows-azure-at-seattle-interactive-conference/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d48b998c2dce49ca309710eba498c562?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">ntotten</media:title>
		</media:content>

		<media:content url="http://nathantotten.files.wordpress.com/2011/10/windowsazure_thumb.png" medium="image">
			<media:title type="html">windowsazure</media:title>
		</media:content>
	</item>
		<item>
		<title>Running Processes in Windows Azure</title>
		<link>http://blog.ntotten.com/2011/09/27/running-processes-in-windows-azure/</link>
		<comments>http://blog.ntotten.com/2011/09/27/running-processes-in-windows-azure/#comments</comments>
		<pubDate>Tue, 27 Sep 2011 16:05:40 +0000</pubDate>
		<dc:creator>Nathan Totten</dc:creator>
				<category><![CDATA[Windows Azure]]></category>
		<category><![CDATA[NodeJS]]></category>

		<guid isPermaLink="false">http://ntotten.com/?p=919</guid>
		<description><![CDATA[One of the little known features of the Windows Azure SDK 1.5 (September 2011) Release is the ability to directly run executables on startup without writing custom code in your WorkerRole or WebRole entry point. This feature is facilitated by &#8230; <a href="http://blog.ntotten.com/2011/09/27/running-processes-in-windows-azure/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.ntotten.com&amp;blog=30834763&amp;post=919&amp;subd=nathantotten&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>One of the little known features of the Windows Azure SDK 1.5 (September 2011) Release is the ability to directly run executables on startup without writing custom code in your WorkerRole or WebRole entry point.</p>
<p>This feature is facilitated by a new section in the service definition for the roles. You can see the new section and subsections below.</p>
<p><pre class="brush: xml;">
&lt;Runtime executionContext=&quot;[limited|elevated]&quot;&gt;
  &lt;Environment&gt;
	 &lt;Variable name=&quot;&lt;variable-name&gt;&quot; value=&quot;&lt;variable-value&gt;&quot;&gt;
		&lt;RoleInstanceValue xpath=&quot;&lt;xpath-to-role-environment-settings&gt;&quot;/&gt;
	  &lt;/Variable&gt;
  &lt;/Environment&gt;
  &lt;EntryPoint&gt;
	 &lt;NetFxEntryPoint assemblyName=&quot;&lt;name-of-assembly-containing-entrypoint&gt;&quot; targetFrameworkVersion=&quot;&lt;.net-framework-version&gt;&quot;/&gt;
	 &lt;ProgramEntryPoint commandLine=&quot;&lt;application&gt;&quot; setReadyOnProcessStart=&quot;[true|false]&quot; &quot;/&gt;
  &lt;/EntryPoint&gt;
&lt;/Runtime&gt;
</pre></p>
<p>For purposes of this example we are going to duplicate the simple NodeJS worker role that was created in a <a href="http://ntotten.com/2011/08/nodejs-on-windows-azure/">previous post</a>, but we are going to use the new ProgramEntryPoint functionality.</p>
<p>To begin we create a standard Windows Azure project with a single Worker Role.<br />
<a href="http://nathantotten.files.wordpress.com/2011/09/snaghtml1c4d831.png"><img style="border:0 currentcolor;display:inline;background-image:none;" title="SNAGHTML1c4d83" src="http://nathantotten.files.wordpress.com/2011/09/snaghtml1c4d83_thumb1.png?w=560&#038;h=386" alt="SNAGHTML1c4d83" width="560" height="386" border="0" /></a></p>
<p><a href="http://nathantotten.files.wordpress.com/2011/09/snaghtml1d1c081.png"><img style="border:0 currentcolor;display:inline;background-image:none;" title="SNAGHTML1d1c08" src="http://nathantotten.files.wordpress.com/2011/09/snaghtml1d1c08_thumb1.png?w=457&#038;h=286" alt="SNAGHTML1d1c08" width="457" height="286" border="0" /></a></p>
<p>Our starting point is a standard Worker Role.<br />
<a href="http://nathantotten.files.wordpress.com/2011/09/image.png"><img style="display:inline;background-image:none;" title="image" src="http://nathantotten.files.wordpress.com/2011/09/image_thumb.png?w=313&#038;h=247" alt="image" width="313" height="247" border="0" /></a></p>
<p>The first thing we need to do is delete the WorkerRole.cs file. We won’t be using that file or any other C# code for this project.<br />
<a href="http://nathantotten.files.wordpress.com/2011/09/image1.png"><img style="display:inline;background-image:none;" title="image" src="http://nathantotten.files.wordpress.com/2011/09/image_thumb1.png?w=313&#038;h=228" alt="image" width="313" height="228" border="0" /></a></p>
<p>Next, we add our node.exe and app.js files. Make sure to set the to “Content” and “Copy if newer”.<br />
<a href="http://nathantotten.files.wordpress.com/2011/09/image2.png"><img style="display:inline;background-image:none;" title="image" src="http://nathantotten.files.wordpress.com/2011/09/image_thumb2.png?w=313&#038;h=271" alt="image" width="313" height="271" border="0" /></a></p>
<p>Next, we need to tell Windows Azure to run our node application after the role starts. To do this open the ServiceDevinition.csdef file.</p>
<p><pre class="brush: xml;">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;ServiceDefinition name=&quot;WindowsAzureProject11&quot; xmlns=&quot;http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceDefinition&quot;&gt;
  &lt;WorkerRole name=&quot;WorkerRole1&quot; vmsize=&quot;Small&quot;&gt;
    &lt;Imports&gt;
      &lt;Import moduleName=&quot;Diagnostics&quot; /&gt;
    &lt;/Imports&gt;
  &lt;/WorkerRole&gt;
&lt;/ServiceDefinition&gt;
</pre></p>
<p>Now add the following lines to the csdef file. These lines tell Windows Azure that your role entry point is “node.exe app.js” and that when that process starts the role is ready. Note that we also added an endpoint for NodeJS on port 80 and also removed the diagnostics import.</p>
<p><pre class="brush: xml;">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;ServiceDefinition name=&quot;WindowsAzureProject11&quot; xmlns=&quot;http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceDefinition&quot;&gt;
  &lt;WorkerRole name=&quot;WorkerRole1&quot; vmsize=&quot;Small&quot;&gt;
    &lt;Runtime executionContext=&quot;limited&quot;&gt;
      &lt;EntryPoint&gt;
        &lt;ProgramEntryPoint commandLine=&quot;node.exe app.js&quot; setReadyOnProcessStart=&quot;true&quot; /&gt;
      &lt;/EntryPoint&gt;
    &lt;/Runtime&gt;
    &lt;Endpoints&gt;
      &lt;InputEndpoint name=&quot;NodeJS&quot; protocol=&quot;tcp&quot; port=&quot;80&quot; /&gt;
    &lt;/Endpoints&gt;
  &lt;/WorkerRole&gt;
&lt;/ServiceDefinition&gt;
</pre></p>
<p>Finally, we are ready to deploy our project. After you deploy the project you will see your NodeJS server running all without writing a single line of .Net code.</p>
<p>Another thing to note is that if your NodeJS server shuts down for any reason the Worker Role will recycle and restart the process. This way you don’t have to worry about restarting the services yourself.</p>
<p>While our example used NodeJS, you can use pretty much any process like this. There are also ways of using .Net code in this fashion as well to make it even easier to transition your existing application to Windows Azure.</p>
<p>You can see my working demo deployed here: <a href="http://simplenodejs.cloudapp.net/">http://simplenodejs.cloudapp.net/</a></p>
<p>Let me know how this works or if you have any questions or feedback.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nathantotten.wordpress.com/919/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nathantotten.wordpress.com/919/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nathantotten.wordpress.com/919/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nathantotten.wordpress.com/919/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nathantotten.wordpress.com/919/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nathantotten.wordpress.com/919/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nathantotten.wordpress.com/919/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nathantotten.wordpress.com/919/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nathantotten.wordpress.com/919/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nathantotten.wordpress.com/919/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nathantotten.wordpress.com/919/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nathantotten.wordpress.com/919/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nathantotten.wordpress.com/919/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nathantotten.wordpress.com/919/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.ntotten.com&amp;blog=30834763&amp;post=919&amp;subd=nathantotten&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.ntotten.com/2011/09/27/running-processes-in-windows-azure/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d48b998c2dce49ca309710eba498c562?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">ntotten</media:title>
		</media:content>

		<media:content url="http://nathantotten.files.wordpress.com/2011/09/snaghtml1c4d83_thumb1.png" medium="image">
			<media:title type="html">SNAGHTML1c4d83</media:title>
		</media:content>

		<media:content url="http://nathantotten.files.wordpress.com/2011/09/snaghtml1d1c08_thumb1.png" medium="image">
			<media:title type="html">SNAGHTML1d1c08</media:title>
		</media:content>

		<media:content url="http://nathantotten.files.wordpress.com/2011/09/image_thumb.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://nathantotten.files.wordpress.com/2011/09/image_thumb1.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://nathantotten.files.wordpress.com/2011/09/image_thumb2.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>
	</item>
	</channel>
</rss>
