<?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>Tim&#039;s Journal</title>
	<atom:link href="http://tofutim.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://tofutim.wordpress.com</link>
	<description>Figuring out the world... one day at a time.</description>
	<lastBuildDate>Thu, 13 May 2010 21:54:02 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='tofutim.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Tim&#039;s Journal</title>
		<link>http://tofutim.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://tofutim.wordpress.com/osd.xml" title="Tim&#039;s Journal" />
	<atom:link rel='hub' href='http://tofutim.wordpress.com/?pushpress=hub'/>
		<item>
		<title>An error occurred during the execution of the SQL file &#8216;InstallCommon.sql&#8217;.</title>
		<link>http://tofutim.wordpress.com/2010/05/13/an-error-occurred-during-the-execution-of-the-sql-file-installcommon-sql/</link>
		<comments>http://tofutim.wordpress.com/2010/05/13/an-error-occurred-during-the-execution-of-the-sql-file-installcommon-sql/#comments</comments>
		<pubDate>Thu, 13 May 2010 21:54:02 +0000</pubDate>
		<dc:creator>tofutim</dc:creator>
				<category><![CDATA[Azure]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[Membership]]></category>

		<guid isPermaLink="false">https://tofutim.wordpress.com/2010/05/13/an-error-occurred-during-the-execution-of-the-sql-file-installcommon-sql/</guid>
		<description><![CDATA[Perhaps you are attempting to install ASP.NET services onto Azure using aspnet_regsvr.exe.&#160; SQL Azure does not support the accompanying scripts without edits.&#160;&#160; Fortunately, Microsoft has generated scripts that should work, as well as aspnet_regsqlazure.exe.&#160; Unfortunately, the exe is graphically-challenged as well as hint-challenged.&#160; Just running it gives you: C:\Users\tim\Downloads\aspnet_regsqlazure&#62;aspnet_regsqlazure Execution failed: You must specify a [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tofutim.wordpress.com&amp;blog=13461357&amp;post=44&amp;subd=tofutim&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Perhaps you are attempting to install ASP.NET services onto Azure using aspnet_regsvr.exe.&#160; SQL Azure does not support the accompanying scripts without edits.&#160;&#160; Fortunately, Microsoft has generated <a href="http://support.microsoft.com/default.aspx/kb/2006191/de?p=1">scripts that should work</a>, as well as <a href="http://code.msdn.microsoft.com/KB2006191">aspnet_regsqlazure.exe</a>.&#160; Unfortunately, the exe is graphically-challenged as well as hint-challenged.&#160; Just running it gives you:</p>
<blockquote><p>C:\Users\tim\Downloads\aspnet_regsqlazure&gt;aspnet_regsqlazure     <br />Execution failed:      <br />You must specify a Server, Login ID and Password.</p>
</blockquote>
<p>Don’t even think about –? or –h.&#160; I went h.&#160; Likely the options will be similar to aspnet_regsvr, but for the geek-at-heart, source code <em>is</em> included (see below). </p>
<p>I used the following</p>
<blockquote><p>C:\Users\tim\Downloads\aspnet_regsqlazure&gt;aspnet_regsqlazure -xxxxxxxx.database.windows.net -U tim -P xxxxxxx -d xxxxx -A all     </p>
</blockquote>
<p>Note that you will see </p>
<p>Cannot grant, deny, or revoke permissions to sa, dbo, entity owner, information_schema, sys, or yourself.</p>
<p>It’s ok.</p>
<p>&#8212;&#8212;</p>
<p>
<div style="display:inline;float:none;margin:0;padding:0;" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:b7f9967d-40bf-4b58-ab8f-f2e6c3631b83" class="wlWriterEditableSmartContent">
<div style="border:#000080 1px solid;color:#000;font-family:'Courier New', Courier, Monospace;font-size:10pt;">
<div style="background:#ddd;max-height:300px;overflow:auto;">
<ol style="background:#ffffff;margin:0 0 0 2.5em;padding:0 0 0 5px;">
<li><span style="color:#0000ff;">private</span> <span style="color:#0000ff;">static</span> <span style="color:#0000ff;">void</span> ValidateOptions()</li>
<li style="background:#f3f3f3;">{</li>
<li>    <span style="color:#0000ff;">foreach</span> (<span style="color:#0000ff;">string</span> option <span style="color:#0000ff;">in</span> s_options.Keys)</li>
<li style="background:#f3f3f3;">    {</li>
<li>        <span style="color:#0000ff;">switch</span> (option.ToLower())</li>
<li style="background:#f3f3f3;">        {</li>
<li>            <span style="color:#0000ff;">case</span> <span style="color:#a31515;">&quot;s&quot;</span>:</li>
<li style="background:#f3f3f3;">                s_server = s_options[option];</li>
<li>                <span style="color:#0000ff;">break</span>;</li>
<li style="background:#f3f3f3;">&nbsp;</li>
<li>            <span style="color:#0000ff;">case</span> <span style="color:#a31515;">&quot;u&quot;</span>:</li>
<li style="background:#f3f3f3;">                s_login = s_options[option];</li>
<li>                <span style="color:#0000ff;">break</span>;</li>
<li style="background:#f3f3f3;">&nbsp;</li>
<li>            <span style="color:#0000ff;">case</span> <span style="color:#a31515;">&quot;p&quot;</span>:</li>
<li style="background:#f3f3f3;">                s_password = s_options[option];</li>
<li>                <span style="color:#0000ff;">break</span>;</li>
<li style="background:#f3f3f3;">&nbsp;</li>
<li>            <span style="color:#0000ff;">case</span> <span style="color:#a31515;">&quot;a&quot;</span>:</li>
<li style="background:#f3f3f3;">                SetMode(Operation.InstallFeatures);</li>
<li>                s_featureList = s_options[option].ToLower();</li>
<li style="background:#f3f3f3;">                <span style="color:#0000ff;">break</span>;</li>
<li>&nbsp;</li>
<li style="background:#f3f3f3;">            <span style="color:#0000ff;">case</span> <span style="color:#a31515;">&quot;r&quot;</span>:</li>
<li>                SetMode(Operation.RemoveFeatures);</li>
<li style="background:#f3f3f3;">                s_featureList = s_options[option].ToLower();</li>
<li>                <span style="color:#0000ff;">break</span>;</li>
<li style="background:#f3f3f3;">&nbsp;</li>
<li>            <span style="color:#0000ff;">case</span> <span style="color:#a31515;">&quot;ssadd&quot;</span>:</li>
<li style="background:#f3f3f3;">                <span style="color:#0000ff;">throw</span> <span style="color:#0000ff;">new</span> <span style="color:#2b91af;">ApplicationException</span>(<span style="color:#a31515;">&quot;Install Session State is not supported by aspnet_regsqlazure&quot;</span>);</li>
<li>&nbsp;</li>
<li style="background:#f3f3f3;">            <span style="color:#0000ff;">case</span> <span style="color:#a31515;">&quot;ssremove&quot;</span>:</li>
<li>                <span style="color:#0000ff;">throw</span> <span style="color:#0000ff;">new</span> <span style="color:#2b91af;">ApplicationException</span>(<span style="color:#a31515;">&quot;Remove Session State is not supported by aspnet_regsqlazure&quot;</span>);</li>
<li style="background:#f3f3f3;">                </li>
<li>            <span style="color:#0000ff;">case</span> <span style="color:#a31515;">&quot;sstype&quot;</span>:</li>
<li style="background:#f3f3f3;">                s_featureList = s_options[option].ToLower();</li>
<li>                <span style="color:#0000ff;">break</span>;</li>
<li style="background:#f3f3f3;">&nbsp;</li>
<li>            <span style="color:#0000ff;">case</span> <span style="color:#a31515;">&quot;d&quot;</span>:</li>
<li style="background:#f3f3f3;">                s_database = s_options[option];</li>
<li>                <span style="color:#0000ff;">break</span>;</li>
<li style="background:#f3f3f3;">&nbsp;</li>
<li>            <span style="color:#0000ff;">case</span> <span style="color:#a31515;">&quot;q&quot;</span>:</li>
<li style="background:#f3f3f3;">                s_quiet = <span style="color:#0000ff;">true</span>;</li>
<li>                <span style="color:#0000ff;">break</span>;</li>
<li style="background:#f3f3f3;">&nbsp;</li>
<li>            <span style="color:#0000ff;">case</span> <span style="color:#a31515;">&quot;w&quot;</span>:</li>
<li style="background:#f3f3f3;">                <span style="color:#0000ff;">throw</span> <span style="color:#0000ff;">new</span> <span style="color:#2b91af;">ApplicationException</span>(<span style="color:#a31515;">&quot;Wizard mode is not supported for aspnet_regsqlazure&quot;</span>);</li>
<li>&nbsp;</li>
<li style="background:#f3f3f3;">            <span style="color:#0000ff;">case</span> <span style="color:#a31515;">&quot;e&quot;</span>:</li>
<li>                <span style="color:#0000ff;">throw</span> <span style="color:#0000ff;">new</span> <span style="color:#2b91af;">ApplicationException</span>(<span style="color:#a31515;">&quot;NT Logins are not supported in Sql Azure.&quot;</span>);</li>
<li style="background:#f3f3f3;">&nbsp;</li>
<li>            <span style="color:#0000ff;">case</span> <span style="color:#a31515;">&quot;c&quot;</span>:</li>
<li style="background:#f3f3f3;">                <span style="color:#0000ff;">throw</span> <span style="color:#0000ff;">new</span> <span style="color:#2b91af;">ApplicationException</span>(</li>
<li>                    <span style="color:#a31515;">&quot;aspnet_regsqlazure cannot accept a raw connection string, must use -S -U -P switches.&quot;</span>);</li>
<li style="background:#f3f3f3;">&nbsp;</li>
<li>            <span style="color:#0000ff;">case</span> <span style="color:#a31515;">&quot;sqlexportonly&quot;</span>:</li>
<li style="background:#f3f3f3;">                <span style="color:#0000ff;">throw</span> <span style="color:#0000ff;">new</span> <span style="color:#2b91af;">ApplicationException</span>(<span style="color:#a31515;">&quot;SQL Export is not supported by aspnet_regsqlazure&quot;</span>);</li>
<li>&nbsp;</li>
<li style="background:#f3f3f3;">            <span style="color:#0000ff;">case</span> <span style="color:#a31515;">&quot;ed&quot;</span>:</li>
<li>            <span style="color:#0000ff;">case</span> <span style="color:#a31515;">&quot;dd&quot;</span>:</li>
<li style="background:#f3f3f3;">            <span style="color:#0000ff;">case</span> <span style="color:#a31515;">&quot;et&quot;</span>:</li>
<li>            <span style="color:#0000ff;">case</span> <span style="color:#a31515;">&quot;dt&quot;</span>:</li>
<li style="background:#f3f3f3;">            <span style="color:#0000ff;">case</span> <span style="color:#a31515;">&quot;t&quot;</span>:</li>
<li>            <span style="color:#0000ff;">case</span> <span style="color:#a31515;">&quot;lt&quot;</span>:</li>
<li style="background:#f3f3f3;">                <span style="color:#0000ff;">throw</span> <span style="color:#0000ff;">new</span> <span style="color:#2b91af;">ApplicationException</span>(<span style="color:#0000ff;">string</span>.Format(</li>
<li>                    <span style="color:#a31515;">&quot;Option {0} is not supported: SQL Cache dependency settings are not supported in Sql Azure.&quot;</span>,</li>
<li style="background:#f3f3f3;">                    option));</li>
<li>&nbsp;</li>
<li style="background:#f3f3f3;">            <span style="color:#0000ff;">default</span>:</li>
<li>                <span style="color:#0000ff;">throw</span> <span style="color:#0000ff;">new</span> <span style="color:#2b91af;">ApplicationException</span>(<span style="color:#0000ff;">string</span>.Format(<span style="color:#a31515;">&quot;Unknown Option {0} is not supported.&quot;</span>, option));</li>
<li style="background:#f3f3f3;">        }</li>
<li>    }</li>
<li style="background:#f3f3f3;">&nbsp;</li>
<li>    <span style="color:#0000ff;">if</span> (<span style="color:#0000ff;">string</span>.IsNullOrEmpty(s_connectionString) &amp;&amp; (<span style="color:#0000ff;">string</span>.IsNullOrEmpty(s_server)</li>
<li style="background:#f3f3f3;">        || <span style="color:#0000ff;">string</span>.IsNullOrEmpty(s_login)</li>
<li>        || <span style="color:#0000ff;">string</span>.IsNullOrEmpty(s_password)))</li>
<li style="background:#f3f3f3;">    {</li>
<li>        <span style="color:#0000ff;">throw</span> <span style="color:#0000ff;">new</span> <span style="color:#2b91af;">ApplicationException</span>(</li>
<li style="background:#f3f3f3;">            <span style="color:#a31515;">&quot;You must specify a Server, Login ID and Password.&quot;</span>);</li>
<li>    }</li>
<li style="background:#f3f3f3;">&nbsp;</li>
<li>    <span style="color:#0000ff;">if</span> (s_mode == Operation.NoOperation)</li>
<li style="background:#f3f3f3;">    {</li>
<li>        <span style="color:#0000ff;">throw</span> <span style="color:#0000ff;">new</span> <span style="color:#2b91af;">ApplicationException</span>(</li>
<li style="background:#f3f3f3;">            <span style="color:#a31515;">&quot;No operation was specified on the command line &#8211; wizard mode is not supported.&quot;</span>);</li>
<li>    }</li>
<li style="background:#f3f3f3;">}</li>
</ol></div>
</p></div>
</p></div></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/tofutim.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/tofutim.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/tofutim.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/tofutim.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/tofutim.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/tofutim.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/tofutim.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/tofutim.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/tofutim.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/tofutim.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/tofutim.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/tofutim.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/tofutim.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/tofutim.wordpress.com/44/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tofutim.wordpress.com&amp;blog=13461357&amp;post=44&amp;subd=tofutim&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://tofutim.wordpress.com/2010/05/13/an-error-occurred-during-the-execution-of-the-sql-file-installcommon-sql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/53a8a18baa2eda6e6758c3e522f77c24?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">tofutim</media:title>
		</media:content>
	</item>
		<item>
		<title>Server Error in Application &quot;ROLE SITE&quot;</title>
		<link>http://tofutim.wordpress.com/2010/05/06/server-error-in-application-role-site/</link>
		<comments>http://tofutim.wordpress.com/2010/05/06/server-error-in-application-role-site/#comments</comments>
		<pubDate>Thu, 06 May 2010 20:51:10 +0000</pubDate>
		<dc:creator>tofutim</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">https://tofutim.wordpress.com/2010/05/06/server-error-in-application-role-site/</guid>
		<description><![CDATA[If you see this error (HTTP Error 403.14) while getting started with Azure, it is likely that Directory Browsing is not enabled.&#160; Go ahead and fire up IIS Manager and click on the Directory Browsing icon under IIS.&#160; You should see something like this: Click enable, restart the server and re-run your code.&#160; If all [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tofutim.wordpress.com&amp;blog=13461357&amp;post=43&amp;subd=tofutim&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://tofutim.files.wordpress.com/2010/05/servererror.png"><img style="border-bottom:0;border-left:0;display:inline;border-top:0;border-right:0;" title="servererror" border="0" alt="servererror" src="http://tofutim.files.wordpress.com/2010/05/servererror_thumb.png?w=244&#038;h=173" width="244" height="173" /></a> </p>
<p>If you see this error (HTTP Error 403.14) while getting started with Azure, it is likely that Directory Browsing is not enabled.&#160; Go ahead and fire up IIS Manager and click on the Directory Browsing icon under IIS.&#160; You should see something like this:</p>
<p><a href="http://tofutim.files.wordpress.com/2010/05/directorybrowsing.png"><img style="border-bottom:0;border-left:0;display:inline;border-top:0;border-right:0;" title="directorybrowsing" border="0" alt="directorybrowsing" src="http://tofutim.files.wordpress.com/2010/05/directorybrowsing_thumb.png?w=244&#038;h=184" width="244" height="184" /></a> </p>
</p>
<p>Click enable, restart the server and re-run your code.&#160; If all goes well, you’ll be led to a directory view of your dev instance.</p>
<p><a href="http://tofutim.files.wordpress.com/2010/05/better.png"><img style="border-bottom:0;border-left:0;display:inline;border-top:0;border-right:0;" title="better" border="0" alt="better" src="http://tofutim.files.wordpress.com/2010/05/better_thumb.png?w=244&#038;h=153" width="244" height="153" /></a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/tofutim.wordpress.com/43/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/tofutim.wordpress.com/43/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/tofutim.wordpress.com/43/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/tofutim.wordpress.com/43/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/tofutim.wordpress.com/43/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/tofutim.wordpress.com/43/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/tofutim.wordpress.com/43/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/tofutim.wordpress.com/43/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/tofutim.wordpress.com/43/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/tofutim.wordpress.com/43/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/tofutim.wordpress.com/43/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/tofutim.wordpress.com/43/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/tofutim.wordpress.com/43/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/tofutim.wordpress.com/43/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tofutim.wordpress.com&amp;blog=13461357&amp;post=43&amp;subd=tofutim&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://tofutim.wordpress.com/2010/05/06/server-error-in-application-role-site/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/53a8a18baa2eda6e6758c3e522f77c24?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">tofutim</media:title>
		</media:content>

		<media:content url="http://tofutim.files.wordpress.com/2010/05/servererror_thumb.png" medium="image">
			<media:title type="html">servererror</media:title>
		</media:content>

		<media:content url="http://tofutim.files.wordpress.com/2010/05/directorybrowsing_thumb.png" medium="image">
			<media:title type="html">directorybrowsing</media:title>
		</media:content>

		<media:content url="http://tofutim.files.wordpress.com/2010/05/better_thumb.png" medium="image">
			<media:title type="html">better</media:title>
		</media:content>
	</item>
		<item>
		<title>Testing &quot;Paste as Visual Studio Code&#8221;</title>
		<link>http://tofutim.wordpress.com/2010/05/06/testing-paste-as-visual-studio-code/</link>
		<comments>http://tofutim.wordpress.com/2010/05/06/testing-paste-as-visual-studio-code/#comments</comments>
		<pubDate>Thu, 06 May 2010 18:29:32 +0000</pubDate>
		<dc:creator>tofutim</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">https://tofutim.wordpress.com/2010/05/06/testing-paste-as-visual-studio-code/</guid>
		<description><![CDATA[This was created by Tim.&#160; It’s already a winner in my book.&#160; Hehehe.&#160; Here we go: LoginCtrl.xaml.cs namespace AppHelper {     /// &#60;summary&#62;     /// Interaction logic for LoginCtrl.xaml     /// &#60;/summary&#62;     public partial class LoginCtrl : UserControl     {         public LoginCtrl()         {             InitializeComponent();         }     } } Mmmm.&#160; Nice.&#160; Except of course, that code did not start from Line [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tofutim.wordpress.com&amp;blog=13461357&amp;post=34&amp;subd=tofutim&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This was created by Tim.&#160; It’s already a winner in my book.&#160; Hehehe.&#160; Here we go:</p>
<div style="display:inline;float:none;margin:0;padding:0;" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:6afa47a7-3694-40b4-ba41-40fa4b6c5917" class="wlWriterEditableSmartContent">
<div style="border:#000080 1px solid;color:#000;font-family:'Courier New', Courier, Monospace;font-size:10pt;">
<div style="background:#000080;color:#fff;font-family:Verdana, Tahoma, Arial, sans-serif;font-weight:bold;padding:2px 5px;">LoginCtrl.xaml.cs</div>
<div style="background:#ddd;max-height:300px;overflow:auto;">
<ol style="background:#ffffff;margin:0 0 0 2.5em;padding:0 0 0 5px;">
<li><span style="color:#0000ff;">namespace</span> AppHelper</li>
<li style="background:#f3f3f3;">{</li>
<li>    <span style="color:#808080;">///</span><span style="color:#008000;"> </span><span style="color:#808080;">&lt;summary&gt;</span></li>
<li style="background:#f3f3f3;">    <span style="color:#808080;">///</span><span style="color:#008000;"> Interaction logic for LoginCtrl.xaml</span></li>
<li>    <span style="color:#808080;">///</span><span style="color:#008000;"> </span><span style="color:#808080;">&lt;/summary&gt;</span></li>
<li style="background:#f3f3f3;">    <span style="color:#0000ff;">public</span> <span style="color:#0000ff;">partial</span> <span style="color:#0000ff;">class</span> <span style="color:#2b91af;">LoginCtrl</span> : <span style="color:#2b91af;">UserControl</span></li>
<li>    {</li>
<li style="background:#f3f3f3;">        <span style="color:#0000ff;">public</span> LoginCtrl()</li>
<li>        {</li>
<li style="background:#f3f3f3;">            InitializeComponent();</li>
<li>        }</li>
<li style="background:#f3f3f3;">    }</li>
<li>}</li>
</ol></div>
</p></div>
</p></div>
<p>Mmmm.&#160; Nice.&#160; Except of course, that code did not start from Line 1 in my codebase…&#160; but this is already much improved.</p>
<div style="display:inline;float:none;margin:0;padding:0;" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:e2bffd4c-550c-4045-9da6-d95802b4b735" class="wlWriterEditableSmartContent">
<div style="border:#000080 1px solid;color:#000;font-family:'Courier New', Courier, Monospace;font-size:10pt;">
<div style="background:#000080;color:#fff;font-family:Verdana, Tahoma, Arial, sans-serif;font-weight:bold;padding:2px 5px;">LoginCtrl.xaml</div>
<div style="background:#ddd;max-height:300px;overflow:auto;">
<ol style="background:#ffffff;margin:0 0 0 2.5em;padding:0 0 0 5px;">
<li><span style="color:#0000ff;">&lt;</span><span style="color:#a31515;">UserControl</span><span style="color:#ff0000;"> x</span><span style="color:#0000ff;">:</span><span style="color:#ff0000;">Class</span><span style="color:#0000ff;">=&quot;AppHelper.LoginCtrl&quot;</span></li>
<li style="background:#f3f3f3;">            <span style="color:#ff0000;"> xmlns</span><span style="color:#0000ff;">=&quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation&quot;</span></li>
<li>            <span style="color:#ff0000;"> xmlns</span><span style="color:#0000ff;">:</span><span style="color:#ff0000;">x</span><span style="color:#0000ff;">=&quot;http://schemas.microsoft.com/winfx/2006/xaml&quot;</span></li>
<li style="background:#f3f3f3;">            <span style="color:#ff0000;"> xmlns</span><span style="color:#0000ff;">:</span><span style="color:#ff0000;">mc</span><span style="color:#0000ff;">=&quot;http://schemas.openxmlformats.org/markup-compatibility/2006&quot;</span> </li>
<li>            <span style="color:#ff0000;"> xmlns</span><span style="color:#0000ff;">:</span><span style="color:#ff0000;">d</span><span style="color:#0000ff;">=&quot;http://schemas.microsoft.com/expression/blend/2008&quot;</span> </li>
<li style="background:#f3f3f3;">            <span style="color:#ff0000;"> mc</span><span style="color:#0000ff;">:</span><span style="color:#ff0000;">Ignorable</span><span style="color:#0000ff;">=&quot;d&quot;</span> </li>
<li>            <span style="color:#ff0000;"> d</span><span style="color:#0000ff;">:</span><span style="color:#ff0000;">DesignHeight</span><span style="color:#0000ff;">=&quot;300&quot;</span><span style="color:#ff0000;"> d</span><span style="color:#0000ff;">:</span><span style="color:#ff0000;">DesignWidth</span><span style="color:#0000ff;">=&quot;300&quot;&gt;</span></li>
<li style="background:#f3f3f3;">    <span style="color:#a31515;"></span><span style="color:#0000ff;">&lt;</span><span style="color:#a31515;">Grid</span><span style="color:#0000ff;">&gt;</span></li>
<li>    <span style="color:#a31515;"></span><span style="color:#0000ff;">&lt;/</span><span style="color:#a31515;">Grid</span><span style="color:#0000ff;">&gt;</span></li>
<li style="background:#f3f3f3;"><span style="color:#0000ff;">&lt;/</span><span style="color:#a31515;">UserControl</span><span style="color:#0000ff;">&gt;</span></li>
</ol></div>
</p></div>
</p></div>
<p>We can make it nicer using custom CSS, but WordPress charges for that.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/tofutim.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/tofutim.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/tofutim.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/tofutim.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/tofutim.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/tofutim.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/tofutim.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/tofutim.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/tofutim.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/tofutim.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/tofutim.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/tofutim.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/tofutim.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/tofutim.wordpress.com/34/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tofutim.wordpress.com&amp;blog=13461357&amp;post=34&amp;subd=tofutim&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://tofutim.wordpress.com/2010/05/06/testing-paste-as-visual-studio-code/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/53a8a18baa2eda6e6758c3e522f77c24?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">tofutim</media:title>
		</media:content>
	</item>
		<item>
		<title>Testing Henry&#8217;s Clipboard Live</title>
		<link>http://tofutim.wordpress.com/2010/05/06/testing-henrys-clipboard-live/</link>
		<comments>http://tofutim.wordpress.com/2010/05/06/testing-henrys-clipboard-live/#comments</comments>
		<pubDate>Thu, 06 May 2010 18:21:14 +0000</pubDate>
		<dc:creator>tofutim</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">https://tofutim.wordpress.com/2010/05/06/testing-henrys-clipboard-live/</guid>
		<description><![CDATA[How about this one? namespace AppHelper { /// &#60;summary&#62; /// Interaction logic for LoginCtrl.xaml /// &#60;/summary&#62; public partial class LoginCtrl : UserControl { public LoginCtrl() { InitializeComponent(); } } } Ewww.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tofutim.wordpress.com&amp;blog=13461357&amp;post=33&amp;subd=tofutim&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>How about this one?</p>
<p> <font color="#0000ff" size="1" face="Consolas">
<p align="left">namespace</p>
<p>   <font color="#000000" size="1" face="Consolas"> AppHelper</font>
<p align="left">{</p>
<p align="left">
<p>   <font color="#808080" size="1" face="Consolas">///</font><font color="#008000" size="1" face="Consolas"> </font><font color="#808080" size="1" face="Consolas">&lt;summary&gt;</font><font color="#000000" size="1" face="Consolas"></font>
<p align="left"></p>
<p>   <font color="#808080" size="1" face="Consolas">///</font><font color="#008000" size="1" face="Consolas"> Interaction logic for LoginCtrl.xaml</font><font color="#000000" size="1" face="Consolas"></font>
<p align="left"></p>
<p>   <font color="#808080" size="1" face="Consolas">///</font><font color="#008000" size="1" face="Consolas"> </font><font color="#808080" size="1" face="Consolas">&lt;/summary&gt;</font><font color="#000000" size="1" face="Consolas"></font>
<p align="left"></p>
<p>   <font color="#0000ff" size="1" face="Consolas">public</font><font color="#000000" size="1" face="Consolas"> </font><font color="#0000ff" size="1" face="Consolas">partial</font><font color="#000000" size="1" face="Consolas"> </font><font color="#0000ff" size="1" face="Consolas">class</font><font color="#000000" size="1" face="Consolas"> </font><font color="#2b91af" size="1" face="Consolas">LoginCtrl</font><font color="#000000" size="1" face="Consolas"> : </font><font color="#2b91af" size="1" face="Consolas">UserControl</font><font color="#000000" size="1" face="Consolas"></font>
<p align="left">{</p>
<p align="left">
<p>   <font color="#0000ff" size="1" face="Consolas">public</font><font color="#000000" size="1" face="Consolas"> LoginCtrl()</font>
<p align="left">{</p>
<p align="left">InitializeComponent();</p>
<p align="left">}</p>
<p align="left">}</p>
<p align="left">}</p>
<p align="left">Ewww.</p>
<p> </font></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/tofutim.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/tofutim.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/tofutim.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/tofutim.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/tofutim.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/tofutim.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/tofutim.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/tofutim.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/tofutim.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/tofutim.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/tofutim.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/tofutim.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/tofutim.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/tofutim.wordpress.com/33/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tofutim.wordpress.com&amp;blog=13461357&amp;post=33&amp;subd=tofutim&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://tofutim.wordpress.com/2010/05/06/testing-henrys-clipboard-live/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/53a8a18baa2eda6e6758c3e522f77c24?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">tofutim</media:title>
		</media:content>
	</item>
		<item>
		<title>Editing using Windows Live Writer</title>
		<link>http://tofutim.wordpress.com/2010/05/06/editing-using-windows-live-writer/</link>
		<comments>http://tofutim.wordpress.com/2010/05/06/editing-using-windows-live-writer/#comments</comments>
		<pubDate>Thu, 06 May 2010 18:15:16 +0000</pubDate>
		<dc:creator>tofutim</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">https://tofutim.wordpress.com/2010/05/06/editing-using-windows-live-writer/</guid>
		<description><![CDATA[I went ahead and installed Windows Live Writer and Douglas Stockwell’s “Paste from Visual Studio” with the aim of pasting better looking code.&#160; Check this out: &#60;UserControl x:Class=&#34;AppHelper.LoginCtrl&#34; xmlns=&#34;http://schemas.microsoft.com/winfx/2006/xaml/presentation&#34; xmlns:x=&#34;http://schemas.microsoft.com/winfx/2006/xaml&#34; xmlns:mc=&#34;http://schemas.openxmlformats.org/markup-compatibility/2006&#34; xmlns:d=&#34;http://schemas.microsoft.com/expression/blend/2008&#34; mc:Ignorable=&#34;d&#34; d:DesignHeight=&#34;300&#34; d:DesignWidth=&#34;300&#34;&#62; &#60;Grid&#62; &#60;/Grid&#62; &#60;/UserControl&#62; and this: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tofutim.wordpress.com&amp;blog=13461357&amp;post=32&amp;subd=tofutim&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I went ahead and installed Windows Live Writer and Douglas Stockwell’s “<a href="http://gallery.live.com/liveItemDetail.aspx?li=d8835a5e-28da-4242-82eb-e1a006b083b9">Paste from Visual Studio</a>” with the aim of pasting better looking code.&#160; Check this out:</p>
<pre class="code"><span style="color:blue;">&lt;</span><span style="color:#a31515;">UserControl </span><span style="color:red;">x</span><span style="color:blue;">:</span><span style="color:red;">Class</span><span style="color:blue;">=&quot;AppHelper.LoginCtrl&quot;
             </span><span style="color:red;">xmlns</span><span style="color:blue;">=&quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation&quot;
             </span><span style="color:red;">xmlns</span><span style="color:blue;">:</span><span style="color:red;">x</span><span style="color:blue;">=&quot;http://schemas.microsoft.com/winfx/2006/xaml&quot;
             </span><span style="color:red;">xmlns</span><span style="color:blue;">:</span><span style="color:red;">mc</span><span style="color:blue;">=&quot;http://schemas.openxmlformats.org/markup-compatibility/2006&quot;
             </span><span style="color:red;">xmlns</span><span style="color:blue;">:</span><span style="color:red;">d</span><span style="color:blue;">=&quot;http://schemas.microsoft.com/expression/blend/2008&quot;
             </span><span style="color:red;">mc</span><span style="color:blue;">:</span><span style="color:red;">Ignorable</span><span style="color:blue;">=&quot;d&quot;
             </span><span style="color:red;">d</span><span style="color:blue;">:</span><span style="color:red;">DesignHeight</span><span style="color:blue;">=&quot;300&quot; </span><span style="color:red;">d</span><span style="color:blue;">:</span><span style="color:red;">DesignWidth</span><span style="color:blue;">=&quot;300&quot;&gt;
    &lt;</span><span style="color:#a31515;">Grid</span><span style="color:blue;">&gt;
    &lt;/</span><span style="color:#a31515;">Grid</span><span style="color:blue;">&gt;
&lt;/</span><span style="color:#a31515;">UserControl</span><span style="color:blue;">&gt;
</span></pre>
<p><a href="http://11011.net/software/vspaste"></a></p>
<p>and this: </p>
<pre class="code"><span style="color:blue;">using </span>System;
<span style="color:blue;">using </span>System.Collections.Generic;
<span style="color:blue;">using </span>System.Linq;
<span style="color:blue;">using </span>System.Text;
<span style="color:blue;">using </span>System.Windows;
<span style="color:blue;">using </span>System.Windows.Controls;
<span style="color:blue;">using </span>System.Windows.Data;
<span style="color:blue;">using </span>System.Windows.Documents;
<span style="color:blue;">using </span>System.Windows.Input;
<span style="color:blue;">using </span>System.Windows.Media;
<span style="color:blue;">using </span>System.Windows.Media.Imaging;
<span style="color:blue;">using </span>System.Windows.Navigation;
<span style="color:blue;">using </span>System.Windows.Shapes;

<span style="color:blue;">namespace </span>AppHelper
{
    <span style="color:gray;">/// &lt;summary&gt;
    /// </span><span style="color:green;">Interaction logic for LoginCtrl.xaml
    </span><span style="color:gray;">/// &lt;/summary&gt;
    </span><span style="color:blue;">public partial class </span><span style="color:#2b91af;">LoginCtrl </span>: <span style="color:#2b91af;">UserControl
    </span>{
        <span style="color:blue;">public </span>LoginCtrl()
        {
            InitializeComponent();
        }
    }
}</pre>
<p><a href="http://11011.net/software/vspaste"></a></p>
<p>Sweet.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/tofutim.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/tofutim.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/tofutim.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/tofutim.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/tofutim.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/tofutim.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/tofutim.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/tofutim.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/tofutim.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/tofutim.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/tofutim.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/tofutim.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/tofutim.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/tofutim.wordpress.com/32/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tofutim.wordpress.com&amp;blog=13461357&amp;post=32&amp;subd=tofutim&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://tofutim.wordpress.com/2010/05/06/editing-using-windows-live-writer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/53a8a18baa2eda6e6758c3e522f77c24?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">tofutim</media:title>
		</media:content>
	</item>
		<item>
		<title>HelloMEF : A MEF example (Final Release)</title>
		<link>http://tofutim.wordpress.com/2010/05/04/hellomef-a-mef-example/</link>
		<comments>http://tofutim.wordpress.com/2010/05/04/hellomef-a-mef-example/#comments</comments>
		<pubDate>Wed, 05 May 2010 05:06:54 +0000</pubDate>
		<dc:creator>tofutim</dc:creator>
				<category><![CDATA[MEF]]></category>

		<guid isPermaLink="false">http://tofutim.wordpress.com/?p=16</guid>
		<description><![CDATA[MEF stands for Managed Extensibility Framework. Think .NET&#8217;s &#8220;plugin system&#8221;. Many implementations exist for plugins, but the advantage of this is a strong backer and programmers who are already familiar with the framework. (For kicks, check out Shoki&#8217;s IPlugin/IPluginHost Plugin Architecture on CodeProject where we began this journey.) MEF is now on Preview 9 and [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tofutim.wordpress.com&amp;blog=13461357&amp;post=16&amp;subd=tofutim&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>MEF stands for <a href="http://mef.codeplex.com/">Managed Extensibility Framework</a>. Think .NET&#8217;s &#8220;plugin system&#8221;. Many implementations exist for plugins, but the advantage of this is a strong backer and programmers who are already familiar with the framework. (For kicks, check out Shoki&#8217;s IPlugin/IPluginHost <a href="http://www.codeproject.com/KB/cs/c__plugin_architecture.aspx">Plugin Architecture</a> on CodeProject where we began this journey.)</p>
<p>MEF is <del datetime="2010-05-05T04:51:34+00:00">now on Preview 9 and slated for final release sometime in the near future</del> part of .NET 4. Unfortunately, while well-written examples exist, they mostly seem to be based on Previews which have become out of date. The example I went through essentially follows Robert Muehsig&#8217;s <a href="http://code-inside.de/blog-in/2008/11/19/howto-first-steps-with-mef-hello-mef/">well-written Hello MEF</a>, with updated code.</p>
<p><span id="more-16"></span></p>
<p>Here&#8217;s the idea. First, I created an interface in the HelloService project. This be referenced by your App project as well as any extensions.</p>
<pre><code>
namespace HelloService
{
    public interface IHelloService
    {
        string GetHelloMessage();
    }
}
</code></pre>
<p>Next, in two additional projects, HelloService.Chinese and HelloService.English, I created the following:</p>
<pre><code>
using System.ComponentModel.Composition;

namespace HelloService.Chinese
{
    [Export(typeof(IHelloService))]
    public class ChineseHelloService : IHelloService
    {
        public string GetHelloMessage()
        {
            return "你好世界";
        }
    }
}
</code></pre>
<p>and</p>
<pre><code>
using System.ComponentModel.Composition;

namespace HelloService.English
{
    [Export(typeof(IHelloService))]
    public class EnglishHelloService : IHelloService
    {
        public string GetHelloMessage()
        {
            return "Hello World";
        }
    }
}
</code></pre>
<p>Make sure to add System.ComponentModel.Composition (and HelloService) in these two projects. This lets &#8220;Export&#8221; work. This takes care of the extensions.</p>
<p>I defined the host in a new project called HelloAppBase. In this case, MEF will check both my executing assembly (called using System.Reflection) and the &#8220;Plugins&#8221; directory. It is apparently also possible to monitor changes in the directory and monitor changes in realtime. The sweetest part of all this is the ImportMany above the List. It works so magically that it scares me&#8230; just a bit.</p>
<pre><code>
    public class HelloProgram
    {
        [ImportMany(typeof(IHelloService))]
        public List Services { get; set; }

        public HelloProgram()
        {
            var directory = "Plugins";
            if (!Directory.Exists(directory))
            {
                Directory.CreateDirectory(directory);
            }

            var catalog = new AggregateCatalog(
                new AssemblyCatalog(Assembly.GetExecutingAssembly()),
                new DirectoryCatalog(directory));

            var container = new CompositionContainer(catalog);
            container.ComposeParts(this);
        }

        public void WriteHelloGreetings()
        {
            Console.WriteLine();
            Console.WriteLine("Writing Greetings...");

            foreach (IHelloService svc in Services)
            {
                Console.WriteLine(svc.GetHelloMessage());
            }

            Console.WriteLine("...powered by MEF");
        }
    }
</code></pre>
<p>Very clean. I like it. <a href="http://tofutim.files.wordpress.com/2010/05/consoleapp.png"><img class="alignright size-medium wp-image-24" title="HelloConsole Project" src="http://tofutim.files.wordpress.com/2010/05/consoleapp.png?w=159&#038;h=300" alt="" width="159" height="300" /></a></p>
<p>Finally, create a Console application that calls HelloProgram. In Visual Studio, I created a Plugins directory within the Project and placed the two extensions (HelloService.Chinese.dll and HelloService.English.dll). Make sure the Properties for these are Content, Copy if newer. You can also drop them in by hand into the executing directory, but this saves some time.</p>
<pre><code>
using HelloAppBase;

namespace HelloConsole
{
    class Program
    {
        static void Main(string[] args)
        {
            HelloProgram program = new HelloProgram();
            program.WriteHelloGreetings();

            Console.ReadLine();
        }
    }
}
</code></pre>
<p><a href="http://tofutim.files.wordpress.com/2010/05/final.png"><img src="http://tofutim.files.wordpress.com/2010/05/final.png?w=300&#038;h=105" alt="" title="HelloConsole" width="300" height="105" class="alignnone size-medium wp-image-28" /></a></p>
<p>Yeehaw.</p>
<p><strong>Update:</strong><br />
After drafting this post, I did a search and found Derik Whittaker&#8217;s <a href="http://devlicio.us/blogs/derik_whittaker/archive/2009/10/27/simple-kick-start-example-using-mef-preview-8.aspx">Kick Start Example</a>. Though built for Preview 8, everything looks good and should work.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/tofutim.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/tofutim.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/tofutim.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/tofutim.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/tofutim.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/tofutim.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/tofutim.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/tofutim.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/tofutim.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/tofutim.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/tofutim.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/tofutim.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/tofutim.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/tofutim.wordpress.com/16/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tofutim.wordpress.com&amp;blog=13461357&amp;post=16&amp;subd=tofutim&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://tofutim.wordpress.com/2010/05/04/hellomef-a-mef-example/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/53a8a18baa2eda6e6758c3e522f77c24?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">tofutim</media:title>
		</media:content>

		<media:content url="http://tofutim.files.wordpress.com/2010/05/consoleapp.png?w=159" medium="image">
			<media:title type="html">HelloConsole Project</media:title>
		</media:content>

		<media:content url="http://tofutim.files.wordpress.com/2010/05/final.png?w=300" medium="image">
			<media:title type="html">HelloConsole</media:title>
		</media:content>
	</item>
		<item>
		<title>OAuth2 for .NET?</title>
		<link>http://tofutim.wordpress.com/2010/05/04/oauth2-for-net/</link>
		<comments>http://tofutim.wordpress.com/2010/05/04/oauth2-for-net/#comments</comments>
		<pubDate>Tue, 04 May 2010 15:45:57 +0000</pubDate>
		<dc:creator>tofutim</dc:creator>
				<category><![CDATA[OAuth2]]></category>

		<guid isPermaLink="false">http://tofutim.wordpress.com/?p=5</guid>
		<description><![CDATA[I&#8217;m on the hunt for resources to implement OAuth2 in .NET.  The reference currently lists only Cocoa and Ruby implementations.  A search on Github yields the same: Cocoa &#8211; cocoa-oauth2 from Lee Byron works at Facebook, so this ought to be a solid reference. The project has no licensing information. Ruby &#8211; OAuth2 Gem from [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tofutim.wordpress.com&amp;blog=13461357&amp;post=5&amp;subd=tofutim&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m on the hunt for resources to implement OAuth2 in .NET.  The <a href="http://wiki.oauth.net/OAuth-2">reference</a> currently lists only Cocoa and Ruby implementations.  A search on Github yields the same:</p>
<ul>
<li>Cocoa &#8211; <a href="http://github.com/leebyron/cocoa-oauth2">cocoa-oauth2</a> from <a href="http://www.leebyron.com/">Lee Byron</a> <a href="http://wiki.oauth.net/OAuth-2">works at Facebook</a>, so this ought to be a solid reference.  The project has no licensing information.</li>
<li>Ruby &#8211; <a href="http://github.com/intridea/oauth2">OAuth2 Gem</a> from Intridea and Michael Bleigh. Built for the new Facebook Graph API, it carries an <a href="http://github.com/intridea/oauth2/blob/master/LICENSE">unrestrictive license</a>. Their <a href="http://intridea.com/2010/4/22/oauth2-gem-just-in-time-for-facebook-graph?blog=company">blog post</a> summarizes installation and usage. Michael writes &#8220;OAuth 2.0 is an almost entirely different beast than 1.0a and they share so little functionality&#8230;&#8221;</li>
</ul>
<p>Note that there is a Python library called <a href="http://github.com/simplegeo/python-oauth2">python-oauth2</a> from simplegeo. Do not be confused.  This is not OAuth 2.0. It is a fork from Leah Culver&#8217;s oauth.py.  I found nothing in CodePlex or CodeProject.</p>
<p>My favorite OAuth client library is Andrew Arnott&#8217;s <a href="http://www.dotnetopenauth.net/">DotNetOpenAuth</a> &#8211; though it is rather weighty since it includes both client and provider as well as OpenID.  In a <a href="http://twitter.com/aarnott/statuses/13052738563">recent tweet</a>, Arnott claimed &#8220;oauth 2.0 support is slated for DotNetOpenAuth 3.5&#8243; (currently 3.4.3).  I hope it comes soon!  If you have any leads, please post below.</p>
<p><strong>Update:</strong><br />
I found an <a href="http://osnapz.wordpress.com/2010/04/23/using-asp-net-with-facebooks-graph-api-and-oauth-2-0-authentication/">ASP.NET Facebook-OAuth2</a> sample by Osznaps based on earlier work on Twitter OAuth.  &#8220;The really great news is that OAuth 2.0 is super simple to use.&#8221;</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/tofutim.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/tofutim.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/tofutim.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/tofutim.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/tofutim.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/tofutim.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/tofutim.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/tofutim.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/tofutim.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/tofutim.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/tofutim.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/tofutim.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/tofutim.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/tofutim.wordpress.com/5/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tofutim.wordpress.com&amp;blog=13461357&amp;post=5&amp;subd=tofutim&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://tofutim.wordpress.com/2010/05/04/oauth2-for-net/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/53a8a18baa2eda6e6758c3e522f77c24?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">tofutim</media:title>
		</media:content>
	</item>
	</channel>
</rss>
