<?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>Hmadrigal&#039;s Blog</title>
	<atom:link href="http://hmadrigal.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://hmadrigal.wordpress.com</link>
	<description>More about tech and life ;-)</description>
	<lastBuildDate>Tue, 24 Apr 2012 03:51:48 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='hmadrigal.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Hmadrigal&#039;s Blog</title>
		<link>http://hmadrigal.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://hmadrigal.wordpress.com/osd.xml" title="Hmadrigal&#039;s Blog" />
	<atom:link rel='hub' href='http://hmadrigal.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Automatic retries using the Transient Fault Handling from Enterprise libraries (EntLib)</title>
		<link>http://hmadrigal.wordpress.com/2012/04/23/automatic-retries-using-the-transient-fault-handling-from-enterprise-libraries-entlib/</link>
		<comments>http://hmadrigal.wordpress.com/2012/04/23/automatic-retries-using-the-transient-fault-handling-from-enterprise-libraries-entlib/#comments</comments>
		<pubDate>Tue, 24 Apr 2012 03:48:04 +0000</pubDate>
		<dc:creator>hmadrigal</dc:creator>
				<category><![CDATA[.net]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[developer]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[csharp]]></category>
		<category><![CDATA[enterprise libraries]]></category>
		<category><![CDATA[entlib]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://hmadrigal.wordpress.com/?p=351</guid>
		<description><![CDATA[Hello, I was reading about the Transient Fault Handling at http://msdn.microsoft.com/en-us/library/hh680901(v=pandp.50).aspx This is a block of the Enterprise Libraries which is part of the Enterprise Integration Pack for Windows Azure. I haven&#8217;t played much with Azure yet, but one part of the documentation took my attention: When Should You Use the Transient Fault Handling Application Block? &#8230;&#8230; (some [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hmadrigal.wordpress.com&amp;blog=10596476&amp;post=351&amp;subd=hmadrigal&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Hello,</p>
<p>I was reading about the Transient Fault Handling at <a href="http://msdn.microsoft.com/en-us/library/hh680901(v=pandp.50).aspx">http://msdn.microsoft.com/en-us/library/hh680901(v=pandp.50).aspx</a> This is a block of the Enterprise Libraries which is part of the <em>Enterprise Integration Pack for Windows Azure</em>. I haven&#8217;t played much with Azure yet, but one part of the documentation took my attention:</p>
<blockquote><p><strong>When Should You Use the Transient Fault Handling Application Block?<br />
</strong>&#8230;&#8230; (some explanation about when you are using Azure services) &#8230;&#8230;<br />
<strong>You Are Using a Custom Service</strong><br />
If your application uses a custom service, it can still benefit from using the Transient Fault Handling Application Block. You can author a custom detection strategy for your service that encapsulates your knowledge of which transient exceptions may result from a service invocation. The Transient Fault Handling Application Block then provides you with the framework for defining retry policies and for wrapping your method calls so that the application block applies the retry logic.Source: <a href="http://msdn.microsoft.com/en-us/library/hh680901(v=pandp.50).aspx#sec10">http://msdn.microsoft.com/en-us/library/hh680901(v=pandp.50).aspx#sec10</a></p></blockquote>
<p>So, I thought why do I have to write always the retry logic if this is already done <img src='http://s1.wp.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> .</p>
<p><strong>The problem</strong></p>
<p>We want to write a generic retry mechanism for our application. Moreover we need to support some level of customization thru configuration files.</p>
<p><strong>The solution</strong><br />
Simple let set up the Transient Fault Handling Block (from now on FHB). First of fall you will have to download the libraries, you could do it using NuGet &#8211; which by default adds also references to support Windows Azure -. You can remove the Windows Azure DLL if you&#8217;re not going to be using Windows Azure in your app.</p>
<p>The FHB lets you specify a error detection strategy as well as retry strategy when you construct the retry policy. Also, a Retry policy support the execution of Action, Funcdelegates or Actionfor async retries.</p>
<p>As part of the configuration process for FHB, it&#8217;s required to indicate which errors should be handled by FHB. A mechanism for doing this is by implementing the interface: ITransientErrorDetectionStrategy. In our sample, we only want to retry when a FileNotFoundException is thrown. Thus we have coded the FileSystemTransientErrorDetectionStrategy:</p>
<p><pre class="brush: csharp;">
using System;
using System.IO;
using Microsoft.Practices.TransientFaultHandling;

namespace SampleConsoleApplication.TransientErrors.Strategies
{
    public class FileSystemTransientErrorDetectionStrategy : ITransientErrorDetectionStrategy
    {
        #region ITransientErrorDetectionStrategy Members

        public bool IsTransient(Exception ex)
        {
            return ex is FileNotFoundException;
        }

        #endregion
    }
}
</pre></p>
<p>Certainly you could implement it by handling any particular exception.<br />
Now we need to define a retry policy. This is done by specifying a retry strategy. The following code example configures a retry policy by providing a retry strategy incremental. Additionally in our sample service.DoSlowAndImportantTask will always fail, so the FHB will retry automatically based on the retry policy.</p>
<p><pre class="brush: csharp;">
 private static void RetryPolityUsingCode(IUnityContainer container, IService service, OutputWriterService writer)
        {
            writer.WriteLine(&quot;Begin sample: RetryPolityUsingCode&quot;);
            // Define your retry strategy: retry 5 times, starting 1 second apart
            // and adding 2 seconds to the interval each retry.
            var retryStrategy = new Incremental(5, TimeSpan.FromSeconds(1), TimeSpan.FromSeconds(2));

            // Define your retry policy using the retry strategy and the Windows Azure storage
            // transient fault detection strategy.
            var retryPolicy = new RetryPolicy(retryStrategy);

            try
            {
                // Do some work that may result in a transient fault.
                retryPolicy.ExecuteAction(service.DoSlowAndImportantTask);
            }
            catch (Exception exception)
            {
                // All the retries failed.
                writer.WriteLine(&quot;An Exception has been thrown:\n{0}&quot;, exception);
            }
            writer.WriteLine(&quot;End sample: RetryPolityUsingCode&quot;);
        }
</pre></p>
<p>Additionally it&#8217;s possible to specify the retry policy in the configuration file, for example:</p>
<p><pre class="brush: xml;">
&lt;!--?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot; ?--&gt;

&lt;section name=&quot;RetryPolicyConfiguration&quot; type=&quot;Microsoft.Practices.EnterpriseLibrary.WindowsAzure.TransientFaultHandling.Configuration.RetryPolicyConfigurationSettings, Microsoft.Practices.EnterpriseLibrary.WindowsAzure.TransientFaultHandling&quot; requirepermission=&quot;true&quot;&gt;&lt;/section&gt;&lt;section name=&quot;typeRegistrationProvidersConfiguration&quot; type=&quot;Microsoft.Practices.EnterpriseLibrary.Common.Configuration.TypeRegistrationProvidersConfigurationSection, Microsoft.Practices.EnterpriseLibrary.Common&quot;&gt;&lt;/section&gt;

</pre></p>
<p>Please notice that there is a default Retry Strategy indicating that will use &#8220;Fixed Interval Retry Strategy&#8221;. Our C# code will ask for the RetryManager instance in order to retrieve the Retry Policy and then perform the task.</p>
<p><pre class="brush: csharp;">
private static void RetryPolityUsingConfigFile(IUnityContainer container, IService service, OutputWriterService writer)
        {
            writer.WriteLine(&quot;Begin sample: RetryPolityUsingConfigFile&quot;);
            // Gets the current Retry Manager configuration
            var retryManager = EnterpriseLibraryContainer.Current.GetInstance();

            // Asks for the default Retry Policy. Keep on mind that it's possible to ask for an specific one.
            var retryPolicy = retryManager.GetRetryPolicy();
            try
            {
                // Do some work that may result in a transient fault.
                retryPolicy.ExecuteAction(service.DoSlowAndImportantTask);
            }
            catch (Exception exception)
            {
                // All the retries failed.
                writer.WriteLine(&quot;An Exception has been thrown:\n{0}&quot;, exception);
            }
            writer.WriteLine(&quot;End sample: RetryPolityUsingConfigFile&quot;);
        }
</pre></p>
<p>The Transient Fault Handling Block a simple and flexible alternative for a well-known task. A automatic retry system, moreover this supports configuration file, so we should be able to change the retry policy just by modifying our configuration file.</p>
<p>Here is an screen shot of the app, which automatically retries calling our mischievous method.</p>
<p><a href="http://hmadrigal.files.wordpress.com/2012/04/transientfaulthandlingtriesoutputcapture.png"><img class="aligncenter size-medium wp-image-355" title="Transient Fault Handling Tries Output Capture" src="http://hmadrigal.files.wordpress.com/2012/04/transientfaulthandlingtriesoutputcapture.png?w=203&#038;h=300" alt="Transient Fault Handling Tries Output Capture" width="203" height="300" /></a></p>
<p>As usual the code sample is at <a href="https://github.com/hmadrigal/CodeSamples/tree/master/TransientFaultHandling">https://github.com/hmadrigal/CodeSamples/tree/master/TransientFaultHandling</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/hmadrigal.wordpress.com/351/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/hmadrigal.wordpress.com/351/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/hmadrigal.wordpress.com/351/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/hmadrigal.wordpress.com/351/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/hmadrigal.wordpress.com/351/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/hmadrigal.wordpress.com/351/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/hmadrigal.wordpress.com/351/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/hmadrigal.wordpress.com/351/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/hmadrigal.wordpress.com/351/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/hmadrigal.wordpress.com/351/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/hmadrigal.wordpress.com/351/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/hmadrigal.wordpress.com/351/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/hmadrigal.wordpress.com/351/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/hmadrigal.wordpress.com/351/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hmadrigal.wordpress.com&amp;blog=10596476&amp;post=351&amp;subd=hmadrigal&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://hmadrigal.wordpress.com/2012/04/23/automatic-retries-using-the-transient-fault-handling-from-enterprise-libraries-entlib/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6e8659583670c9667aaa010e1a0f318e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Yogurt</media:title>
		</media:content>

		<media:content url="http://hmadrigal.files.wordpress.com/2012/04/transientfaulthandlingtriesoutputcapture.png?w=203" medium="image">
			<media:title type="html">Transient Fault Handling Tries Output Capture</media:title>
		</media:content>
	</item>
		<item>
		<title>Multiple configuration files per environment</title>
		<link>http://hmadrigal.wordpress.com/2012/04/02/multiple-configuration-files-per-environment/</link>
		<comments>http://hmadrigal.wordpress.com/2012/04/02/multiple-configuration-files-per-environment/#comments</comments>
		<pubDate>Tue, 03 Apr 2012 04:12:05 +0000</pubDate>
		<dc:creator>hmadrigal</dc:creator>
				<category><![CDATA[.net]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[developer]]></category>
		<category><![CDATA[microsoft]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[msbuild]]></category>
		<category><![CDATA[programing]]></category>
		<category><![CDATA[visual studio]]></category>

		<guid isPermaLink="false">http://hmadrigal.wordpress.com/2012/04/02/multiple-configuration-files-per-environment/</guid>
		<description><![CDATA[Hello, Today I had the chance to perform a quick research about a classic problem. If have different settings for development, testing, staging and production. So, we usually merge or lost settings of the configuration files. Visual Studio 2008 have already resolved the problem (at least in web applications) by allowing the user to create [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hmadrigal.wordpress.com&amp;blog=10596476&amp;post=337&amp;subd=hmadrigal&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Hello,</p>
<p>Today I had the chance to perform a quick research about a classic problem. If have different settings for development, testing, staging and production. So, we usually merge or lost settings of the configuration files. Visual Studio 2008 have already resolved the problem (at least in web applications) by allowing the user to create different web.config files and applying XSLT to generate the final configuration file. Today I&#8217;ll propose the same solution, but for desktop Apps, and hopefully you could apply this solution to any XML file.</p>
<p>Just in case you&#8217;re one of those who want to download a sample, you coudl get it at <a href="https://github.com/hmadrigal/CodeSamples/tree/master/MultipleConfigurationFilesSample">https://github.com/hmadrigal/CodeSamples/tree/master/MultipleConfigurationFilesSample</a></p>
<h1></h1>
<h1><strong>The Problem:</strong></h1>
<p>We have a configuration file ( .config or any xml document), and we want to have different settings per environment (development, testing, staging and production). Moreover we want to automate this process, so we don&#8217;t have to write the settings manually.</p>
<h2><strong>Remarks</strong></h2>
<ul>
<li>It&#8217;s good to know basics of MSBuild and how to modify project.</li>
<li>It&#8217;s good to know about XML, XPath and XSLT</li>
</ul>
<h1><strong>The solution</strong></h1>
<h2><strong>Create one configuration per environment </strong></h2>
<p>Let&#8217;s start by creating configuration settings for each environment where you need custom settings. You could do it by click on &#8220;<em>Configuration Manager&#8230;</em>&#8220;. For example I&#8217;ve created the environments that we&#8217;re gonna use on this example.</p>
<p><a href="http://hmadrigal.files.wordpress.com/2012/04/creatingconfigurationcapture.png"><img class="size-full wp-image aligncenter" src="http://hmadrigal.files.wordpress.com/2012/04/creatingconfigurationcapture.png?w=463" alt="Image" /></a></p>
<p>Now, add a configuration file (in our case app.config) and also add one config file per environment. Please note that the configuration file app.config contains most of the final content, and the other configuration files will hold only XSLT expressions to modify the original. As a convention usually the file names are: <em>app.$(environment).config</em>. The following image illustrates the configuration files:</p>
<p><a href="http://hmadrigal.files.wordpress.com/2012/04/configurationfilescapture.png"><img class="size-full wp-image aligncenter" src="http://hmadrigal.files.wordpress.com/2012/04/configurationfilescapture.png?w=342" alt="Image" /></a></p>
<p>More in detail app.config, contains three simple settings:</p>
<p><pre class="brush: xml;">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;configuration&gt;
  &lt;appSettings&gt;
    &lt;add key=&quot;EnvironmentName&quot; value=&quot;Debug&quot; /&gt;
    &lt;add key=&quot;ApplicationDatabase&quot; value=&quot;Data Source=DevelopmentServer\SQLEXPRESS;Initial Catalog=DevelopmentDatabase;Integrated Security=True;&quot; /&gt;
    &lt;add key=&quot;ServerSharedPath&quot; value=&quot;\\127.0.0.1&quot; /&gt;
  &lt;/appSettings&gt;
&lt;/configuration&gt;</pre></p>
<h2>Set up your project to use a <em>XslTransform</em> task once the compilation is done</h2>
<p>Now you will have to edit the project file using a text editor. VS project files are XML, these normally are read by VS and see the project structure. However there are tasks that only can be customized by editing manually the XML file. You can modify the xml of a project within Visual Studio by using right (secondary) click on the project from the Solution Explorer. Then, click on &#8220;Unload project&#8221;, and once again right click and now select &#8220;Edit project &#8230;&#8221;. Now, you should be able to see the XML associated to the selected project.</p>
<p>You&#8217;ll be adding two targets (or if modifying if any of them is already in place). The following code:</p>
<p><pre class="brush: xml;">
&lt;Target Name=&quot;ApplySpecificConfiguration&quot; Condition=&quot;Exists('App.$(Configuration).config')&quot;&gt;
    &lt;XslTransformation XmlInputPaths=&quot;App.config&quot; XslInputPath=&quot;App.$(Configuration).config&quot; OutputPaths=&quot;$(OutputPath)$(RootNamespace).$(OutputType).config&quot; /&gt;
    &lt;Copy SourceFiles=&quot;$(OutputPath)$(RootNamespace).$(OutputType).config&quot; DestinationFiles=&quot;$(OutputPath)$(RootNamespace).vshost.$(OutputType).config&quot; /&gt;
  &lt;/Target&gt;
  &lt;Target Name=&quot;AfterBuild&quot;&gt;
    &lt;CallTarget Targets=&quot;ApplySpecificConfiguration&quot; /&gt;
  &lt;/Target&gt;
</pre></p>
<p>The previous XML portion Adds a custom task called and it uses MSBuild variables to determine the name of the configuration file, our example is using a Console App, thus we need to create a copy of the config file but with vshost.config extension, so we added a copy task.  The second thing we&#8217;ve added is a call to the task we&#8217;ve just created, this call is added into the AfterBuild Target. The AfterBuild is invoked by MSBuild automatically when the build process has finished.</p>
<h2>Transform your app.config with XSLT</h2>
<p>On this section, we&#8217;re gonna write the content for each configuration. This will let us custom XML porting into the final configuration file. As example, here is the XML for the production transformation:</p>
<p><pre class="brush: xml;">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;xsl:stylesheet version=&quot;1.0&quot; xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot; xmlns:msxsl=&quot;urn:schemas-microsoft-com:xslt&quot; exclude-result-prefixes=&quot;msxsl&quot;&gt;
  &lt;xsl:output method=&quot;xml&quot; indent=&quot;yes&quot;/&gt;

  &lt;!-- Nodes to be replaces --&gt;
  &lt;xsl:template match=&quot;/configuration/appSettings/add[@key='EnvironmentName']&quot;&gt;
    &lt;add key=&quot;EnvironmentName&quot; value=&quot;Production&quot; /&gt;
  &lt;/xsl:template&gt;
  &lt;xsl:template match=&quot;/configuration/appSettings/add[@key='ApplicationDatabase']&quot;&gt;
    &lt;add key=&quot;ApplicationDatabase&quot; value=&quot;Data Source=PRODUCTION\SQLEXPRESS;Initial Catalog=ProductionDatabase;Integrated Security=True;&quot; /&gt;
  &lt;/xsl:template&gt;
  &lt;xsl:template match=&quot;/configuration/appSettings/add[@key='ServerSharedPath']&quot;&gt;
    &lt;add key=&quot;ServerSharedPath&quot; value=&quot;\\PRODUCTION&quot; /&gt;
  &lt;/xsl:template&gt;

  &lt;!-- Copy all the remaining nodes --&gt;
  &lt;xsl:template match=&quot;node()|@*&quot;&gt;
    &lt;xsl:copy&gt;
      &lt;xsl:apply-templates select=&quot;node()|@*&quot;/&gt;
    &lt;/xsl:copy&gt;
  &lt;/xsl:template&gt;
&lt;/xsl:stylesheet&gt;
</pre></p>
<p>I know XSLT might sound intimidating at first, but it&#8217;s kinda easy.BTW XSLT uses XPath, so if you want to know the basics of them, please check out w3c school for a quick reference. XPath at <a href="http://www.w3schools.com/xpath/xpath_examples.asp" target="_blank">http://www.w3schools.com/xpath/xpath_examples.asp</a> and XSLT at <a href="http://www.w3schools.com/xsl/xsl_transformation.asp" target="_blank">http://www.w3schools.com/xsl/xsl_transformation.asp</a></p>
<p>To put it in a nutshell, our XSLT is detecting specifically three attributes (by its name and location into the XML) and replacing them with a custom value. All the remaining nodes are kept into the final XML.</p>
<h1><strong>Let run our sample</strong></h1>
<p>Just to make it work I&#8217;ve coded two classes, one that defines the constant name of the settings and a main class which print values from the configuration file.</p>
<p><pre class="brush: csharp;">
using System;
using System.Configuration;

namespace MultipleConfigurationFilesSample
{
    public static class ApplicationConstants
    {
        public class AppSettings
        {
            public const string ServerSharedPath = @&quot;ServerSharedPath&quot;;
            public const string EnvironmentName = @&quot;EnvironmentName&quot;;
            public const string ApplicationDatabase = @&quot;ApplicationDatabase&quot;;
        }
    }
    class Program
    {
        static void Main(string[] args)
        {
            var environment = ConfigurationManager.AppSettings[ApplicationConstants.AppSettings.EnvironmentName];
            var serverSharedPath = ConfigurationManager.AppSettings[ApplicationConstants.AppSettings.ServerSharedPath];
            Console.WriteLine(@&quot;Environment: {0} ServerSharedPath:{1}&quot;, environment, serverSharedPath);
            Console.ReadKey();
        }
    }
}

</pre></p>
<p>Now I have run the application twice, but using different configurations. The first was using development and I got the following output:</p>
<p><a href="http://hmadrigal.files.wordpress.com/2012/04/developmentoutputcapture.png"><img class="size-full wp-image" src="http://hmadrigal.files.wordpress.com/2012/04/developmentoutputcapture.png?w=667" alt="Image" /></a></p>
<p>The second was using Production configuration, and it produces the following output:</p>
<p><a href="http://hmadrigal.files.wordpress.com/2012/04/productioncapture.png"><img class="size-full wp-image" src="http://hmadrigal.files.wordpress.com/2012/04/productioncapture.png?w=667" alt="Image" /></a></p>
<p>As you can see, the selected environment is determining the settings into the resultant configuration file.</p>
<p>As usual the source code can be fond at <a href="https://github.com/hmadrigal/CodeSamples/tree/master/MultipleConfigurationFilesSample">https://github.com/hmadrigal/CodeSamples/tree/master/MultipleConfigurationFilesSample</a></p>
<p>References:<br />
<a href="http://litemedia.info/transforming-an-app-config-file">References: http://litemedia.info/transforming-an-app-config-file</a></p>
<p>Best regards,<br />
Herber</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/hmadrigal.wordpress.com/337/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/hmadrigal.wordpress.com/337/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/hmadrigal.wordpress.com/337/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/hmadrigal.wordpress.com/337/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/hmadrigal.wordpress.com/337/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/hmadrigal.wordpress.com/337/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/hmadrigal.wordpress.com/337/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/hmadrigal.wordpress.com/337/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/hmadrigal.wordpress.com/337/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/hmadrigal.wordpress.com/337/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/hmadrigal.wordpress.com/337/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/hmadrigal.wordpress.com/337/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/hmadrigal.wordpress.com/337/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/hmadrigal.wordpress.com/337/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hmadrigal.wordpress.com&amp;blog=10596476&amp;post=337&amp;subd=hmadrigal&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://hmadrigal.wordpress.com/2012/04/02/multiple-configuration-files-per-environment/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6e8659583670c9667aaa010e1a0f318e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Yogurt</media:title>
		</media:content>

		<media:content url="http://hmadrigal.files.wordpress.com/2012/04/creatingconfigurationcapture.png?w=463" medium="image">
			<media:title type="html">Image</media:title>
		</media:content>

		<media:content url="http://hmadrigal.files.wordpress.com/2012/04/configurationfilescapture.png?w=342" medium="image">
			<media:title type="html">Image</media:title>
		</media:content>

		<media:content url="http://hmadrigal.files.wordpress.com/2012/04/developmentoutputcapture.png?w=667" medium="image">
			<media:title type="html">Image</media:title>
		</media:content>

		<media:content url="http://hmadrigal.files.wordpress.com/2012/04/productioncapture.png?w=667" medium="image">
			<media:title type="html">Image</media:title>
		</media:content>
	</item>
		<item>
		<title>How to create a plug in using C# .NET (4.0) and MEF</title>
		<link>http://hmadrigal.wordpress.com/2012/03/08/how-to-create-a-plug-in-using-c-net-4-0-and-mef/</link>
		<comments>http://hmadrigal.wordpress.com/2012/03/08/how-to-create-a-plug-in-using-c-net-4-0-and-mef/#comments</comments>
		<pubDate>Fri, 09 Mar 2012 02:50:04 +0000</pubDate>
		<dc:creator>hmadrigal</dc:creator>
				<category><![CDATA[.net]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[developer]]></category>
		<category><![CDATA[extensions]]></category>
		<category><![CDATA[mef]]></category>
		<category><![CDATA[microsoft]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[composite application]]></category>
		<category><![CDATA[design patterns]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[plug in]]></category>
		<category><![CDATA[plugin]]></category>

		<guid isPermaLink="false">http://hmadrigal.wordpress.com/?p=275</guid>
		<description><![CDATA[Hello, Long time ago I wrote my approach of how to write a plugin (add in) using Microsoft Unity (http://unity.codeplex.com/). In my old approach (http://hmadrigal.wordpress.com/2010/03/28/writing-a-plug-in/) was using the unity.config file to load dynamically the plugins. Certainly the major issue with this approach it&#8217;s that you will have to update your unity.config file every time you [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hmadrigal.wordpress.com&amp;blog=10596476&amp;post=275&amp;subd=hmadrigal&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Hello,</p>
<p>Long time ago I wrote my approach of how to write a plugin (add in) using Microsoft Unity (<a href="http://unity.codeplex.com/">http://unity.codeplex.com/</a>). In my old approach (<a href="http://hmadrigal.wordpress.com/2010/03/28/writing-a-plug-in/">http://hmadrigal.wordpress.com/2010/03/28/writing-a-plug-in/</a>) was using the unity.config file to load dynamically the plugins. Certainly the major issue with this approach it&#8217;s that you will have to update your unity.config file every time you add a new plugin.</p>
<p>As usual there is a code sample of all this at:<br />
<a href="https://github.com/hmadrigal/CodeSamples/tree/master/MefAddIns">https://github.com/hmadrigal/CodeSamples/tree/master/MefAddIns</a> The code runs in MonoDevelop as well as in Visual Studio.</p>
<p>On this post I&#8217;ll explain how to easily use Microsoft Extensibility Framework (MEF) <a href="http://msdn.microsoft.com/en-us/library/dd460648.aspx">http://msdn.microsoft.com/en-us/library/dd460648.aspx</a> to load plugins from a directory. Additionally MEF is a framework to create plugins and extensible applications, so it supports more operations other than loading types from external assemblies.</p>
<p><strong>The problem</strong></p>
<p>I want to load different language implementations provided in different assemblies. So, each DLL might (or might not) contain an implementation of a supported language. Moreover, the assemblies can be implemented by third party members, so I cannot binding them into my project at compile time.</p>
<p><strong>The Solution</strong></p>
<p><strong>Defining what on my application needs to be extensible</strong><br />
Define a common contract in order to identify a class which provided a supported language. Moreover all the &#8220;<em>extensible</em>&#8221; portion of your application should be encapsulated into a simple assembly that could be redistributed to other developers who wants to implement the plugin.<br />
BTW, when implementing plug ins, it&#8217;s normal to define a contract (or interface) which defines the required functionality.I&#8217;ll be using the word &#8220;part&#8221; when I&#8217;m talking about contract or interfaces.<br />
The project <strong>MefAddIns.Extensibility</strong> defines an interface which can be used to provide a supported language. </p>
<p><pre class="brush: csharp;">
namespace MefAddIns.Extensibility
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    /// &lt;summary&gt;
    /// Defines the functionality that third parties have to implement for my language plug in
    /// &lt;/summary&gt;
    public interface ISupportedLanguage
    {
        string Author { get; }
        string Version { get; }
        string Description { get; }
        string Name { get; }
    }
}
</pre></p>
<p><strong>Implementing the plug in</strong><br />
Now it&#8217;s the time to provide implementation of supported languages. Each project of <strong>MefAddIns.Language.English, MefAddIns.Language.Japanese and MefAddIns.Language.Spanish</strong> provides at least one implementation for the interface ISupportedLanguage. These projects could be developed internally or by third party people. An example of this implementation is:</p>
<p><pre class="brush: csharp;">
namespace MefAddIns.Language.English
{
    using MefAddIns.Extensibility;
    using System.ComponentModel.Composition;

    /// &lt;summary&gt;
    /// Provides an implementation of a supported language by implementing ISupportedLanguage. 
    /// Moreover it uses Export attribute to make it available thru MEF framework.
    /// &lt;/summary&gt;
    [Export(typeof(ISupportedLanguage))]
    public class EnglishLanguage : ISupportedLanguage
    {
        public string Author
        {
            get { return @&quot;Herberth Madrigal&quot;; }
        }
        public string Version
        {
            get { return @&quot;EN-US.1.0.0&quot;; }
        }
        public string Description
        {
            get { return &quot;This is the English language pack.&quot;; }
        }
        public string Name
        {
            get { return @&quot;English&quot;; }
        }
    }
}
</pre></p>
<p>Please note that the attribute <strong>Export</strong> indicates to MEF framework that the class EnglishLanguage can be used when  a ISupportedLanguage is requested. In other words, if any other application is looking for a part ISupportedLanguage then MEF framework will suggest EnglishLanguage. In further steps we are going to create a MEF catalog which is the mechanism to associate  exported parts with the members which need to import parts. </p>
<p><strong> Defining the parts that my application needs to import </strong><br />
The simplest way of doing this with MEF is by using the <strong>import</strong> attribute. On this case I&#8217;ll be using <strong>ImportMany</strong> because of I&#8217;ll be expecting many (0 or more) implementations of the ISupportedLanguage interface. For example:</p>
<p><pre class="brush: csharp;">
namespace MefAddIns.Terminal
{
    using MefAddIns.Extensibility;
    using System.Collections.Generic;
    using System.ComponentModel.Composition;

    public class Bootstrapper
    {
        /// &lt;summary&gt;
        /// Holds a list of all the valid languages for this application
        /// &lt;/summary&gt;
        [ImportMany]
        public IEnumerable&lt;ISupportedLanguage&gt; Languages { get; set; }

    }
}
</pre></p>
<p><strong>Composing your objects by using (MEF) catalogs</strong><br />
Before getting into details I&#8217;ll like to point out some concepts:</p>
<p><strong>Part</strong>: It&#8217;s the portion of our code that can be exported or imported.<br />
<strong>Export</strong>: It&#8217;s the fact of indicating that a portion of our code is available and it fits a set of traits. E.g. EnglishLanguage implements the ISupportedLanguage Interface, thus I can add the attribute Export(typeof(ISupportedLanguage)).<br />
<strong>Import</strong>: It&#8217;s the fact of indicating that a portion of our code requires a part that fits a set of traits. E.g. I need to import a give language, then I define a property of ISupportedLanguage type and set the attribute Import(typeof(ISupportedLanguage)).<br />
<strong>Catalog</strong>: It a source of Exports and Import definitions. It could be the current execution context or a set of binaries files (such as dlls, exes).<br />
<strong>Container</strong>: It&#8217;s an module which deals with class instantiation. This item uses the catalog when needed in order to create the instances during the composition process.<br />
<strong>Composition</strong>: It&#8217;s the fact of taking an object and making sure that all its needs regarding imports are fulfilled. Certainly this will depends on the catalogs and the export and imports that are being used on the catalog. </p>
<p>Now, that we now more about come MEF concepts. Lets talk more about MEF in our example. MEF detects that some code is <em>Exporting</em> parts, and other code is <em>Importing</em>. The process of loading the parts is made by creating a catalog. There are many ways of creating catalogs, on my example is using a DictionaryCatalog. The DictionaryCatalog uses a directory to look for files, and it creates a catalog with all the exported parts from the assemblies (or files) of the given directory. Finally our application creates an instance of the Bootstrapper class, this instance indicates that it requires all the possible instances of ISupportedLanguages that are into the DictionaryCatalog. Here is a sample of this:</p>
<p><pre class="brush: csharp;">
namespace MefAddIns.Terminal
{
    using System.ComponentModel.Composition.Hosting;
    using System.ComponentModel.Composition;
    using System;

    class Program
    {
        static void Main(string[] args)
        {
            var bootStrapper = new Bootstrapper();

            //An aggregate catalog that combines multiple catalogs
            var catalog = new AggregateCatalog();
            //Adds all the parts found in same directory where the application is running!
            var currentPath = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetAssembly(typeof(Program)).Location);
            catalog.Catalogs.Add(new DirectoryCatalog(currentPath));

            //Create the CompositionContainer with the parts in the catalog
            var _container = new CompositionContainer(catalog);
            
            //Fill the imports of this object
            try
            {
                _container.ComposeParts(bootStrapper);
            }
            catch (CompositionException compositionException)
            {
                Console.WriteLine(compositionException.ToString());
            }

            //Prints all the languages that were found into the application directory
            var i = 0;
            foreach (var language in bootStrapper.Languages)
            {
                Console.WriteLine(&quot;[{0}] {1} by {2}.\n\t{3}\n&quot;, language.Version, language.Name, language.Author, language.Description);
                i++;
            }
            Console.WriteLine(&quot;It has been found {0} supported languages&quot;,i);
            Console.ReadKey();
        }


    }
}
</pre></p>
<p>Now that we have all that our application requires, we&#8217;re able to run the app and see the following output:<br />
<div id="attachment_283" class="wp-caption aligncenter" style="width: 310px"><a href="http://hmadrigal.files.wordpress.com/2012/03/mefaddinscapture1.png"><img src="http://hmadrigal.files.wordpress.com/2012/03/mefaddinscapture1.png?w=300&#038;h=173" alt="" title="Terminal Output" width="300" height="173" class="size-medium wp-image-283" /></a><p class="wp-caption-text">Example of the output where it lists all the supported languages </p></div></p>
<p><strong>Hey It&#8217;s not printing anything!!!</strong><br />
Ok. There is an additional thing to talk, which it&#8217;s not strictly related to MEF. As your might noticed our sample application does not have references to any of the MefAddIns.Language.* Dlls but it&#8217;s running code from them.  Here is the deal, since our application uses MEF we don&#8217;t need to reference directly these DLLS, we just need to copy them into the directory where the DirectoryCatalog is going to look for them. The code sample looks into the directory where the application is running, so we have configured our main csproj to copy the DLLS to the output directory of our main application.<br />
To keep it simple, you can do it in two steps <img src='http://s1.wp.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /><br />
1) <strong><em>Add the external DLLs into your project</em></strong>. First, Right click on your main project, and click on &#8220;Add existing item&#8230;&#8221;. Look for the DLL, and select &#8220;Add as a Link&#8221;. The configure the properties of the added file to copy always or copy when newer.<br />
2) <strong><em>Update the csproj file</em></strong>. Right click on your project, and the select &#8220;Unload project&#8221;. Then once again right click on your project and select &#8220;Edit xxxxx.csproj&#8221;. This will open the project as an XML file. Look for the added DLL, and replace part of portions of the path for MSBuild variables such as $(Configuration). Note that there are more options to do this,  such as using the Copy task from MSBuild (see <a href="http://stackoverflow.com/questions/266888/msbuild-copy-output-from-another-project-into-the-output-of-the-current-project">http://stackoverflow.com/questions/266888/msbuild-copy-output-from-another-project-into-the-output-of-the-current-project</a> ). In our sample this was enough because we are looking for DLLs into the current directory, but depending on your file structure this won&#8217;t be recommended.  </p>
<p><pre class="brush: xml;">
&lt;ItemGroup&gt;
    &lt;Content Include=&quot;
..\MefAddIns.Language.English\bin\$(Configuration)\MefAddIns.Language.English.dll;
..\MefAddIns.Language.Japanese\bin\$(Configuration)\MefAddIns.Language.Japanese.dll;
..\MefAddIns.Language.Spanish\bin\$(Configuration)\MefAddIns.Language.Spanish.dll;&quot;&gt;
      &lt;CopyToOutputDirectory&gt;PreserveNewest&lt;/CopyToOutputDirectory&gt;
      &lt;Visible&gt;false&lt;/Visible&gt;
    &lt;/Content&gt;
  &lt;/ItemGroup&gt;
</pre></p>
<p>At last comment, this is the most basic sample of using MEF to create a plugin-based structure. There are more things to consider , e.g. the path where your DLLs are going to be placed or how your main application is going to exchange information with the plugins. MEF has also more options to create extensible applications. Also, it&#8217;s important to consider when it&#8217;s good to create plugin based architectures rather that tightly coupled apps.</p>
<p><strong>EDIT</strong> In my last update I modified the project (csproj) to make it run on MonoDevelop <img src='http://s1.wp.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> . The major change is that some tasks on MSBuild aren&#8217;t available in XBuild. So, the last step which modified the csproject, now looks like:</p>
<p><pre class="brush: xml;">
&lt;ItemGroup Condition=&quot; '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' &quot;&gt;
    &lt;Content Include=&quot;..\MefAddIns.Language.English\bin\Debug\MefAddIns.Language.English.dll&quot;&gt;
      &lt;CopyToOutputDirectory&gt;PreserveNewest&lt;/CopyToOutputDirectory&gt;
      &lt;Visible&gt;False&lt;/Visible&gt;
    &lt;/Content&gt;
    &lt;Content Include=&quot;..\MefAddIns.Language.Japanese\bin\Debug\MefAddIns.Language.Japanese.dll&quot;&gt;
      &lt;CopyToOutputDirectory&gt;PreserveNewest&lt;/CopyToOutputDirectory&gt;
      &lt;Visible&gt;False&lt;/Visible&gt;
    &lt;/Content&gt;
    &lt;Content Include=&quot;..\MefAddIns.Language.Spanish\bin\Debug\MefAddIns.Language.Spanish.dll&quot;&gt;
      &lt;CopyToOutputDirectory&gt;PreserveNewest&lt;/CopyToOutputDirectory&gt;
      &lt;Visible&gt;False&lt;/Visible&gt;
    &lt;/Content&gt;
  &lt;/ItemGroup&gt;
  &lt;ItemGroup Condition=&quot; '$(Configuration)|$(Platform)' == 'Release|AnyCPU' &quot;&gt;
    &lt;Content Include=&quot;..\MefAddIns.Language.English\bin\Release\MefAddIns.Language.English.dll&quot;&gt;
      &lt;CopyToOutputDirectory&gt;PreserveNewest&lt;/CopyToOutputDirectory&gt;
      &lt;Visible&gt;False&lt;/Visible&gt;
    &lt;/Content&gt;
    &lt;Content Include=&quot;..\MefAddIns.Language.Japanese\bin\Release\MefAddIns.Language.Japanese.dll&quot;&gt;
      &lt;CopyToOutputDirectory&gt;PreserveNewest&lt;/CopyToOutputDirectory&gt;
      &lt;Visible&gt;False&lt;/Visible&gt;
    &lt;/Content&gt;
    &lt;Content Include=&quot;..\MefAddIns.Language.Spanish\bin\Release\MefAddIns.Language.Spanish.dll&quot;&gt;
      &lt;CopyToOutputDirectory&gt;PreserveNewest&lt;/CopyToOutputDirectory&gt;
      &lt;Visible&gt;False&lt;/Visible&gt;
    &lt;/Content&gt;
  &lt;/ItemGroup&gt;
</pre><br />
The code sample for this application is at:<br />
<a href="https://github.com/hmadrigal/CodeSamples/tree/master/MefAddIns">https://github.com/hmadrigal/CodeSamples/tree/master/MefAddIns</a></p>
<p>Best regards,<br />
Herber</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/hmadrigal.wordpress.com/275/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/hmadrigal.wordpress.com/275/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/hmadrigal.wordpress.com/275/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/hmadrigal.wordpress.com/275/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/hmadrigal.wordpress.com/275/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/hmadrigal.wordpress.com/275/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/hmadrigal.wordpress.com/275/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/hmadrigal.wordpress.com/275/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/hmadrigal.wordpress.com/275/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/hmadrigal.wordpress.com/275/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/hmadrigal.wordpress.com/275/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/hmadrigal.wordpress.com/275/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/hmadrigal.wordpress.com/275/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/hmadrigal.wordpress.com/275/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hmadrigal.wordpress.com&amp;blog=10596476&amp;post=275&amp;subd=hmadrigal&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://hmadrigal.wordpress.com/2012/03/08/how-to-create-a-plug-in-using-c-net-4-0-and-mef/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6e8659583670c9667aaa010e1a0f318e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Yogurt</media:title>
		</media:content>

		<media:content url="http://hmadrigal.files.wordpress.com/2012/03/mefaddinscapture1.png?w=300" medium="image">
			<media:title type="html">Terminal Output</media:title>
		</media:content>
	</item>
		<item>
		<title>WP7: Libraries about Cloud services (Azure, AWS, Hawaii), Toolkits (WP7) and more</title>
		<link>http://hmadrigal.wordpress.com/2012/03/06/wp7-libraries-about-cloud-services-azure-aws-hawaii-toolkits-wp7-and-more/</link>
		<comments>http://hmadrigal.wordpress.com/2012/03/06/wp7-libraries-about-cloud-services-azure-aws-hawaii-toolkits-wp7-and-more/#comments</comments>
		<pubDate>Wed, 07 Mar 2012 05:27:49 +0000</pubDate>
		<dc:creator>hmadrigal</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[cloud]]></category>
		<category><![CDATA[silverlight]]></category>
		<category><![CDATA[windows phone 7]]></category>
		<category><![CDATA[wp7]]></category>

		<guid isPermaLink="false">http://hmadrigal.wordpress.com/2012/03/06/wp7-libraries-about-cloud-services-azure-aws-hawaii-toolkits-wp7-and-more/</guid>
		<description><![CDATA[Hi, I&#8217;d like to share with you some of the libraries that I&#8217;ve been reading (or using in some cases) in WP7 projects. Silverlight for Windows Phone Toolkit @ http://silverlight.codeplex.com/ This might be the only one that should be mandatory in your WP7 project. This library contains a set of controls to enhance the WP7 experience [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hmadrigal.wordpress.com&amp;blog=10596476&amp;post=272&amp;subd=hmadrigal&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Hi,</p>
<p>I&#8217;d like to share with you some of the libraries that I&#8217;ve been reading (or using in some cases) in WP7 projects.</p>
<p><strong><strong>Silverlight for Windows Phone Toolkit @ </strong><a href="http://silverlight.codeplex.com/">http://silverlight.codeplex.com/</a><br />
</strong>This might be the only one that should be mandatory in your WP7 project. This library contains a set of controls to enhance the WP7 experience by adding custom animations and custom controls. <strong><br />
</strong></p>
<p><strong>Reactive Extensions for Windows Phone 7 @ <a href="http://msdn.microsoft.com/en-us/data/gg577610">http://msdn.microsoft.com/en-us/data/gg577610</a></strong><br />
This library helps you to control Asynchronous tasks or events. It&#8217;s like creating pipes based on asynchronous events.</p>
<p><strong>Hawaii Cloud Services SDK for Windows Phone 7 @ <a href="http://research.microsoft.com/en-us/um/redmond/projects/hawaii/students/">http://research.microsoft.com/en-us/um/redmond/projects/hawaii/students/</a><br />
</strong>This particular project is for non-commercial projects, and at this time it&#8217;s free because it&#8217;s a research project. This project lets use use the cloud services in order to have services such as: Speech to Text (aka voice recognition), OCR among others.</p>
<p><strong>[watwp] Windows Azure Toolkit for Windows Phone 7 @ <a href="http://watwp.codeplex.com/">http://watwp.codeplex.com/</a></strong><br />
<strong>(<a href="http://channel9.msdn.com/posts/Getting-Started-with-the-Windows-Azure-Toolkit-for-Windows-Phone-7-v12">http://channel9.msdn.com/posts/Getting-Started-with-the-Windows-Azure-Toolkit-for-Windows-Phone-7-v12</a>)</strong><br />
A simple way to access Azure services thru your WP7.</p>
<p><strong>Amazon Web Services SDK for Windows Phone 7 @ <a href="https://github.com/Microsoft-Interop/AWS-SDK-for-WP">https://github.com/Microsoft-Interop/AWS-SDK-for-WP</a> </strong><strong>(<a href="http://channel9.msdn.com/Blogs/Interoperability/Getting-Started-with-the-AWS-SDK-for-Windows-Phone">http://channel9.msdn.com/Blogs/Interoperability/Getting-Started-with-the-AWS-SDK-for-Windows-Phone</a>)<br />
</strong>Well for those how have worked with AWS, this library will simplify some of the tasks accessing services such as S3 (which is web storage).</p>
<p><strong>[PAARC] Phone as Remote Control @ <a href="http://paarc.codeplex.com/">http://paarc.codeplex.com/</a> (<a href="http://channel9.msdn.com/coding4fun/blog/Getting-your-WP7---Desktop-integration-out-of-park-with-PAARC-the-Phone-as-a-Remote-Control-library">http://channel9.msdn.com/coding4fun/blog/Getting-your-WP7&#8212;Desktop-integration-out-of-park-with-PAARC-the-Phone-as-a-Remote-Control-library</a>)<br />
</strong>I really like this one. It&#8217;s just a simple (and efficient) mechanism to establish a connection between your phone and your PC. Thus, the phone will work as a input device, and the PC has already a running a service which will report all the input generated by the phone.</p>
<p><strong>Zune Web API @ <a href="http://channel9.msdn.com/coding4fun/articles/Using-the-Zune-Web-API-on-Windows-Phone-7">http://channel9.msdn.com/coding4fun/articles/Using-the-Zune-Web-API-on-Windows-Phone-7</a><br />
</strong>This is not exactly an SDK, but it will help you to get information from your Zune account <img src='http://s1.wp.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>Best regards,<br />
Herber</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/hmadrigal.wordpress.com/272/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/hmadrigal.wordpress.com/272/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/hmadrigal.wordpress.com/272/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/hmadrigal.wordpress.com/272/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/hmadrigal.wordpress.com/272/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/hmadrigal.wordpress.com/272/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/hmadrigal.wordpress.com/272/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/hmadrigal.wordpress.com/272/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/hmadrigal.wordpress.com/272/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/hmadrigal.wordpress.com/272/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/hmadrigal.wordpress.com/272/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/hmadrigal.wordpress.com/272/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/hmadrigal.wordpress.com/272/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/hmadrigal.wordpress.com/272/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hmadrigal.wordpress.com&amp;blog=10596476&amp;post=272&amp;subd=hmadrigal&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://hmadrigal.wordpress.com/2012/03/06/wp7-libraries-about-cloud-services-azure-aws-hawaii-toolkits-wp7-and-more/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6e8659583670c9667aaa010e1a0f318e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Yogurt</media:title>
		</media:content>
	</item>
		<item>
		<title>Customizable On Screen Keyboard (OSK) for WPF (it works for WebBrowser control)</title>
		<link>http://hmadrigal.wordpress.com/2011/12/26/customizable-on-screen-keyboard-osk-for-wpf-it-works-for-webbrowser-control/</link>
		<comments>http://hmadrigal.wordpress.com/2011/12/26/customizable-on-screen-keyboard-osk-for-wpf-it-works-for-webbrowser-control/#comments</comments>
		<pubDate>Tue, 27 Dec 2011 01:41:24 +0000</pubDate>
		<dc:creator>hmadrigal</dc:creator>
				<category><![CDATA[Windows]]></category>
		<category><![CDATA[IME]]></category>
		<category><![CDATA[Japanese]]></category>
		<category><![CDATA[.net]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[download]]></category>
		<category><![CDATA[wpf]]></category>
		<category><![CDATA[microsoft]]></category>
		<category><![CDATA[expression blend]]></category>
		<category><![CDATA[xaml]]></category>
		<category><![CDATA[blend]]></category>
		<category><![CDATA[developer]]></category>
		<category><![CDATA[osk]]></category>
		<category><![CDATA[win32]]></category>
		<category><![CDATA[wosk]]></category>

		<guid isPermaLink="false">http://hmadrigal.wordpress.com/?p=248</guid>
		<description><![CDATA[Summary Recently my colleagues and I faced a very particular problem in WPF. We were creating a very stylish application for a kiosk, and the keyboard should look different from the default OSK in WPF. At the beginning we import our old OSK which concatenates characters to a string, but this approach won&#8217;t work on [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hmadrigal.wordpress.com&amp;blog=10596476&amp;post=248&amp;subd=hmadrigal&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<h1>Summary</h1>
<p>Recently my colleagues and I faced a very particular problem in WPF. We were creating a very stylish application for a kiosk, and the keyboard should look different from the default OSK in WPF. At the beginning we import our old OSK which concatenates characters to a string, but this approach won&#8217;t work on the WebBrowser control since this control does not exposes internal components such as textbox. The following post is about my experience creating a solution for this particular problem.</p>
<h1>The Problem</h1>
<ul>
<li>Customizable style for the on screen keyboard</li>
<li>The OSK must be able to interact with the WebControl control.</li>
</ul>
<h1>The solution</h1>
<h2>The default OSK</h2>
<p>At first the most logical solution is to use the default. The problem with the default OSK is that it&#8217;s not possible to customize. Moreover the default OSK is not embedded into the WPF, it works on top of any other windows application.</p>
<p><a href="http://hmadrigal.files.wordpress.com/2011/12/defaultoskcapture.png"><img class="aligncenter size-medium wp-image-249" title="Default On Screen keyboard" src="http://hmadrigal.files.wordpress.com/2011/12/defaultoskcapture.png?w=300&#038;h=212" alt="Default Windows On Screen keyboard" width="300" height="212" /></a></p>
<p style="text-align:center;"><strong>Default Windows On Screen keyboard (OSK)</strong></p>
<h2>Appending strings</h2>
<p>The our team decided to import our old OSK from a previous project. This first version of the OSK was a custom control. This custom control has a lot buttons and one string. Each time a button is pressed, a new character  is append to the string, thus the user of the control only have to check the current string in order to know which characters has been typed. The problem with this other approach is that keys like &#8220;arrows&#8221;, &#8220;control&#8221; or &#8220;alt&#8221; don&#8217;t have a way to represented into a string. At this time we&#8217;ve created out QueryKeyboard Contol which defines a bunch of buttons and appends characters to a string.</p>
<h2>Customizing  a WPF OSK</h2>
<p>Later on, we realize that our application will have to interact with the WebBrowser. Thus I decide we can use the same approach that the <strong>Wosk: Flexible On Screen Keyboard using WPF (</strong><a href="http://wosk.codeplex.com/SourceControl/list/changesets">http://wosk.codeplex.com/SourceControl/list/changesets</a>) was using. Basically, WOSK was inserting keyboard  codes into the keyboard buffer, so the the operative system will report the input the the current focused window and control.</p>
<p>Thus, the approach was to separate the logic of the virtual keyboard from the keyboard control. So, the virtual keyboard could work as independent a service or be part of a more complex control such as the QueryKeyboardControl.</p>
<p>I&#8217;ve publish a sample of the project in Git Hub at <a href="https://github.com/hmadrigal/CodeSamples/tree/master/Hmadrigal.SampleKeyboard">https://github.com/hmadrigal/CodeSamples/tree/master/Hmadrigal.SampleKeyboard</a>. The following items are the most relevant into the project sample:</p>
<ul>
<li><strong>Hmadrigal.Services.VirtualKeyboard</strong>: This projects holds the Service for a Virtual Keyboard.</li>
<ul>
<li><strong>NativeUser32</strong>.cs: Wrapper for Win32 low level calls</li>
<li><strong>KeysEx.cs</strong>:  Known key codes. Set of known values to be inserted into the keyboard buffer.</li>
<li><strong>VirtualKeyboardService.cs</strong>: Singleton class which exposes functionality in order to keep the state of the virtual keyboard.</li>
</ul>
<li><strong>Hmadrigal.WpfToolkit</strong>: This projects holds the visual representation for a on screen keyboard control in WPF.</li>
<ul>
<li><strong>QuertyKeyboard.cs</strong>: Custom control which keeps logic for appending strings or utilizing the virtual keyboard service.</li>
<li><strong>Generic.xaml</strong>: Contains the default style for the custom control</li>
<li><strong>WeakEventHandling.cs</strong>: Weak event handling (see references)</li>
</ul>
<li><strong>Hmadrigal.SampleKeyboard</strong>: WPF application using the custom keyboard with a web browser.</li>
</ul>
<p><a href="http://hmadrigal.files.wordpress.com/2011/12/quertykeyboardcontrolcapture.png"><img class="aligncenter size-medium wp-image-251" title="Querty Keyboard Control" src="http://hmadrigal.files.wordpress.com/2011/12/quertykeyboardcontrolcapture.png?w=300&#038;h=163" alt="Querty Keyboard Control" width="300" height="163" /></a></p>
<p style="text-align:center;">Querty Keyboard Control using the virtual keyboard service</p>
<h1>Remarks</h1>
<ul>
<li>The default style has set the attribute &#8220;Focusable&#8221; to &#8220;False&#8221; in all the buttons (or any other item which can get  the focus). This should be done for any custom style. Because of the virtual keyboard service does not known who is going to handle the reported input, then the app is responsible of setting the focus to the proper item.</li>
<li>When debugging and using  keys like shift, alt, ctrl, those are kept pressed by the virtual keyboard service, but they will affect your debug execution because of the input is happening at the operative system level. So, be cautious about where the breakpoints are set.</li>
<li>Multilingual by using IME. Particularly I&#8217;ve set up my PC to use IMEI Japanese using romanji, so  FYI it will continue working <img src='http://s1.wp.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> .</li>
<li>Because of the WebBrowser control is a Win32 interop control running on WPF, the default focus might no be on the WebBrowser contol. Sadly I don&#8217;t have a solution for this yet, just make sure that the user have an option to set the focus into the WebBrowser control once it has been loaded.</li>
</ul>
<h1>Code</h1>
<p>The sample code for this application is on Git Hub at:<br />
<a href="https://github.com/hmadrigal/CodeSamples/tree/master/Hmadrigal.SampleKeyboard">https://github.com/hmadrigal/CodeSamples/tree/master/Hmadrigal.SampleKeyboard</a></p>
<h1>References</h1>
<p><strong>How to make the Windows OSK open when a TextBox gets focus, instead of requiring users to tap a keyboard icon?</strong><br />
<a href="http://stackoverflow.com/questions/7518074/how-to-make-the-windows-osk-open-when-a-textbox-gets-focus-instead-of-requiring/7529920#7529920">http://stackoverflow.com/questions/7518074/how-to-make-the-windows-osk-open-when-a-textbox-gets-focus-instead-of-requiring/7529920#7529920</a></p>
<p><strong>.NET Framework Developer Center / Creating custom InputDevice</strong><br />
<a href="http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/a813a08a-7960-45fe-bc91-e81cdb75bd10">http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/a813a08a-7960-45fe-bc91-e81cdb75bd10</a></p>
<p><strong>Wosk: Flexible On Screen Keyboard using WPF</strong><br />
<a href="http://wosk.codeplex.com/SourceControl/list/changesets">http://wosk.codeplex.com/SourceControl/list/changesets</a></p>
<p><strong>SendInput Example In C#</strong><br />
<a href="http://www.ownedcore.com/forums/mmo/warhammer-online/186390-sendinput-example-c.html">http://www.ownedcore.com/forums/mmo/warhammer-online/186390-sendinput-example-c.html</a></p>
<p><strong>Simulating Keyboard with SendInput API in DirectInput applications</strong><br />
<a href="http://stackoverflow.com/questions/3644881/simulating-keyboard-with-sendinput-api-in-directinput-applications">http://stackoverflow.com/questions/3644881/simulating-keyboard-with-sendinput-api-in-directinput-applications</a></p>
<p><strong>Generic implementation for a weak event handling</strong><br />
<a href="http://puremsil.wordpress.com/2010/05/03/generic-weak-event-handlers/">http://puremsil.wordpress.com/2010/05/03/generic-weak-event-handlers/</a></p>
<p><strong>From Joel Pobar&#8217;s CLR weblog Creating delegate types via Reflection.Emit</strong><br />
<a href="http://blogs.msdn.com/joelpob/archive/2004/02/15/73239.aspx">http://blogs.msdn.com/joelpob/archive/2004/02/15/73239.aspx</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/hmadrigal.wordpress.com/248/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/hmadrigal.wordpress.com/248/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/hmadrigal.wordpress.com/248/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/hmadrigal.wordpress.com/248/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/hmadrigal.wordpress.com/248/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/hmadrigal.wordpress.com/248/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/hmadrigal.wordpress.com/248/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/hmadrigal.wordpress.com/248/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/hmadrigal.wordpress.com/248/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/hmadrigal.wordpress.com/248/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/hmadrigal.wordpress.com/248/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/hmadrigal.wordpress.com/248/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/hmadrigal.wordpress.com/248/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/hmadrigal.wordpress.com/248/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hmadrigal.wordpress.com&amp;blog=10596476&amp;post=248&amp;subd=hmadrigal&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://hmadrigal.wordpress.com/2011/12/26/customizable-on-screen-keyboard-osk-for-wpf-it-works-for-webbrowser-control/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6e8659583670c9667aaa010e1a0f318e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Yogurt</media:title>
		</media:content>

		<media:content url="http://hmadrigal.files.wordpress.com/2011/12/defaultoskcapture.png?w=300" medium="image">
			<media:title type="html">Default On Screen keyboard</media:title>
		</media:content>

		<media:content url="http://hmadrigal.files.wordpress.com/2011/12/quertykeyboardcontrolcapture.png?w=300" medium="image">
			<media:title type="html">Querty Keyboard Control</media:title>
		</media:content>
	</item>
		<item>
		<title>Xhader 1.1</title>
		<link>http://hmadrigal.wordpress.com/2011/11/23/xhader-1-1/</link>
		<comments>http://hmadrigal.wordpress.com/2011/11/23/xhader-1-1/#comments</comments>
		<pubDate>Thu, 24 Nov 2011 00:02:20 +0000</pubDate>
		<dc:creator>hmadrigal</dc:creator>
				<category><![CDATA[.net]]></category>
		<category><![CDATA[blend]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[download]]></category>
		<category><![CDATA[expression blend]]></category>
		<category><![CDATA[extensions]]></category>
		<category><![CDATA[pixel shader]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[silverlight]]></category>
		<category><![CDATA[wpf]]></category>
		<category><![CDATA[xaml]]></category>
		<category><![CDATA[microsoft]]></category>
		<category><![CDATA[shader]]></category>
		<category><![CDATA[xhader]]></category>

		<guid isPermaLink="false">http://hmadrigal.wordpress.com/?p=242</guid>
		<description><![CDATA[Hello Fellas, Today I&#8217;ve released a new version of Xhader. http://xhader.codeplex.com/releases/view/77425 The major feature is that it should work on Blend 4. Additionally it should be using WPF 4.0 and SL 4.0 support. Regards, Herber<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hmadrigal.wordpress.com&amp;blog=10596476&amp;post=242&amp;subd=hmadrigal&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Hello Fellas,</p>
<p>Today I&#8217;ve released a new version of Xhader.</p>
<p><a href="http://xhader.codeplex.com/releases/view/77425">http://xhader.codeplex.com/releases/view/77425</a></p>
<p>The major feature is that it should work on Blend 4. Additionally it should be using WPF 4.0 and SL 4.0 support.</p>
<p>Regards,<br />
Herber</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/hmadrigal.wordpress.com/242/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/hmadrigal.wordpress.com/242/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/hmadrigal.wordpress.com/242/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/hmadrigal.wordpress.com/242/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/hmadrigal.wordpress.com/242/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/hmadrigal.wordpress.com/242/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/hmadrigal.wordpress.com/242/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/hmadrigal.wordpress.com/242/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/hmadrigal.wordpress.com/242/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/hmadrigal.wordpress.com/242/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/hmadrigal.wordpress.com/242/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/hmadrigal.wordpress.com/242/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/hmadrigal.wordpress.com/242/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/hmadrigal.wordpress.com/242/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hmadrigal.wordpress.com&amp;blog=10596476&amp;post=242&amp;subd=hmadrigal&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://hmadrigal.wordpress.com/2011/11/23/xhader-1-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6e8659583670c9667aaa010e1a0f318e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Yogurt</media:title>
		</media:content>
	</item>
		<item>
		<title>The Chaos Monkey and Working with AWS</title>
		<link>http://hmadrigal.wordpress.com/2011/04/26/the-chaos-monkey-and-working-with-aws/</link>
		<comments>http://hmadrigal.wordpress.com/2011/04/26/the-chaos-monkey-and-working-with-aws/#comments</comments>
		<pubDate>Tue, 26 Apr 2011 15:59:07 +0000</pubDate>
		<dc:creator>hmadrigal</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[aws]]></category>
		<category><![CDATA[cloud]]></category>
		<category><![CDATA[programing]]></category>

		<guid isPermaLink="false">http://hmadrigal.wordpress.com/?p=240</guid>
		<description><![CDATA[Hello, There has been awhile since my last post. I&#8217;d like to share a really good posts that I&#8217;ve read recently. As usual, I want to share two articles: 5 Lessons We’ve Learned Using AWS http://techblog.netflix.com/2010/12/5-lessons-weve-learned-using-aws.html Working with the Chaos Monkey http://www.codinghorror.com/blog/2011/04/working-with-the-chaos-monkey.html The second is a post based on the first one, both are good [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hmadrigal.wordpress.com&amp;blog=10596476&amp;post=240&amp;subd=hmadrigal&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Hello, </p>
<p>There has been awhile since my last post. I&#8217;d like to share a really good posts that I&#8217;ve read recently. </p>
<p>As usual, I want to share two articles:</p>
<p>5 Lessons We’ve Learned Using AWS<br />
<a href="http://techblog.netflix.com/2010/12/5-lessons-weve-learned-using-aws.html">http://techblog.netflix.com/2010/12/5-lessons-weve-learned-using-aws.html</a></p>
<p>Working with the Chaos Monkey<br />
<a href="http://www.codinghorror.com/blog/2011/04/working-with-the-chaos-monkey.html">http://www.codinghorror.com/blog/2011/04/working-with-the-chaos-monkey.html</a></p>
<p>The second is a post based on the first one, both are good to think about: &#8220;the best way to avoid failure is to fail constantly&#8221;</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/hmadrigal.wordpress.com/240/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/hmadrigal.wordpress.com/240/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/hmadrigal.wordpress.com/240/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/hmadrigal.wordpress.com/240/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/hmadrigal.wordpress.com/240/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/hmadrigal.wordpress.com/240/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/hmadrigal.wordpress.com/240/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/hmadrigal.wordpress.com/240/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/hmadrigal.wordpress.com/240/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/hmadrigal.wordpress.com/240/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/hmadrigal.wordpress.com/240/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/hmadrigal.wordpress.com/240/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/hmadrigal.wordpress.com/240/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/hmadrigal.wordpress.com/240/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hmadrigal.wordpress.com&amp;blog=10596476&amp;post=240&amp;subd=hmadrigal&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://hmadrigal.wordpress.com/2011/04/26/the-chaos-monkey-and-working-with-aws/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6e8659583670c9667aaa010e1a0f318e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Yogurt</media:title>
		</media:content>
	</item>
		<item>
		<title>Setting up F# to bu used in Ubuntu with F#</title>
		<link>http://hmadrigal.wordpress.com/2011/04/16/setting-up-f-to-bu-used-in-ubuntu-with-f/</link>
		<comments>http://hmadrigal.wordpress.com/2011/04/16/setting-up-f-to-bu-used-in-ubuntu-with-f/#comments</comments>
		<pubDate>Sat, 16 Apr 2011 18:51:21 +0000</pubDate>
		<dc:creator>hmadrigal</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[fsharp]]></category>
		<category><![CDATA[microsoft]]></category>

		<guid isPermaLink="false">http://hmadrigal.wordpress.com/?p=238</guid>
		<description><![CDATA[Hello, Because of I&#8217;m curious about technology, I&#8217;ve decide share some links and comments about it. In general the process is simple: 1. Download the F# distribution from microsoft site or codeplex http://msdn.microsoft.com/en-us/fsharp/cc835251.aspx http://fsxplat.codeplex.com/ Uncompress and run the install script 2. You can also download the additional scripts. Same procedure from http://fsxplat.codeplex.com/, the installation is [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hmadrigal.wordpress.com&amp;blog=10596476&amp;post=238&amp;subd=hmadrigal&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Hello, </p>
<p>Because of I&#8217;m curious about technology, I&#8217;ve decide share some links and comments about it.<br />
In general the process is simple:</p>
<p>1. Download the F# distribution from microsoft site or codeplex</p>
<p>http://msdn.microsoft.com/en-us/fsharp/cc835251.aspx</p>
<p>http://fsxplat.codeplex.com/</p>
<p>Uncompress and run the install script <img src='http://s1.wp.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>2. You can also download the additional scripts.<br />
Same procedure from http://fsxplat.codeplex.com/, the installation is similar uncompress and run the installation script. There is a chance where you can get the following error:</p>
<p>install-bonus.sh: 28: Syntax error: &#8220;(&#8221; unexpected (expecting &#8220;}&#8221;)</p>
<p>If so, change the first line from<br />
#! /bin/sh -e<br />
to<br />
#!/bin/bash -e<br />
source: http://askubuntu.com/questions/21100/problem-with-script-substitution-when-running-script</p>
<p>I&#8217;ll assume you&#8217;ve already MonoDevelop installed, so. Make sure you&#8217;re following all the pre requisites to make F# work on mono:</p>
<p>http://functional-variations.net/monodevelop/prereq.aspx</p>
<p>At last but not least, you can install the add-in for mono</p>
<p>A good amount of steps can be located at http://functional-variations.net/monodevelop/ , or you can try just by adding the repository and install it <img src='http://s1.wp.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' />  (repository http://functional-variations.net/addin )</p>
<p>and pretty much that it. if you want to see a video, there is one available at http://functional-variations.net/crossplatform/.</p>
<p>Microsoft Research has published a side dedicated to teach FSharp at http://www.tryfsharp.org/ </p>
<p>Best regards,<br />
Herber</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/hmadrigal.wordpress.com/238/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/hmadrigal.wordpress.com/238/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/hmadrigal.wordpress.com/238/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/hmadrigal.wordpress.com/238/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/hmadrigal.wordpress.com/238/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/hmadrigal.wordpress.com/238/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/hmadrigal.wordpress.com/238/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/hmadrigal.wordpress.com/238/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/hmadrigal.wordpress.com/238/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/hmadrigal.wordpress.com/238/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/hmadrigal.wordpress.com/238/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/hmadrigal.wordpress.com/238/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/hmadrigal.wordpress.com/238/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/hmadrigal.wordpress.com/238/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hmadrigal.wordpress.com&amp;blog=10596476&amp;post=238&amp;subd=hmadrigal&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://hmadrigal.wordpress.com/2011/04/16/setting-up-f-to-bu-used-in-ubuntu-with-f/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6e8659583670c9667aaa010e1a0f318e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Yogurt</media:title>
		</media:content>
	</item>
		<item>
		<title>Visual Studio re install individual packages</title>
		<link>http://hmadrigal.wordpress.com/2011/02/10/visual-studio-re-install-individual-packages/</link>
		<comments>http://hmadrigal.wordpress.com/2011/02/10/visual-studio-re-install-individual-packages/#comments</comments>
		<pubDate>Thu, 10 Feb 2011 22:15:04 +0000</pubDate>
		<dc:creator>hmadrigal</dc:creator>
				<category><![CDATA[.net]]></category>
		<category><![CDATA[developer]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[programing]]></category>
		<category><![CDATA[visual studio]]></category>

		<guid isPermaLink="false">http://hmadrigal.wordpress.com/?p=234</guid>
		<description><![CDATA[Hi, I remember that sometime ago my Visual Studio installation didn&#8217;t install the package correctly. And if you&#8217;ve installed visual studio you might know that the standard installation might take 1 hour at least. If you decide to repair the visual studio then the process can take 2 hours. However by reinstalling the visual studio [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hmadrigal.wordpress.com&amp;blog=10596476&amp;post=234&amp;subd=hmadrigal&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Hi,</p>
<p>I remember that sometime ago my Visual Studio installation didn&#8217;t install the package correctly. And if you&#8217;ve installed visual studio you might know that the standard installation might take 1 hour at least. If you decide to repair the visual studio then the process can take 2 hours. However by reinstalling the visual studio you still might have errors.</p>
<p>I resolved my problems by reinstalling only the broken package. So, I&#8217;ll explain how you can do this. I&#8217;ll take the images from my friend <a href="http://abakerp.blogspot.com/">Anthony (arbot)</a> which has the same issue, and he could solve it by installing only what he needed (see details at this <a href="http://abakerp.blogspot.com/2011/02/cannot-load-file-or-assembly.html">post</a>). So my example is based on Arbot&#8217;s problem with the &#8220;<em>Microsoft SQL Server 2008 Management Objects</em>&#8220;</p>
<p><strong>Step 1: Prepare your bat-belt</strong><br />
Easy dude, you will need the <em>Visual Studio Installation</em> files. You are more likely to need admin rights to perform installation tasks.</p>
<p><strong>Step 2: Identify your broken component</strong><br />
In the Arbot, the broken package was &#8220;Microsoft SQL Server 2008 Management Objects&#8221;. Unfortunately these kind of errors does not have a friendly message. Usually they might look like:</p>
<p><a href="http://hmadrigal.files.wordpress.com/2011/02/vsdbproject_error.png"><img class="aligncenter size-medium wp-image-235" title="Visual Studio Broken package error" src="http://hmadrigal.files.wordpress.com/2011/02/vsdbproject_error.png?w=300&#038;h=126" alt="" width="300" height="126" /></a></p>
<p>So don&#8217;t be afraid if you see:<br />
&#8220;<em>Could not load file or assembly<br />
&#8216;Microsoft.SqlServer.Management.SqlParser, Version=10.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91&#8242; or one of its dependencies. The system cannot find the file specified</em>&#8220;<br />
The thing here is that you should be able to recognize which part of your Visual Studio is failing. If you aren&#8217;t sure about the component, then check the list of packages /components that Visual Studio installs  at<br />
<a href="http://msdn.microsoft.com/en-us/library/ee225240.aspx">http://msdn.microsoft.com/en-us/library/ee225240.aspx</a></p>
<p><strong>Step 3: Remove what it&#8217;s not working</strong><br />
Once you know what component is missed, go to the control panel and uninstall the specific component. In the case or Arbot he uninstalled all the products from the &#8220;Microsoft SQL Server 2008 Management Objects&#8221;, which are under the folder WCU\SMO see <a href="http://msdn.microsoft.com/en-us/library/ee225240.aspx">http://msdn.microsoft.com/en-us/library/ee225240.aspx</a> to know which components are installed under the same folder.</p>
<p><strong>Step 4: Make sure you&#8217;re ready to reinstall</strong><br />
Ok, It seems obvious, but before installing the Visual studio components you will have to make sure that your current installation has all the components you might need. So, take your time and check <a href="http://msdn.microsoft.com/en-us/library/ee225240.aspx">http://msdn.microsoft.com/en-us/library/ee225240.aspx</a> and the prerequisites <img src='http://s1.wp.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p><strong>Step 5: Install in order each package</strong><br />
open a command prompt in admin mode. (I&#8217;d recommend Visual Studio Command Prompt), and make sure MSIExec  is in your path (http://technet.microsoft.com/library/cc759262(WS.10).aspx). So, we can run the installer from the command prompt.<br />
Now In the command prompt,  go to the installer folders of your broken package. In the case of Arbot, look for &#8220;WCU\SMO&#8221; folder.  Review which platform you&#8217;re using because X86 platforms uses different commands than the X64 platforms. Additionally there are two kind of X64 platforms.<br />
One you have identifies the packages that you have to install run the commands, in the case of Arbot he ran these commands:</p>
<p><code><br />
C:\Windows\system32&gt;MSIExec SQLSysClrTypes_x86_enu.msi /log "%TEMP%\dd_SQLSysClr<br />
Types_x86_msi.txt"<br />
C:\Windows\system32&gt;MSIExec SharedManagementObjects_x86_enu.msi /log:"%TEMP%\dd_SharedManagementObjects_x86_MSI.txt"<br />
</code></p>
<p>Depending of the settings you&#8217;ve specified for MSIExec you might have to attend the installation and restart your computer.</p>
<p><strong>Step 6: Try you reinstalled component on visual studio </strong><br />
If the installation worked properly it shouldn&#8217;t report any issue, and you always have the option to check the log file generated by the MSIExec.</p>
<p>Now you should be able to run Visual Studio and try once again to use the feature on Visual studio, and hopefully it should be working properly. My friend Anthony made a post about his problem <img src='http://s1.wp.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' />  if you need to see more pics <img src='http://s0.wp.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p><a href="http://abakerp.blogspot.com/2011/02/cannot-load-file-or-assembly.html">http://abakerp.blogspot.com/2011/02/cannot-load-file-or-assembly.html</a></p>
<p>Best regards,<br />
Herber</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/hmadrigal.wordpress.com/234/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/hmadrigal.wordpress.com/234/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/hmadrigal.wordpress.com/234/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/hmadrigal.wordpress.com/234/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/hmadrigal.wordpress.com/234/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/hmadrigal.wordpress.com/234/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/hmadrigal.wordpress.com/234/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/hmadrigal.wordpress.com/234/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/hmadrigal.wordpress.com/234/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/hmadrigal.wordpress.com/234/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/hmadrigal.wordpress.com/234/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/hmadrigal.wordpress.com/234/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/hmadrigal.wordpress.com/234/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/hmadrigal.wordpress.com/234/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hmadrigal.wordpress.com&amp;blog=10596476&amp;post=234&amp;subd=hmadrigal&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://hmadrigal.wordpress.com/2011/02/10/visual-studio-re-install-individual-packages/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6e8659583670c9667aaa010e1a0f318e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Yogurt</media:title>
		</media:content>

		<media:content url="http://hmadrigal.files.wordpress.com/2011/02/vsdbproject_error.png?w=300" medium="image">
			<media:title type="html">Visual Studio Broken package error</media:title>
		</media:content>
	</item>
		<item>
		<title>XNAWP7-1 A introduction</title>
		<link>http://hmadrigal.wordpress.com/2011/01/15/xnawp7-1-a-introduction/</link>
		<comments>http://hmadrigal.wordpress.com/2011/01/15/xnawp7-1-a-introduction/#comments</comments>
		<pubDate>Sat, 15 Jan 2011 14:19:01 +0000</pubDate>
		<dc:creator>hmadrigal</dc:creator>
				<category><![CDATA[.net]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[developer]]></category>
		<category><![CDATA[microsoft]]></category>
		<category><![CDATA[xna]]></category>
		<category><![CDATA[programing]]></category>
		<category><![CDATA[wp7]]></category>
		<category><![CDATA[XNAWP7]]></category>

		<guid isPermaLink="false">http://hmadrigal.wordpress.com/?p=225</guid>
		<description><![CDATA[Hello , I&#8217;ve been thinking about what should be my next post. I&#8217;d like to talk about WCF RIA, where I have had some encounters, but it&#8217;s like too soon to write about it. On the other hand, I won a raffle and the prize was a book about Windows Phone 7 Game Development (Thanks [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hmadrigal.wordpress.com&amp;blog=10596476&amp;post=225&amp;subd=hmadrigal&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Hello ,</p>
<p>I&#8217;ve been thinking about what should be my next post. I&#8217;d like to talk about WCF RIA, where I have had some encounters, but it&#8217;s like too soon to write about it. On the other hand, I won a raffle and the prize was a book about <em>Windows Phone 7 Game Development</em> (Thanks to <a href="http://www.101ftb.com/?rid=C20W00E900">101FreeTechbook</a> and additionally there is going to be a free workshop about XNA 4.0 development at <a href="http://gamedevelopedia.com/workshop-signup.aspx">gamedevelopedia</a> (Starting at 17-Jan-2010). Thus, I&#8217;ve decided to write a set of tutorials about XNA and WP7 for those who wants to start as well as I want.  If everything goes well the series will have the following tag <em>XNAWP7</em>, and I&#8217;ll try to post every week about the every new topic. So, lets get started.</p>
<p><strong>WP7: Windows Phone 7 Development</strong><br />
<em>Windows Phone 7</em>&#8216;s the platform Microsoft has release to create new experiences on Windows Phone development. This new platform is based on managed code, so it&#8217;s backed on .NET Compact Framework. At this time it&#8217;s possible to write application C#. There are two main framework  available for WP7 development:</p>
<p><strong>XNA: Xna is Not an Acronym</strong><br />
XNA is a high-performance game framework. It&#8217;s over DirectX and it allows to create application taking advantage of high performance on Graphics, sounds, networking and input devices. Additionally, it can take advantage of <em>Microsoft Live</em> to have a customized game experience.  The only drawback of this platform is that you have to create most of the components almost from scratch or get a third party framework instead.</p>
<p><strong> SL: Silverlight</strong><br />
Silverlight is framework build on .NET and it allows to create  rich interactive applications by using a declarative language (XAML). Xaml uses XML to describe how the UI is drawn, and the C# to details on logic and interaction. This framework also supports game development, this framework is fairly enough for games which does not have high-performance graphics nor have tons of elements. Event though, SL4 is already in the market and SL5 is on feature request on Jan-2011, WP7 uses an special flavor of Silverlight 3. This special flavor of SL3 has removed not related feature of mobile such as System.Window.Browse namespace, and it has added specific new namespaces in order to take advantage of the platform specific items.</p>
<p><strong>Windows Phone 7 and its hardware</strong><br />
Microsoft has defined very specific hardware in order to be able to run properly WP7 Operative System (WP7 OS).</p>
<ul>
<li>1 Ghz CPU processor</li>
<li> WVGA (480&#215;800) or HVGA (480,320)</li>
<li>Accelerometer sensor. <em>This sensor helps to detect the orientation of the device, this means it allows to detect if the device is point up, down, left right, etc..</em></li>
<li>GPS sensor <em>This sensor helps to detect the position around the world by detecting the latitude and longitude</em></li>
</ul>
<p><strong>Development on WP7</strong><br />
At lats but not least, let see what it&#8217;s required to develop on WP7 platform. The SDK is free and it can be downloaded at <a href="http://create.msdn.com/en-US/">AppHub</a> If you have <em>Visual Studio</em> already installed the WP7 tools will integrate with VS automatically. If you don&#8217;t have Visual Studio, then you can get the <em>Visual Studio Express</em> version for free at <a href="www.microsoft.com/express/"><em>Visual Studio Express</em></a>.<br />
If you wan to run you application in you phone, then you&#8217;ll need to get a XNA creators account to being able to deploy your application into your phone. Additionally by acquiring an account you&#8217;ll be able to publish your game in the Market place, at this time (Jan-2011) only US and Europe are available to publish content, it&#8217;s planned to open more countries during the next years.<br />
Don&#8217;t get worried if you don&#8217;t have a Windows Phone 7, you can start coding using the emulator which is already included with WP7 SDK, however it&#8217;s strongly recommended to use a physical WP7 to perform final tests. </p>
<p><strong>An initial application</strong><br />
As traditional, the hello world application. So, on this little sample you it&#8217;s possible to appreciate the basis to display text and sprites.</p>
<p><strong>The Main Game loop</strong><br />
If haven&#8217;t worked with game frameworks before, let me point out a concept known as <em>game loop</em>. Traditional programing models are <em>event based</em>, this means that a certain functionality is executed by a given trigger. But the most common video game frameworks does not work on this scheme, instead they use the <em>game loop</em> which is a &#8220;infinite&#8221; cycle where the application performs an update and then draw the scene. Frameworks such as XNA have methods invoked before and after the game loop is executed to perform initialization tasks, or free resources. This main loop game is implemented by the <em>Game</em> class of XNA. BTW there is a particularity of using XNA on WP7. Normally an application has an entry point such as the <em>main</em> function, and you can clearly see this function on a WP7 template project. However WP7 loads looks for instances of <em>Game</em> in your projects and handles them such a contract to define the execution of your application. </p>
<p><strong>A sprite</strong><br />
The word <em>sprite</em> is an term which hasn&#8217;t changed from its origin. During the age of 8-bits the very first images that were drawn on a screen were called <em>sprites</em>. So, an sprite a two dimensional rendered figure <img src='http://s1.wp.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> . <em>Sprites</em> have become a great resource because much of the game frameworks does not have a <em>graphic interface library</em> (GUI), thus sprites provides a good-alternative mechanism. On XNA an sprite is represented by the <em>Texture2D</em> class.</p>
<p><strong>Sprite font</strong><br />
Particularly XNA has decide to draw text by using sprites. Which means that all the charset is backed by images. A font on XNA is associated to an <em>spritefont</em>. On XNA an sprite is represented by the <em>SpriteFont</em> class.</p>
<p><strong>Drawing sprites</strong><br />
XNA defines a tool for drawing sprites (or spritefonts). XNA helps you to deal with the resources of you application by providing a content loader. This content loader is able to load the sprites, fonts, audio files that you application will consume. </p>
<p><strong>some csharp code<strong><br />
With all the previous <em>things</em> said I&#8217;m attaching what it would be the first post (hopefully of many more posts).<br />
<a href="http://hmadrigal.files.wordpress.com/2011/01/xnasample01.png"><img src="http://hmadrigal.files.wordpress.com/2011/01/xnasample01.png?w=300&#038;h=179" alt="" title="XNASample01" width="300" height="179" class="aligncenter size-medium wp-image-229" /></a><br />
Source code is at <a href="http://github.com/hmadrigal/xnawp7"> http://github.com/hmadrigal/xnawp7</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/hmadrigal.wordpress.com/225/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/hmadrigal.wordpress.com/225/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/hmadrigal.wordpress.com/225/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/hmadrigal.wordpress.com/225/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/hmadrigal.wordpress.com/225/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/hmadrigal.wordpress.com/225/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/hmadrigal.wordpress.com/225/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/hmadrigal.wordpress.com/225/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/hmadrigal.wordpress.com/225/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/hmadrigal.wordpress.com/225/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/hmadrigal.wordpress.com/225/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/hmadrigal.wordpress.com/225/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/hmadrigal.wordpress.com/225/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/hmadrigal.wordpress.com/225/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hmadrigal.wordpress.com&amp;blog=10596476&amp;post=225&amp;subd=hmadrigal&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://hmadrigal.wordpress.com/2011/01/15/xnawp7-1-a-introduction/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6e8659583670c9667aaa010e1a0f318e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Yogurt</media:title>
		</media:content>

		<media:content url="http://hmadrigal.files.wordpress.com/2011/01/xnasample01.png?w=300" medium="image">
			<media:title type="html">XNASample01</media:title>
		</media:content>
	</item>
	</channel>
</rss>
