<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0">
  <channel>
    <title>Marcin Waligora's Greatest Coder</title>
    <link>http://www.greatestcoder.com/blog/</link>
    <description>Errr, some catchy title....</description>
    <language>en-us</language>
    <copyright>Marcin Waligora</copyright>
    <lastBuildDate>Tue, 22 Jan 2008 16:55:34 GMT</lastBuildDate>
    <generator>newtelligence dasBlog 2.0.7226.0</generator>
    <managingEditor>marcin@greatestcoder.com</managingEditor>
    <webMaster>marcin@greatestcoder.com</webMaster>
    <item>
      <trackback:ping>http://www.greatestcoder.com/blog/Trackback.aspx?guid=17945cd0-1733-429a-b4c7-48aa11ab3b54</trackback:ping>
      <pingback:server>http://www.greatestcoder.com/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.greatestcoder.com/blog/PermaLink,guid,17945cd0-1733-429a-b4c7-48aa11ab3b54.aspx</pingback:target>
      <dc:creator>Marcin Waligora</dc:creator>
      <wfw:comment>http://www.greatestcoder.com/blog/CommentView,guid,17945cd0-1733-429a-b4c7-48aa11ab3b54.aspx</wfw:comment>
      <wfw:commentRss>http://www.greatestcoder.com/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=17945cd0-1733-429a-b4c7-48aa11ab3b54</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p style="margin-bottom: 0cm;">
This post is a more of a reminder for myself as I have to do this every few months
and I end up googleing it every time, because I don't remember what exactly needs
to be done.
</p>
        <p style="margin-bottom: 0cm;">
          <br />
        </p>
        <p style="margin-bottom: 0cm;">
          <b>The problem:</b>
        </p>
        <p style="margin-bottom: 0cm;">
How to get your hands on the DLL (as a file) that is stored in GAC.
</p>
        <p style="margin-bottom: 0cm;">
          <br />
        </p>
        <p style="margin-bottom: 0cm;">
          <b>The solution:</b>
        </p>
        <p style="margin-bottom: 0cm;">
When you go to Windows\assembly directory you will see something like the screen below.
</p>
        <p style="margin-bottom: 0cm;">
          <br />
        </p>
        <p>
        </p>
        <img src="http://www.greatestcoder.com/blog/content/binary/1.jpg" border="0" />
        <br />
        <br />
        <p style="margin-bottom: 0cm;">
          <br />
        </p>
The above Shel extenstion is great for quickly checking which versions of GACed DLLs
are installed on the machine.<br /><br /><p style="margin-bottom: 0cm;"><a name="intelliTXT"></a>The problem arises when you want to copy the DLL itself (as
a file). In this shell extension (<a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cptools/html/cpgrfassemblycacheviewershfusiondll.asp">Assembly
Cache Viewer (SHFusion.dll)</a> you're not allowed to do that. You may wonder why
would you want to copy those DLLs in the first place. Well, for example when you want
to install the DLL on the machine and the only copy of the DLL you've got is in GAC.
</p><p style="margin-bottom: 0cm;"><br /></p><p style="margin-bottom: 0cm;">
Ok, enough foreplay. Here's the actual solution:
</p><p style="margin-bottom: 0cm;"><br /></p><p style="margin-bottom: 0cm;">
For first time on each machine add key: 
</p><p style="margin-bottom: 0cm;"><b>DisableCacheViewer</b> in
</p><p style="margin-bottom: 0cm;"><a name="intelliTXT1"></a><code><b>HKLM\Software\Microsoft\Fusion</b></code><b></b></p><p style="margin-bottom: 0cm;">
Set the DWORD value to 1.
</p><p style="margin-bottom: 0cm;"><br /></p><p style="margin-bottom: 0cm;">
Now if you go to the assembly directory you'll see the following screen.
</p><p style="margin-bottom: 0cm;"><br /></p><br /><img src="http://www.greatestcoder.com/blog/content/binary/2.jpg" border="0" /><br /><p style="margin-bottom: 0cm;"><br /></p><p style="margin-bottom: 0cm;">
For all future usage, simply toggle the registry value.
</p><p style="margin-bottom: 0cm;"><br /></p><p style="margin-bottom: 0cm;">
NOTE: There are other ways of doing this, such as disabling SHFusion via command line,
but I find this one the easiest.
</p><br /><img width="0" height="0" src="http://www.greatestcoder.com/blog/aggbug.ashx?id=17945cd0-1733-429a-b4c7-48aa11ab3b54" /></body>
      <title>Obtaining DLLs from the Global Assembly Cache</title>
      <guid isPermaLink="false">http://www.greatestcoder.com/blog/PermaLink,guid,17945cd0-1733-429a-b4c7-48aa11ab3b54.aspx</guid>
      <link>http://www.greatestcoder.com/blog/2008/01/22/ObtainingDLLsFromTheGlobalAssemblyCache.aspx</link>
      <pubDate>Tue, 22 Jan 2008 16:55:34 GMT</pubDate>
      <description>&lt;p style="margin-bottom: 0cm;"&gt;
This post is a more of a reminder for myself as I have to do this every few months
and I end up googleing it every time, because I don't remember what exactly needs
to be done.
&lt;/p&gt;
&lt;p style="margin-bottom: 0cm;"&gt;
&lt;br&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0cm;"&gt;
&lt;b&gt;The problem:&lt;/b&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0cm;"&gt;
How to get your hands on the DLL (as a file) that is stored in GAC.
&lt;/p&gt;
&lt;p style="margin-bottom: 0cm;"&gt;
&lt;br&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0cm;"&gt;
&lt;b&gt;The solution:&lt;/b&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0cm;"&gt;
When you go to Windows\assembly directory you will see something like the screen below.
&lt;/p&gt;
&lt;p style="margin-bottom: 0cm;"&gt;
&lt;br&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;img src="http://www.greatestcoder.com/blog/content/binary/1.jpg" border="0"&gt;
&lt;br&gt;
&lt;br&gt;
&lt;p style="margin-bottom: 0cm;"&gt;
&lt;br&gt;
&lt;/p&gt;
The above Shel extenstion is great for quickly checking which versions of GACed DLLs
are installed on the machine.&lt;br&gt;
&lt;br&gt;
&lt;p style="margin-bottom: 0cm;"&gt;
&lt;a name="intelliTXT"&gt;&lt;/a&gt;The problem arises when you want to copy the DLL itself (as
a file). In this shell extension (&lt;a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cptools/html/cpgrfassemblycacheviewershfusiondll.asp"&gt;Assembly
Cache Viewer (SHFusion.dll)&lt;/a&gt; you're not allowed to do that. You may wonder why
would you want to copy those DLLs in the first place. Well, for example when you want
to install the DLL on the machine and the only copy of the DLL you've got is in GAC.
&lt;/p&gt;
&lt;p style="margin-bottom: 0cm;"&gt;
&lt;br&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0cm;"&gt;
Ok, enough foreplay. Here's the actual solution:
&lt;/p&gt;
&lt;p style="margin-bottom: 0cm;"&gt;
&lt;br&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0cm;"&gt;
For first time on each machine add key: 
&lt;/p&gt;
&lt;p style="margin-bottom: 0cm;"&gt;
&lt;b&gt;DisableCacheViewer&lt;/b&gt; in
&lt;/p&gt;
&lt;p style="margin-bottom: 0cm;"&gt;
&lt;a name="intelliTXT1"&gt;&lt;/a&gt;&lt;code&gt;&lt;b&gt;HKLM\Software\Microsoft\Fusion&lt;/b&gt;&lt;/code&gt;&lt;b&gt; &lt;/b&gt; 
&lt;/p&gt;
&lt;p style="margin-bottom: 0cm;"&gt;
Set the DWORD value to 1.
&lt;/p&gt;
&lt;p style="margin-bottom: 0cm;"&gt;
&lt;br&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0cm;"&gt;
Now if you go to the assembly directory you'll see the following screen.
&lt;/p&gt;
&lt;p style="margin-bottom: 0cm;"&gt;
&lt;br&gt;
&lt;/p&gt;
&lt;br&gt;
&lt;img src="http://www.greatestcoder.com/blog/content/binary/2.jpg" border="0"&gt;
&lt;br&gt;
&lt;p style="margin-bottom: 0cm;"&gt;
&lt;br&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0cm;"&gt;
For all future usage, simply toggle the registry value.
&lt;/p&gt;
&lt;p style="margin-bottom: 0cm;"&gt;
&lt;br&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0cm;"&gt;
NOTE: There are other ways of doing this, such as disabling SHFusion via command line,
but I find this one the easiest.
&lt;/p&gt;
&lt;br&gt;
&lt;img width="0" height="0" src="http://www.greatestcoder.com/blog/aggbug.ashx?id=17945cd0-1733-429a-b4c7-48aa11ab3b54" /&gt;</description>
      <comments>http://www.greatestcoder.com/blog/CommentView,guid,17945cd0-1733-429a-b4c7-48aa11ab3b54.aspx</comments>
      <category>Other</category>
      <category>Tools</category>
    </item>
    <item>
      <trackback:ping>http://www.greatestcoder.com/blog/Trackback.aspx?guid=d6af41a5-51db-4e26-8dcd-3e471f670b54</trackback:ping>
      <pingback:server>http://www.greatestcoder.com/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.greatestcoder.com/blog/PermaLink,guid,d6af41a5-51db-4e26-8dcd-3e471f670b54.aspx</pingback:target>
      <dc:creator>Marcin Waligora</dc:creator>
      <wfw:comment>http://www.greatestcoder.com/blog/CommentView,guid,d6af41a5-51db-4e26-8dcd-3e471f670b54.aspx</wfw:comment>
      <wfw:commentRss>http://www.greatestcoder.com/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=d6af41a5-51db-4e26-8dcd-3e471f670b54</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p class="MsoNormal">
I've updated the blog engine. I have moved from <a href="http://www.process64.com/thinkjot/">ThinkJot </a>to <a href="http://www.dasblog.info/">dasBlog </a>version
2.0.<br /><br />
The move has been really easy. I've simply copied all the new files to the directory.
Moved the files from the old 'content' directory to the new directory and that's it!<br /><br />
Oh yeah, I've also edit some configuration files. 
<br /><br />
Now that's a true XCopy experience!<br /><br />
While updating the blog I've decided to use a new theme. I've moved from essence to
business (I've modified it slightly...). I hope everyone likes it.<br /><br />
I really like the new engine, it's got a few fixes that I was waiting for...
</p>
        <p>
        </p>
        <img width="0" height="0" src="http://www.greatestcoder.com/blog/aggbug.ashx?id=d6af41a5-51db-4e26-8dcd-3e471f670b54" />
      </body>
      <title>Blog engine update</title>
      <guid isPermaLink="false">http://www.greatestcoder.com/blog/PermaLink,guid,d6af41a5-51db-4e26-8dcd-3e471f670b54.aspx</guid>
      <link>http://www.greatestcoder.com/blog/2008/01/09/BlogEngineUpdate.aspx</link>
      <pubDate>Wed, 09 Jan 2008 11:38:24 GMT</pubDate>
      <description>
&lt;p class="MsoNormal"&gt;
I've updated the blog engine. I have moved from &lt;a href="http://www.process64.com/thinkjot/"&gt;ThinkJot &lt;/a&gt;to &lt;a href="http://www.dasblog.info/"&gt;dasBlog &lt;/a&gt;version
2.0.&lt;br&gt;
&lt;br&gt;
The move has been really easy. I've simply copied all the new files to the directory.
Moved the files from the old 'content' directory to the new directory and that's it!&lt;br&gt;
&lt;br&gt;
Oh yeah, I've also edit some configuration files. 
&lt;br&gt;
&lt;br&gt;
Now that's a true XCopy experience!&lt;br&gt;
&lt;br&gt;
While updating the blog I've decided to use a new theme. I've moved from essence to
business (I've modified it slightly...). I hope everyone likes it.&lt;br&gt;
&lt;br&gt;
I really like the new engine, it's got a few fixes that I was waiting for...
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.greatestcoder.com/blog/aggbug.ashx?id=d6af41a5-51db-4e26-8dcd-3e471f670b54" /&gt;</description>
      <comments>http://www.greatestcoder.com/blog/CommentView,guid,d6af41a5-51db-4e26-8dcd-3e471f670b54.aspx</comments>
      <category>Other</category>
    </item>
    <item>
      <trackback:ping>http://www.greatestcoder.com/blog/Trackback.aspx?guid=418c4eec-bc74-4ee5-9b7d-3537a33a4030</trackback:ping>
      <pingback:server>http://www.greatestcoder.com/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.greatestcoder.com/blog/PermaLink,guid,418c4eec-bc74-4ee5-9b7d-3537a33a4030.aspx</pingback:target>
      <dc:creator>Marcin Waligora</dc:creator>
      <wfw:comment>http://www.greatestcoder.com/blog/CommentView,guid,418c4eec-bc74-4ee5-9b7d-3537a33a4030.aspx</wfw:comment>
      <wfw:commentRss>http://www.greatestcoder.com/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=418c4eec-bc74-4ee5-9b7d-3537a33a4030</wfw:commentRss>
      <title>xSQL Rocks!!!</title>
      <guid isPermaLink="false">http://www.greatestcoder.com/blog/PermaLink,guid,418c4eec-bc74-4ee5-9b7d-3537a33a4030.aspx</guid>
      <link>http://www.greatestcoder.com/blog/2007/11/21/xSQLRocks.aspx</link>
      <pubDate>Wed, 21 Nov 2007 13:57:18 GMT</pubDate>
      <description>&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;font face=Arial size=2&gt;Disclaimer: Nobody paid me for this post. I am not endorsed
by anyone in any way. Although, I do accept donations :D.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;
&lt;o:p&gt;
&lt;font face=Arial size=2&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;o:p&gt;
&lt;font face=Arial size=2&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;font face=Arial size=2&gt;I’ve been using tools from &lt;/font&gt;&lt;a href="http://www.xsqlsoftware.com/"&gt;&lt;font face=Arial size=2&gt;xSQL&lt;/font&gt;&lt;/a&gt;&lt;font face=Arial size=2&gt; for
a few months now. I have to say, I love those guys. &lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;o:p&gt;
&lt;font face=Arial size=2&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;font face=Arial size=2&gt;There are the three products I use the most.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;o:p&gt;
&lt;font face=Arial size=2&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;a href="http://www.xsqlsoftware.com/Product/Sql_Data_Compare.aspx"&gt;&lt;font face=Arial size=2&gt;xSQL
Data Compare&lt;/font&gt;&lt;/a&gt;&lt;font face=Arial size=2&gt;, which is a typical application for
synchronizing data between databases. The cool part is that they have a free edition
for smaller databases. It’s great when you’re just starting a project and there not
many tables, sps… and yet, you still have to continuously keep data synchronized between
versions.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;o:p&gt;
&lt;font face=Arial size=2&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;font face=Arial size=2&gt;The other tool that I absolutely adore is &lt;/font&gt;&lt;a href="http://www.xsqlsoftware.com/Product/Sql_Server_Script_Executor.aspx"&gt;&lt;font face=Arial size=2&gt;xSQL
Script Executor&lt;/font&gt;&lt;/a&gt;&lt;font size=2&gt;&lt;font face=Arial&gt;. All it does is runs numerous
SQL scripts as batch. If you use VSS for storing all your tables, sps and relationship
scripts you will really appreciate this tool. Thanks to it you can rebuild whole database
in a matter of seconds. Furthermore, I believe this is the only tool like that on
the market (meaning, google didn’t find anything that was even similar &lt;/font&gt;&lt;span style="FONT-FAMILY: Wingdings; mso-ascii-font-family: Arial; mso-hansi-font-family: Arial; mso-char-type: symbol; mso-symbol-font-family: Wingdings"&gt;&lt;span style="mso-char-type: symbol; mso-symbol-font-family: Wingdings"&gt;J&lt;/span&gt;&lt;/span&gt;&lt;font face=Arial&gt; ).&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;o:p&gt;
&lt;font face=Arial size=2&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;font face=Arial size=2&gt;Finally, a truly innovative approach to working with DBs: &lt;/font&gt;&lt;a href="http://www.xsqlsoftware.com/Product/Sql_Database_Object_Search.aspx"&gt;&lt;font face=Arial size=2&gt;xSQL
Object Search&lt;/font&gt;&lt;/a&gt;&lt;font face=Arial size=2&gt;. It allows you to search for objects
(tables, sps and such) based on their name. This tool is invaluable when you get an
existing project that uses behemoth of a database, and you have to locate some related
objects (say, you want to fix some functionality of the system).&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;o:p&gt;
&lt;font face=Arial size=2&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;font face=Arial size=2&gt;On the final note, did I mention that &lt;/font&gt;&lt;a href="http://www.xsqlsoftware.com/Product/Sql_Server_Script_Executor.aspx"&gt;&lt;font face=Arial size=2&gt;xSQL
Script Executor&lt;/font&gt;&lt;/a&gt;&lt;font face=Arial size=2&gt; and &lt;/font&gt;&lt;a href="http://www.xsqlsoftware.com/Product/Sql_Database_Object_Search.aspx"&gt;&lt;font face=Arial size=2&gt;xSQL
Object Search&lt;/font&gt;&lt;/a&gt;&lt;font face=Arial size=2&gt; are totally free!!! &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.greatestcoder.com/blog/aggbug.ashx?id=418c4eec-bc74-4ee5-9b7d-3537a33a4030" /&gt;</description>
      <comments>http://www.greatestcoder.com/blog/CommentView,guid,418c4eec-bc74-4ee5-9b7d-3537a33a4030.aspx</comments>
      <category>Tools</category>
    </item>
    <item>
      <trackback:ping>http://www.greatestcoder.com/blog/Trackback.aspx?guid=35913007-47e5-4850-8f6a-47c85a3e6ed2</trackback:ping>
      <pingback:server>http://www.greatestcoder.com/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.greatestcoder.com/blog/PermaLink,guid,35913007-47e5-4850-8f6a-47c85a3e6ed2.aspx</pingback:target>
      <dc:creator>Marcin Waligora</dc:creator>
      <wfw:comment>http://www.greatestcoder.com/blog/CommentView,guid,35913007-47e5-4850-8f6a-47c85a3e6ed2.aspx</wfw:comment>
      <wfw:commentRss>http://www.greatestcoder.com/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=35913007-47e5-4850-8f6a-47c85a3e6ed2</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
This is a quick tip. Below is the code that you can use when you want to find what's
the name of the Virtual Directory. 
</p>
        <font color="#0000ff" size="2">
          <p>
string
</p>
        </font>
        <font size="2"> virtualDirectory =</font>
        <font color="#2b91af" size="2">AppDomain</font>
        <font size="2">.CurrentDomain.FriendlyName;
</font>
        <font size="2">
          <p>
virtualDirectory = virtualDirectory.Substring(virtualDirectory.LastIndexOf(
</p>
        </font>
        <font color="#a31515" size="2">"/"</font>
        <font size="2">));
<p>
virtualDirectory = virtualDirectory.Substring(0, virtualDirectory.IndexOf(
</p></font>
        <font color="#a31515" size="2">"-"</font>
        <font size="2">));</font>
        <p>
          <font size="2">
          </font> 
</p>
        <p>
          <font size="2">
            <font size="3">Notes: This has been tested in IIS 6. If you run this
code in ASP.NET Dev Server you'll get an exception as CurrentDomain.FrienlyName will
not contain any '/' (no virtual directory).</font>
          </font>
        </p>
        <img width="0" height="0" src="http://www.greatestcoder.com/blog/aggbug.ashx?id=35913007-47e5-4850-8f6a-47c85a3e6ed2" />
      </body>
      <title>Get VirtualDirectory Name in C#</title>
      <guid isPermaLink="false">http://www.greatestcoder.com/blog/PermaLink,guid,35913007-47e5-4850-8f6a-47c85a3e6ed2.aspx</guid>
      <link>http://www.greatestcoder.com/blog/2007/11/09/GetVirtualDirectoryNameInC.aspx</link>
      <pubDate>Fri, 09 Nov 2007 14:35:53 GMT</pubDate>
      <description>&lt;p&gt;
This is a quick tip. Below is the code that you can use when you want to find what's
the name of the Virtual Directory. 
&lt;/p&gt;
&lt;font color=#0000ff size=2&gt; 
&lt;p&gt;
string
&lt;/font&gt;&lt;font size=2&gt; virtualDirectory =&lt;/font&gt;&lt;font color=#2b91af size=2&gt;AppDomain&lt;/font&gt;&lt;font size=2&gt;.CurrentDomain.FriendlyName;&gt;
&lt;/font&gt;&lt;font size=2&gt; 
&lt;p&gt;
virtualDirectory = virtualDirectory.Substring(virtualDirectory.LastIndexOf(
&lt;/font&gt;&lt;font color=#a31515 size=2&gt;"/"&lt;/font&gt;&lt;font size=2&gt;));&gt;
&lt;p&gt;
virtualDirectory = virtualDirectory.Substring(0, virtualDirectory.IndexOf(
&lt;/font&gt;&lt;font color=#a31515 size=2&gt;"-"&lt;/font&gt;&lt;font size=2&gt;));&lt;/font&gt;&gt;
&lt;p&gt;
&lt;font size=2&gt;&lt;/font&gt;&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
&lt;font size=2&gt;&lt;font size=3&gt;Notes: This has been tested in IIS 6. If you run this code
in ASP.NET Dev Server you'll get an exception as CurrentDomain.FrienlyName will not
contain any '/' (no virtual directory).&lt;/font&gt;
&lt;/p&gt;
&gt;&lt;img width="0" height="0" src="http://www.greatestcoder.com/blog/aggbug.ashx?id=35913007-47e5-4850-8f6a-47c85a3e6ed2" /&gt;</description>
      <comments>http://www.greatestcoder.com/blog/CommentView,guid,35913007-47e5-4850-8f6a-47c85a3e6ed2.aspx</comments>
      <category>ASP.NET</category>
    </item>
    <item>
      <trackback:ping>http://www.greatestcoder.com/blog/Trackback.aspx?guid=54c7de6d-a0ba-448c-95a6-98d80a3c456a</trackback:ping>
      <pingback:server>http://www.greatestcoder.com/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.greatestcoder.com/blog/PermaLink,guid,54c7de6d-a0ba-448c-95a6-98d80a3c456a.aspx</pingback:target>
      <dc:creator>Marcin Waligora</dc:creator>
      <wfw:comment>http://www.greatestcoder.com/blog/CommentView,guid,54c7de6d-a0ba-448c-95a6-98d80a3c456a.aspx</wfw:comment>
      <wfw:commentRss>http://www.greatestcoder.com/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=54c7de6d-a0ba-448c-95a6-98d80a3c456a</wfw:commentRss>
      <title>Connecting to MSSQL from Ruby in Windows</title>
      <guid isPermaLink="false">http://www.greatestcoder.com/blog/PermaLink,guid,54c7de6d-a0ba-448c-95a6-98d80a3c456a.aspx</guid>
      <link>http://www.greatestcoder.com/blog/2007/09/26/ConnectingToMSSQLFromRubyInWindows.aspx</link>
      <pubDate>Wed, 26 Sep 2007 15:17:42 GMT</pubDate>
      <description>&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;font face=Arial size=2&gt;Here’s the list of thing you have to do in order to connect
to Microsoft SQL Server (tested on 2005) with integrated connection (without any usernames
passwords).&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;
&lt;o:p&gt;
&lt;font face=Arial size=2&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;ol style="MARGIN-TOP: 0cm" type=1&gt;
&lt;li class=MsoNormal style="MARGIN: 0cm 0cm 0pt; mso-list: l0 level1 lfo1; tab-stops: list 36.0pt"&gt;
&lt;font face=Arial size=2&gt;Assuming you have installed &lt;/font&gt;&lt;a href="http://www.rubyonrails.org/"&gt;&lt;font face=Arial size=2&gt;Ruby
on Rails&lt;/font&gt;&lt;/a&gt;&lt;font face=Arial size=2&gt;. Go to &lt;/font&gt;&lt;a href="http://rubyforge.org/projects/ruby-dbi/"&gt;&lt;font face=Arial size=2&gt;Ruby\DBI&lt;/font&gt;&lt;/a&gt;&lt;font face=Arial size=2&gt; and
get the latest release of ruby-dbi package.&lt;/font&gt; 
&lt;li class=MsoNormal style="MARGIN: 0cm 0cm 0pt; mso-list: l0 level1 lfo1; tab-stops: list 36.0pt"&gt;
&lt;font face=Arial size=2&gt;Extract the package to some temporary folder and find file
in directory: \lib\dbd\ADO.rb.&lt;/font&gt; 
&lt;li class=MsoNormal style="MARGIN: 0cm 0cm 0pt; mso-list: l0 level1 lfo1; tab-stops: list 36.0pt"&gt;
&lt;font face=Arial size=2&gt;Go to location of Rails installation (C:\Ruby by default)
and traverse the directory path to: lib\ruby\site_ruby\1.8\DBD\&lt;/font&gt; 
&lt;li class=MsoNormal style="MARGIN: 0cm 0cm 0pt; mso-list: l0 level1 lfo1; tab-stops: list 36.0pt"&gt;
&lt;font size=2&gt;&lt;font face=Arial&gt;&lt;?xml:namespace prefix = st1 ns = "urn:schemas-microsoft-com:office:smarttags" /&gt;Create
a directory 
&lt;st1:City w:st="on"&gt;
&lt;st1:place w:st="on"&gt;ADO&lt;/st1:place&gt;
&lt;/st1:City&gt;
&lt;/font&gt;&lt;/font&gt; 
&lt;li class=MsoNormal style="MARGIN: 0cm 0cm 0pt; mso-list: l0 level1 lfo1; tab-stops: list 36.0pt"&gt;
&lt;font face=Arial size=2&gt;Copy file ADO.rb (from the extracted package) to the newly
created 
&lt;st1:place w:st="on"&gt;
&lt;st1:City w:st="on"&gt;ADO&lt;/st1:City&gt;
&lt;/st1:place&gt;
directory.&lt;/font&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;o:p&gt;
&lt;font face=Arial size=2&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt" align=right&gt;
&lt;img src="http://www.greatestcoder.com/blog/content/binary/Ruby_logo.png" border=0&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;font face=Arial size=2&gt;This configuration will work for all you Rails applications.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;font face=Arial size=2&gt;In order to set up a proper connection to your database from
your application edit config/database.yml file.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;o:p&gt;
&lt;font face=Arial size=2&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;font face=Arial size=2&gt;Here’s the example of what you should input if you use Windows
Authentication.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;o:p&gt;
&lt;font face=Arial size=2&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;font face=Arial size=2&gt;adapter: sqlserver&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;font face=Arial size=2&gt;database: Marcin&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;font face=Arial size=2&gt;username: &lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;font face=Arial size=2&gt;password: &lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;font face=Arial size=2&gt;host: DBI:&lt;st1:place w:st="on"&gt;
&lt;st1:City w:st="on"&gt;ADO&lt;/st1:City&gt;
&lt;/st1:place&gt;
:Provider=SQLOLEDB;Data Source=&lt;i&gt;servername,port&lt;/i&gt;;Initial Catalog=&lt;i&gt;databasename&lt;/i&gt;;Integrated
Security=SSPI;Network=&lt;i&gt;networkname_if_necessary&lt;/i&gt;;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;o:p&gt;
&lt;font face=Arial size=2&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;font face=Arial size=2&gt;Notice, that since we’re using Integrated Security we’re not
leaving username and password blank. This greatly reduces the maintenance of this
configuration file.&lt;/font&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.greatestcoder.com/blog/aggbug.ashx?id=54c7de6d-a0ba-448c-95a6-98d80a3c456a" /&gt;</description>
      <comments>http://www.greatestcoder.com/blog/CommentView,guid,54c7de6d-a0ba-448c-95a6-98d80a3c456a.aspx</comments>
      <category>Ruby</category>
    </item>
    <item>
      <trackback:ping>http://www.greatestcoder.com/blog/Trackback.aspx?guid=84604783-42b3-4d54-905e-59c2257068be</trackback:ping>
      <pingback:server>http://www.greatestcoder.com/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.greatestcoder.com/blog/PermaLink,guid,84604783-42b3-4d54-905e-59c2257068be.aspx</pingback:target>
      <dc:creator>Marcin Waligora</dc:creator>
      <wfw:comment>http://www.greatestcoder.com/blog/CommentView,guid,84604783-42b3-4d54-905e-59c2257068be.aspx</wfw:comment>
      <wfw:commentRss>http://www.greatestcoder.com/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=84604783-42b3-4d54-905e-59c2257068be</wfw:commentRss>
      <title>Vista Battery Saver</title>
      <guid isPermaLink="false">http://www.greatestcoder.com/blog/PermaLink,guid,84604783-42b3-4d54-905e-59c2257068be.aspx</guid>
      <link>http://www.greatestcoder.com/blog/2007/09/18/VistaBatterySaver.aspx</link>
      <pubDate>Tue, 18 Sep 2007 12:34:30 GMT</pubDate>
      <description>&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;font face=Arial size=2&gt;&lt;?xml:namespace prefix = st1 ns = "urn:schemas-microsoft-com:office:smarttags" /&gt;If
you’re a 
&lt;st1:place w:st="on"&gt;Vista laptop&lt;/st1:place&gt;
&amp;nbsp;owner you definitely want this application installed on your machine.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;font face=Arial size=2&gt;It’s a &lt;/font&gt;&lt;a href="http://www.codeplex.com/vistabattery/Release/ProjectReleases.aspx?ReleaseId=6522"&gt;&lt;font face=Arial size=2&gt;Vista
Battery Saver&lt;/font&gt;&lt;/a&gt;&lt;font face=Arial size=2&gt; !&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;
&lt;o:p&gt;
&lt;font face=Arial size=2&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;&lt;?xml:namespace prefix = v ns = "urn:schemas-microsoft-com:vml" /&gt;
&lt;v:shapetype id=_x0000_t75 stroked="f" filled="f" path="m@4@5l@4@11@9@11@9@5xe" o:preferrelative="t" o:spt="75" coordsize="21600,21600"&gt;
&lt;v:stroke joinstyle="miter"&gt;&lt;/v:stroke&gt;
&lt;v:formulas&gt;
&lt;v:f eqn="if lineDrawn pixelLineWidth 0"&gt;&lt;/v:f&gt;
&lt;v:f eqn="sum @0 1 0"&gt;&lt;/v:f&gt;
&lt;v:f eqn="sum 0 0 @1"&gt;&lt;/v:f&gt;
&lt;v:f eqn="prod @2 1 2"&gt;&lt;/v:f&gt;
&lt;v:f eqn="prod @3 21600 pixelWidth"&gt;&lt;/v:f&gt;
&lt;v:f eqn="prod @3 21600 pixelHeight"&gt;&lt;/v:f&gt;
&lt;v:f eqn="sum @0 0 1"&gt;&lt;/v:f&gt;
&lt;v:f eqn="prod @6 1 2"&gt;&lt;/v:f&gt;
&lt;v:f eqn="prod @7 21600 pixelWidth"&gt;&lt;/v:f&gt;
&lt;v:f eqn="sum @8 21600 0"&gt;&lt;/v:f&gt;
&lt;v:f eqn="prod @7 21600 pixelHeight"&gt;&lt;/v:f&gt;
&lt;v:f eqn="sum @10 21600 0"&gt;&lt;/v:f&gt;
&lt;/v:formulas&gt;
&lt;v:path o:connecttype="rect" gradientshapeok="t" o:extrusionok="f"&gt;&lt;/v:path&gt;
&lt;o:lock aspectratio="t" v:ext="edit"&gt;&lt;/o:lock&gt;
&lt;/v:shapetype&gt;
&amp;nbsp; &lt;a href="http://www.codeplex.com/vistabattery"&gt;&lt;img src="http://www.greatestcoder.com/blog/content/binary/battery.png" border=0&gt; &lt;/a&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;font face=Arial size=2&gt;&lt;/font&gt;&amp;nbsp;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;font face=Arial size=2&gt;What it does, is when you switch from A/C to batter it will
disable Sidebar and Aero (all of this is of course configurable). I can squeeze out
over 40 minutes more of battery time with this little application. Also, this is and
open source project written in C#. Here’s the &lt;/font&gt;&lt;a href="http://www.codeplex.com/vistabattery/SourceControl/DownloadSourceCode.aspx?changeSetId=5058"&gt;&lt;font face=Arial size=2&gt;code&lt;/font&gt;&lt;/a&gt;&lt;font face=Arial size=2&gt;.
It’s a very interesting read.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;font face=Arial size=2&gt;Hope it helps.&lt;/font&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.greatestcoder.com/blog/aggbug.ashx?id=84604783-42b3-4d54-905e-59c2257068be" /&gt;</description>
      <comments>http://www.greatestcoder.com/blog/CommentView,guid,84604783-42b3-4d54-905e-59c2257068be.aspx</comments>
      <category>Other</category>
      <category>Tools</category>
    </item>
    <item>
      <trackback:ping>http://www.greatestcoder.com/blog/Trackback.aspx?guid=1ceebefd-a4ef-4386-98a0-88915c615622</trackback:ping>
      <pingback:server>http://www.greatestcoder.com/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.greatestcoder.com/blog/PermaLink,guid,1ceebefd-a4ef-4386-98a0-88915c615622.aspx</pingback:target>
      <dc:creator>Marcin Waligora</dc:creator>
      <wfw:comment>http://www.greatestcoder.com/blog/CommentView,guid,1ceebefd-a4ef-4386-98a0-88915c615622.aspx</wfw:comment>
      <wfw:commentRss>http://www.greatestcoder.com/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=1ceebefd-a4ef-4386-98a0-88915c615622</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
        </p>
        <p style="MARGIN-BOTTOM: 0cm">
Below are two quick tips for testing non public classes and methods. I am not saying
that it is a best practice to test your non public methods (usually indicates that
there is something wrong with the design), but sometimes you just have to do it :).
</p>
        <p style="MARGIN-BOTTOM: 0cm">
          <br />
        </p>
        <p style="MARGIN-BOTTOM: 0cm">
          <b>Testing internal classes:</b>
        </p>
        <p style="MARGIN-BOTTOM: 0cm">
          <br />
        </p>
        <p style="MARGIN-BOTTOM: 0cm">
          <br />
        </p>
        <ol>
          <li>
            <p style="MARGIN-BOTTOM: 0cm">
Right click your test assembly.
</p>
          </li>
        </ol>
        <p style="MARGIN-BOTTOM: 0cm">
          <img src="http://www.greatestcoder.com/blog/content/binary/blogpic1.png" border="0" />
        </p>
        <p style="MARGIN-BOTTOM: 0cm">
 
</p>
        <p style="MARGIN-BOTTOM: 0cm">
2.Select a file
</p>
        <p style="MARGIN-BOTTOM: 0cm">
3.Instead of clicking Add, select 'Add as Link'.
</p>
        <p style="MARGIN-BOTTOM: 0cm">
 
</p>
        <p style="MARGIN-BOTTOM: 0cm">
          <img src="http://www.greatestcoder.com/blog/content/binary/blogpic2.png" border="0" />
          <br />
        </p>
        <p style="MARGIN-BOTTOM: 0cm">
          <br />
        </p>
        <p style="MARGIN-BOTTOM: 0cm">
Next, comes up <b>testing non public methods:</b></p>
        <p style="MARGIN-BOTTOM: 0cm">
          <br />
        </p>
        <p style="MARGIN-BOTTOM: 0cm">
The code below uses <a href="http://www.mbunit.com/">MbUnit</a> testing framework
(much better then <a href="http://www.nunit.org/">NUnit</a>). <a href="http://www.mbunit.com/">MbUnit</a> has
a class called Reflector which allows you to test non public fields, properties and
methods. The only problem with this is the same one I have with many of the mocking
frameworks: all of the names of properties and methods must be passed as strings,
therefore there is no compile time validation. But hey, you can't have everything.
:)
</p>
        <p style="MARGIN-BOTTOM: 0cm">
          <br />
        </p>
        <p style="MARGIN-BOTTOM: 0cm">
          <font size="3">
            <span lang="">
              <font color="#0000ff">internal</font>
              <font color="#000000">
              </font>
              <font color="#0000ff">class</font>
              <font color="#000000">
              </font>
              <font color="#2b91af">ItemProcessor</font>
            </span>
          </font>
        </p>
        <p style="MARGIN-BOTTOM: 0cm">
          <font size="3">
            <span lang="">
              <font color="#000000">{</font>
            </span>
          </font>
        </p>
        <p lang="" style="MARGIN-BOTTOM: 0cm">
          <font color="#000000">
            <font size="3">
              <font color="#0000ff">      public</font> ItemProcessor
(<font color="#2b91af">List</font>&lt;<font color="#2b91af">ItemAttributeRiskFactor</font>&gt;
attributeRiskFactors)</font>
          </font>
        </p>
        <p lang="" style="MARGIN-BOTTOM: 0cm">
          <font color="#000000">
            <font size="3">      {<span>....}</span></font>
          </font>
        </p>
        <p lang="" style="MARGIN-BOTTOM: 0cm">
          <font color="#000000">
            <font size="3">.......</font>
          </font>
        </p>
        <p lang="" style="MARGIN-BOTTOM: 0cm">
          <font color="#000000">
            <font size="3">.......</font>
          </font>
        </p>
        <p lang="" style="MARGIN-BOTTOM: 0cm">
          <br />
        </p>
        <p lang="" style="MARGIN-BOTTOM: 0cm">
          <font color="#000000">
            <font size="3">
              <font color="#0000ff">      private</font>
              <font color="#0000ff">bool</font> CheckIfItemAttributeRiskFactorCorrespondsToItemAttibute(<font color="#2b91af">ItemAttributeRiskFactor</font> risk,</font>
          </font>
        </p>
        <p style="MARGIN-BOTTOM: 0cm">
          <font color="#000000">
            <font size="3">
              <span lang="">
              </span>
            </font>
            <font color="#2b91af">                                                                                                                        ItemAttribute</font>
            <font color="#000000"> attribute)</font>
          </font>
        </p>
        <p lang="" style="MARGIN-BOTTOM: 0cm">
          <font color="#000000">
            <font size="3">      {</font>
          </font>
        </p>
        <p style="MARGIN-BOTTOM: 0cm">
          <font size="3">
            <span lang="">
              <font color="#000000">
              </font>
              <font color="#0000ff">            if</font>
              <font color="#000000"> (risk.AttributeId
== attribute.Id &amp;&amp;</font>
            </span>
          </font>
        </p>
        <p lang="" style="MARGIN-BOTTOM: 0cm">
          <font color="#000000">
            <font size="3">               risk.AttributeValue
== attribute.AttributeValue)</font>
          </font>
        </p>
        <p style="MARGIN-BOTTOM: 0cm">
          <font color="#000000">
            <font size="3">
              <span lang="">
              </span>
            </font>
            <font color="#0000ff">                     return</font>
            <font color="#000000">
            </font>
            <font color="#0000ff">true</font>
            <font color="#000000">;</font>
          </font>
        </p>
        <p style="MARGIN-BOTTOM: 0cm">
          <font size="3">
            <span lang="">
              <font color="#000000">
              </font>
              <font color="#0000ff">            return</font>
              <font color="#000000">
              </font>
              <font color="#0000ff">false</font>
              <font color="#000000">;</font>
            </span>
          </font>
        </p>
        <p lang="" style="MARGIN-BOTTOM: 0cm">
          <font color="#000000">
            <font size="3">      }</font>
          </font>
        </p>
        <p lang="" style="MARGIN-BOTTOM: 0cm">
          <font color="#000000">
            <font size="3">  }</font>
          </font>
        </p>
        <p style="MARGIN-BOTTOM: 0cm">
          <br />
        </p>
        <p style="MARGIN-BOTTOM: 0cm">
The above code, is from one of my pet projects so you must forgive me that you don't
understand what the class does. The important thing is that the class has private
method that I want to test.
</p>
        <p style="MARGIN-BOTTOM: 0cm">
Below is the test code.
</p>
        <p style="MARGIN-BOTTOM: 0cm">
          <br />
        </p>
        <p style="MARGIN-BOTTOM: 0cm">
          <br />
        </p>
        <p style="MARGIN-BOTTOM: 0cm">
          <font size="3">
            <span lang="">
              <font color="#0000ff">using</font>
              <font color="#000000"> MbUnit.Framework;</font>
            </span>
          </font>
        </p>
        <p style="MARGIN-BOTTOM: 0cm">
          <font size="3">
            <span lang="">
              <font color="#0000ff">using</font>
              <font color="#000000"> MbUnit.Framework.Reflection;</font>
            </span>
          </font>
        </p>
        <p lang="" style="MARGIN-BOTTOM: 0cm">
          <br />
        </p>
        <p lang="" style="MARGIN-BOTTOM: 0cm">
          <font color="#000000">
            <font size="3">[<font color="#2b91af">TestFixture</font>]</font>
          </font>
        </p>
        <p style="MARGIN-BOTTOM: 0cm">
          <font color="#000000">
          </font>
          <font size="3">
            <span lang="">
              <font color="#0000ff">class</font>
              <font color="#000000">
              </font>
              <font color="#2b91af">ItemProcessorFixture</font>
            </span>
          </font>
        </p>
        <p lang="" style="MARGIN-BOTTOM: 0cm">
          <font color="#000000">
            <font size="3">{</font>
          </font>
        </p>
        <p style="MARGIN-BOTTOM: 0cm">
          <font color="#000000">
          </font>
          <font size="3">
            <b>
              <span lang="">
                <font color="#0000ff">   private</font>
                <font color="#000000">
                </font>
                <font color="#2b91af">Reflector</font>
                <font color="#000000"> reflector;</font>
              </span>
            </b>
          </font>
        </p>
        <p style="MARGIN-BOTTOM: 0cm">
          <font color="#000000">
          </font>
          <font size="3">
            <span lang="">
              <font color="#0000ff">   private</font>
              <font color="#000000">
              </font>
              <font color="#2b91af">ItemAttribute</font>
              <font color="#000000"> attribute;</font>
            </span>
          </font>
        </p>
        <p style="MARGIN-BOTTOM: 0cm">
          <font color="#000000">
          </font>
          <font size="3">
            <span lang="">
              <font color="#0000ff">   private</font>
              <font color="#000000">
              </font>
              <font color="#2b91af">ItemAttributeRiskFactor</font>
              <font color="#000000"> risk;</font>
            </span>
          </font>
        </p>
        <p lang="" style="MARGIN-BOTTOM: 0cm">
          <br />
        </p>
        <p style="MARGIN-BOTTOM: 0cm">
          <font color="#000000">
            <font size="3">
              <span lang="">   [
</span>
            </font>
            <font color="#2b91af">TestFixtureSetUp</font>
            <font color="#000000">]</font>
          </font>
        </p>
        <p style="MARGIN-BOTTOM: 0cm">
          <font color="#000000">
          </font>
          <font size="3">
            <span lang="">
              <font color="#0000ff">   public</font>
              <font color="#000000">
              </font>
              <font color="#0000ff">void</font>
              <font color="#000000"> FixtureSetup()</font>
            </span>
          </font>
        </p>
        <p lang="" style="MARGIN-BOTTOM: 0cm">
          <font color="#000000">
            <font size="3">   {</font>
          </font>
        </p>
        <p style="MARGIN-BOTTOM: 0cm">
          <font color="#000000">
            <font size="3">
              <span lang="">         ItemProcessor
processor = 
</span>
            </font>
            <font color="#0000ff">new</font>
            <font color="#000000"> ItemProcessor(</font>
            <font color="#0000ff">new</font>
            <font color="#000000">
            </font>
            <font color="#2b91af">List</font>
            <font color="#000000">&lt;</font>
            <font color="#2b91af">ItemAttributeRiskFactor</font>
            <font color="#000000">&gt;());</font>
          </font>
        </p>
        <p style="MARGIN-BOTTOM: 0cm">
          <font color="#000000">
            <font size="3">
              <b>
                <span lang="">         reflector
= 
</span>
              </b>
            </font>
            <font color="#0000ff">new</font>
            <font color="#000000">
            </font>
            <font color="#2b91af">Reflector</font>
            <font color="#000000">(processor);</font>
          </font>
        </p>
        <p lang="" style="MARGIN-BOTTOM: 0cm">
          <font color="#000000">
            <font size="3">   }</font>
          </font>
        </p>
        <p lang="" style="MARGIN-BOTTOM: 0cm">
          <br />
        </p>
        <p style="MARGIN-BOTTOM: 0cm">
          <font color="#000000">
            <font size="3">
              <span lang="">   [
</span>
            </font>
            <font color="#2b91af">SetUp</font>
            <font color="#000000">]</font>
          </font>
        </p>
        <p style="MARGIN-BOTTOM: 0cm">
          <font color="#000000">
          </font>
          <font size="3">
            <span lang="">
              <font color="#0000ff">   public</font>
              <font color="#000000">
              </font>
              <font color="#0000ff">void</font>
              <font color="#000000"> TestSetup()</font>
            </span>
          </font>
        </p>
        <p lang="" style="MARGIN-BOTTOM: 0cm">
          <font color="#000000">
            <font size="3">   {</font>
          </font>
        </p>
        <p style="MARGIN-BOTTOM: 0cm">
          <font color="#000000">
            <font size="3">
              <span lang="">         attribute
= 
</span>
            </font>
            <font color="#0000ff">new</font>
            <font color="#000000">
            </font>
            <font color="#2b91af">ItemAttribute</font>
            <font color="#000000">();</font>
          </font>
        </p>
        <p style="MARGIN-BOTTOM: 0cm">
          <font color="#000000">
            <font size="3">
              <span lang="">         risk
= 
</span>
            </font>
            <font color="#0000ff">new</font>
            <font color="#000000">
            </font>
            <font color="#2b91af">ItemAttributeRiskFactor</font>
            <font color="#000000">(4, </font>
            <font color="#a31515">"HIGH"</font>
            <font color="#000000">,
50, </font>
            <font color="#0000ff">false</font>
            <font color="#000000">);</font>
          </font>
        </p>
        <p lang="" style="MARGIN-BOTTOM: 0cm">
          <font color="#000000">
            <font size="3">   }</font>
          </font>
        </p>
        <p lang="" style="MARGIN-BOTTOM: 0cm">
          <br />
        </p>
        <p lang="" style="MARGIN-BOTTOM: 0cm">
          <font color="#000000">
            <font size="3">   [Test]</font>
          </font>
        </p>
        <p style="MARGIN-BOTTOM: 0cm">
          <font size="3">
            <span lang="">
              <font color="#0000ff">   public</font>
              <font color="#000000">
              </font>
              <font color="#0000ff">void</font>
              <font color="#000000"> ItemAttributeAndItemAttributeRiskFactorShouldCorrespond()</font>
            </span>
          </font>
        </p>
        <p lang="" style="MARGIN-BOTTOM: 0cm">
          <font color="#000000">
            <font size="3">   {</font>
          </font>
        </p>
        <p lang="" style="MARGIN-BOTTOM: 0cm">
          <font color="#000000">
            <font size="3">         attribute.Id
= 4;</font>
          </font>
        </p>
        <p style="MARGIN-BOTTOM: 0cm">
          <font color="#000000">
            <font size="3">
              <span lang="">         attribute.AttributeValue
= 
</span>
            </font>
            <font color="#a31515">"HIGH"</font>
            <font color="#000000">;</font>
          </font>
        </p>
        <p lang="" style="MARGIN-BOTTOM: 0cm">
          <br />
        </p>
        <p style="MARGIN-BOTTOM: 0cm">
          <font color="#000000">
          </font>
          <font size="3">
            <span lang="">
              <font color="#2b91af">         Assert</font>
              <font color="#000000">.IsTrue((</font>
              <font color="#0000ff">bool</font>
              <font color="#000000">)<b>reflector.InvokeMethod(</b></font>
            </span>
          </font>
        </p>
        <p style="MARGIN-BOTTOM: 0cm">
          <font color="#000000">
          </font>
          <font size="3">
            <span lang="">
              <b>
                <font color="#a31515">                     "CheckIfItemAttributeRiskFactorCorrespondsToItemAttibute"</font>
                <font color="#000000">,
risk, attribute)</font>
              </b>
              <font color="#000000">);</font>
            </span>
          </font>
        </p>
        <p lang="" style="MARGIN-BOTTOM: 0cm">
          <font color="#000000">
            <font size="3">      }</font>
          </font>
        </p>
        <p lang="" style="MARGIN-BOTTOM: 0cm">
          <font color="#000000">
            <font size="3">   }</font>
          </font>
        </p>
        <p style="MARGIN-BOTTOM: 0cm">
          <br />
        </p>
        <p style="MARGIN-BOTTOM: 0cm">
The interesting part of the code are in bold. We use MbUnit's Reflector class to test
private method of the ItemProcessor class. Furthermore, the Reflector allows us to
set and get fields and properties. 
</p>
        <p style="MARGIN-BOTTOM: 0cm">
Overall, while it isn't a perfect way to test non public methods, it sure is better
then not testing them at all :).
</p>
        <img width="0" height="0" src="http://www.greatestcoder.com/blog/aggbug.ashx?id=1ceebefd-a4ef-4386-98a0-88915c615622" />
      </body>
      <title>Testing internal classes and non public methods</title>
      <guid isPermaLink="false">http://www.greatestcoder.com/blog/PermaLink,guid,1ceebefd-a4ef-4386-98a0-88915c615622.aspx</guid>
      <link>http://www.greatestcoder.com/blog/2007/08/29/TestingInternalClassesAndNonPublicMethods.aspx</link>
      <pubDate>Wed, 29 Aug 2007 15:42:36 GMT</pubDate>
      <description>&lt;p&gt;
&lt;/p&gt;
&lt;p style="MARGIN-BOTTOM: 0cm"&gt;
Below are two quick tips for testing non public classes and methods. I am not saying
that it is a best practice to test your non public methods (usually indicates that
there is something wrong with the design), but sometimes you just have to do it :).
&lt;/p&gt;
&lt;p style="MARGIN-BOTTOM: 0cm"&gt;
&lt;br&gt;
&lt;/p&gt;
&lt;p style="MARGIN-BOTTOM: 0cm"&gt;
&lt;b&gt;Testing internal classes:&lt;/b&gt;
&lt;/p&gt;
&lt;p style="MARGIN-BOTTOM: 0cm"&gt;
&lt;br&gt;
&lt;/p&gt;
&lt;p style="MARGIN-BOTTOM: 0cm"&gt;
&lt;br&gt;
&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p style="MARGIN-BOTTOM: 0cm"&gt;
Right click your test assembly.
&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p style="MARGIN-BOTTOM: 0cm"&gt;
&lt;img src="http://www.greatestcoder.com/blog/content/binary/blogpic1.png" border=0&gt;
&lt;/p&gt;
&lt;p style="MARGIN-BOTTOM: 0cm"&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p style="MARGIN-BOTTOM: 0cm"&gt;
2.Select a file
&lt;/p&gt;
&lt;p style="MARGIN-BOTTOM: 0cm"&gt;
3.Instead of clicking Add, select 'Add as Link'.
&lt;/p&gt;
&lt;p style="MARGIN-BOTTOM: 0cm"&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p style="MARGIN-BOTTOM: 0cm"&gt;
&lt;img src="http://www.greatestcoder.com/blog/content/binary/blogpic2.png" border=0&gt;
&lt;br&gt;
&lt;/p&gt;
&lt;p style="MARGIN-BOTTOM: 0cm"&gt;
&lt;br&gt;
&lt;/p&gt;
&lt;p style="MARGIN-BOTTOM: 0cm"&gt;
Next, comes up &lt;b&gt;testing non public methods:&lt;/b&gt;
&lt;/p&gt;
&lt;p style="MARGIN-BOTTOM: 0cm"&gt;
&lt;br&gt;
&lt;/p&gt;
&lt;p style="MARGIN-BOTTOM: 0cm"&gt;
The code below uses &lt;a href="http://www.mbunit.com/"&gt;MbUnit&lt;/a&gt; testing framework
(much better then &lt;a href="http://www.nunit.org/"&gt;NUnit&lt;/a&gt;). &lt;a href="http://www.mbunit.com/"&gt;MbUnit&lt;/a&gt; has
a class called Reflector which allows you to test non public fields, properties and
methods. The only problem with this is the same one I have with many of the mocking
frameworks: all of the names of properties and methods must be passed as strings,
therefore there is no compile time validation. But hey, you can't have everything.
:)
&lt;/p&gt;
&lt;p style="MARGIN-BOTTOM: 0cm"&gt;
&lt;br&gt;
&lt;/p&gt;
&lt;p style="MARGIN-BOTTOM: 0cm"&gt;
&lt;font size=3&gt;&lt;span lang=""&gt;&lt;font color=#0000ff&gt;internal&lt;/font&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;font color=#0000ff&gt;class&lt;/font&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;font color=#2b91af&gt;ItemProcessor&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p style="MARGIN-BOTTOM: 0cm"&gt;
&lt;font size=3&gt;&lt;span lang=""&gt;&lt;font color=#000000&gt;{&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p lang="" style="MARGIN-BOTTOM: 0cm"&gt;
&lt;font color=#000000&gt;&lt;font size=3&gt;&lt;font color=#0000ff&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;public&lt;/font&gt; ItemProcessor
(&lt;font color=#2b91af&gt;List&lt;/font&gt;&amp;lt;&lt;font color=#2b91af&gt;ItemAttributeRiskFactor&lt;/font&gt;&amp;gt;
attributeRiskFactors)&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p lang="" style="MARGIN-BOTTOM: 0cm"&gt;
&lt;font color=#000000&gt;&lt;font size=3&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;span&gt;....}&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p lang="" style="MARGIN-BOTTOM: 0cm"&gt;
&lt;font color=#000000&gt;&lt;font size=3&gt;.......&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p lang="" style="MARGIN-BOTTOM: 0cm"&gt;
&lt;font color=#000000&gt;&lt;font size=3&gt;.......&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p lang="" style="MARGIN-BOTTOM: 0cm"&gt;
&lt;br&gt;
&lt;/p&gt;
&lt;p lang="" style="MARGIN-BOTTOM: 0cm"&gt;
&lt;font color=#000000&gt;&lt;font size=3&gt;&lt;font color=#0000ff&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;private&lt;/font&gt; &lt;font color=#0000ff&gt;bool&lt;/font&gt; CheckIfItemAttributeRiskFactorCorrespondsToItemAttibute(&lt;font color=#2b91af&gt;ItemAttributeRiskFactor&lt;/font&gt; risk,&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p style="MARGIN-BOTTOM: 0cm"&gt;
&lt;font color=#000000&gt;&lt;font size=3&gt;&lt;span lang=""&gt;
&lt;/font&gt;&lt;font color=#2b91af&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ItemAttribute&lt;/font&gt;&lt;font color=#000000&gt; attribute)&lt;/font&gt;&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p lang="" style="MARGIN-BOTTOM: 0cm"&gt;
&lt;font color=#000000&gt;&lt;font size=3&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p style="MARGIN-BOTTOM: 0cm"&gt;
&lt;font size=3&gt;&lt;span lang=""&gt;&lt;font color=#000000&gt;&lt;/font&gt;&lt;font color=#0000ff&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if&lt;/font&gt;&lt;font color=#000000&gt; (risk.AttributeId
== attribute.Id &amp;amp;&amp;amp;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p lang="" style="MARGIN-BOTTOM: 0cm"&gt;
&lt;font color=#000000&gt;&lt;font size=3&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;risk.AttributeValue
== attribute.AttributeValue)&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p style="MARGIN-BOTTOM: 0cm"&gt;
&lt;font color=#000000&gt;&lt;font size=3&gt;&lt;span lang=""&gt;
&lt;/font&gt;&lt;font color=#0000ff&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return&lt;/font&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;font color=#0000ff&gt;true&lt;/font&gt;&lt;font color=#000000&gt;;&lt;/font&gt;&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p style="MARGIN-BOTTOM: 0cm"&gt;
&lt;font size=3&gt;&lt;span lang=""&gt;&lt;font color=#000000&gt;&lt;/font&gt;&lt;font color=#0000ff&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return&lt;/font&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;font color=#0000ff&gt;false&lt;/font&gt;&lt;font color=#000000&gt;;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p lang="" style="MARGIN-BOTTOM: 0cm"&gt;
&lt;font color=#000000&gt;&lt;font size=3&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p lang="" style="MARGIN-BOTTOM: 0cm"&gt;
&lt;font color=#000000&gt;&lt;font size=3&gt;&amp;nbsp;&amp;nbsp;}&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p style="MARGIN-BOTTOM: 0cm"&gt;
&lt;br&gt;
&lt;/p&gt;
&lt;p style="MARGIN-BOTTOM: 0cm"&gt;
The above code, is from one of my pet projects so you must forgive me that you don't
understand what the class does. The important thing is that the class has private
method that I want to test.
&lt;/p&gt;
&lt;p style="MARGIN-BOTTOM: 0cm"&gt;
Below is the test code.
&lt;/p&gt;
&lt;p style="MARGIN-BOTTOM: 0cm"&gt;
&lt;br&gt;
&lt;/p&gt;
&lt;p style="MARGIN-BOTTOM: 0cm"&gt;
&lt;br&gt;
&lt;/p&gt;
&lt;p style="MARGIN-BOTTOM: 0cm"&gt;
&lt;font size=3&gt;&lt;span lang=""&gt;&lt;font color=#0000ff&gt;using&lt;/font&gt;&lt;font color=#000000&gt; MbUnit.Framework;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p style="MARGIN-BOTTOM: 0cm"&gt;
&lt;font size=3&gt;&lt;span lang=""&gt;&lt;font color=#0000ff&gt;using&lt;/font&gt;&lt;font color=#000000&gt; MbUnit.Framework.Reflection;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p lang="" style="MARGIN-BOTTOM: 0cm"&gt;
&lt;br&gt;
&lt;/p&gt;
&lt;p lang="" style="MARGIN-BOTTOM: 0cm"&gt;
&lt;font color=#000000&gt;&lt;font size=3&gt;[&lt;font color=#2b91af&gt;TestFixture&lt;/font&gt;]&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p style="MARGIN-BOTTOM: 0cm"&gt;
&lt;font color=#000000&gt;&lt;/font&gt;&lt;font size=3&gt;&lt;span lang=""&gt;&lt;font color=#0000ff&gt;class&lt;/font&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;font color=#2b91af&gt;ItemProcessorFixture&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p lang="" style="MARGIN-BOTTOM: 0cm"&gt;
&lt;font color=#000000&gt;&lt;font size=3&gt;{&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p style="MARGIN-BOTTOM: 0cm"&gt;
&lt;font color=#000000&gt;&lt;/font&gt;&lt;font size=3&gt;&lt;b&gt;&lt;span lang=""&gt;&lt;font color=#0000ff&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;private&lt;/font&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;font color=#2b91af&gt;Reflector&lt;/font&gt;&lt;font color=#000000&gt; reflector;&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p style="MARGIN-BOTTOM: 0cm"&gt;
&lt;font color=#000000&gt;&lt;/font&gt;&lt;font size=3&gt;&lt;span lang=""&gt;&lt;font color=#0000ff&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;private&lt;/font&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;font color=#2b91af&gt;ItemAttribute&lt;/font&gt;&lt;font color=#000000&gt; attribute;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p style="MARGIN-BOTTOM: 0cm"&gt;
&lt;font color=#000000&gt;&lt;/font&gt;&lt;font size=3&gt;&lt;span lang=""&gt;&lt;font color=#0000ff&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;private&lt;/font&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;font color=#2b91af&gt;ItemAttributeRiskFactor&lt;/font&gt;&lt;font color=#000000&gt; risk;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p lang="" style="MARGIN-BOTTOM: 0cm"&gt;
&lt;br&gt;
&lt;/p&gt;
&lt;p style="MARGIN-BOTTOM: 0cm"&gt;
&lt;font color=#000000&gt;&lt;font size=3&gt;&lt;span lang=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;[
&lt;/font&gt;&lt;font color=#2b91af&gt;TestFixtureSetUp&lt;/font&gt;&lt;font color=#000000&gt;]&lt;/font&gt;&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p style="MARGIN-BOTTOM: 0cm"&gt;
&lt;font color=#000000&gt;&lt;/font&gt;&lt;font size=3&gt;&lt;span lang=""&gt;&lt;font color=#0000ff&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;public&lt;/font&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;font color=#0000ff&gt;void&lt;/font&gt;&lt;font color=#000000&gt; FixtureSetup()&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p lang="" style="MARGIN-BOTTOM: 0cm"&gt;
&lt;font color=#000000&gt;&lt;font size=3&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p style="MARGIN-BOTTOM: 0cm"&gt;
&lt;font color=#000000&gt;&lt;font size=3&gt;&lt;span lang=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ItemProcessor
processor = 
&lt;/font&gt;&lt;font color=#0000ff&gt;new&lt;/font&gt;&lt;font color=#000000&gt; ItemProcessor(&lt;/font&gt;&lt;font color=#0000ff&gt;new&lt;/font&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;font color=#2b91af&gt;List&lt;/font&gt;&lt;font color=#000000&gt;&amp;lt;&lt;/font&gt;&lt;font color=#2b91af&gt;ItemAttributeRiskFactor&lt;/font&gt;&lt;font color=#000000&gt;&amp;gt;());&lt;/font&gt;&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p style="MARGIN-BOTTOM: 0cm"&gt;
&lt;font color=#000000&gt;&lt;font size=3&gt;&lt;b&gt;&lt;span lang=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;reflector
= 
&lt;/font&gt;&lt;font color=#0000ff&gt;new&lt;/font&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;font color=#2b91af&gt;Reflector&lt;/font&gt;&lt;font color=#000000&gt;(processor);&lt;/font&gt;&gt;&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p lang="" style="MARGIN-BOTTOM: 0cm"&gt;
&lt;font color=#000000&gt;&lt;font size=3&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p lang="" style="MARGIN-BOTTOM: 0cm"&gt;
&lt;br&gt;
&lt;/p&gt;
&lt;p style="MARGIN-BOTTOM: 0cm"&gt;
&lt;font color=#000000&gt;&lt;font size=3&gt;&lt;span lang=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;[
&lt;/font&gt;&lt;font color=#2b91af&gt;SetUp&lt;/font&gt;&lt;font color=#000000&gt;]&lt;/font&gt;&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p style="MARGIN-BOTTOM: 0cm"&gt;
&lt;font color=#000000&gt;&lt;/font&gt;&lt;font size=3&gt;&lt;span lang=""&gt;&lt;font color=#0000ff&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;public&lt;/font&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;font color=#0000ff&gt;void&lt;/font&gt;&lt;font color=#000000&gt; TestSetup()&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p lang="" style="MARGIN-BOTTOM: 0cm"&gt;
&lt;font color=#000000&gt;&lt;font size=3&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p style="MARGIN-BOTTOM: 0cm"&gt;
&lt;font color=#000000&gt;&lt;font size=3&gt;&lt;span lang=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;attribute
= 
&lt;/font&gt;&lt;font color=#0000ff&gt;new&lt;/font&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;font color=#2b91af&gt;ItemAttribute&lt;/font&gt;&lt;font color=#000000&gt;();&lt;/font&gt;&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p style="MARGIN-BOTTOM: 0cm"&gt;
&lt;font color=#000000&gt;&lt;font size=3&gt;&lt;span lang=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;risk
= 
&lt;/font&gt;&lt;font color=#0000ff&gt;new&lt;/font&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;font color=#2b91af&gt;ItemAttributeRiskFactor&lt;/font&gt;&lt;font color=#000000&gt;(4, &lt;/font&gt;&lt;font color=#a31515&gt;"HIGH"&lt;/font&gt;&lt;font color=#000000&gt;,
50, &lt;/font&gt;&lt;font color=#0000ff&gt;false&lt;/font&gt;&lt;font color=#000000&gt;);&lt;/font&gt;&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p lang="" style="MARGIN-BOTTOM: 0cm"&gt;
&lt;font color=#000000&gt;&lt;font size=3&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p lang="" style="MARGIN-BOTTOM: 0cm"&gt;
&lt;br&gt;
&lt;/p&gt;
&lt;p lang="" style="MARGIN-BOTTOM: 0cm"&gt;
&lt;font color=#000000&gt;&lt;font size=3&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;[Test]&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p style="MARGIN-BOTTOM: 0cm"&gt;
&lt;font size=3&gt;&lt;span lang=""&gt;&lt;font color=#0000ff&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;public&lt;/font&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;font color=#0000ff&gt;void&lt;/font&gt;&lt;font color=#000000&gt; ItemAttributeAndItemAttributeRiskFactorShouldCorrespond()&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p lang="" style="MARGIN-BOTTOM: 0cm"&gt;
&lt;font color=#000000&gt;&lt;font size=3&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p lang="" style="MARGIN-BOTTOM: 0cm"&gt;
&lt;font color=#000000&gt;&lt;font size=3&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;attribute.Id
= 4;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p style="MARGIN-BOTTOM: 0cm"&gt;
&lt;font color=#000000&gt;&lt;font size=3&gt;&lt;span lang=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;attribute.AttributeValue
= 
&lt;/font&gt;&lt;font color=#a31515&gt;"HIGH"&lt;/font&gt;&lt;font color=#000000&gt;;&lt;/font&gt;&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p lang="" style="MARGIN-BOTTOM: 0cm"&gt;
&lt;br&gt;
&lt;/p&gt;
&lt;p style="MARGIN-BOTTOM: 0cm"&gt;
&lt;font color=#000000&gt;&lt;/font&gt;&lt;font size=3&gt;&lt;span lang=""&gt;&lt;font color=#2b91af&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Assert&lt;/font&gt;&lt;font color=#000000&gt;.IsTrue((&lt;/font&gt;&lt;font color=#0000ff&gt;bool&lt;/font&gt;&lt;font color=#000000&gt;)&lt;b&gt;reflector.InvokeMethod(&lt;/b&gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p style="MARGIN-BOTTOM: 0cm"&gt;
&lt;font color=#000000&gt;&lt;/font&gt;&lt;font size=3&gt;&lt;span lang=""&gt;&lt;b&gt;&lt;font color=#a31515&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;"CheckIfItemAttributeRiskFactorCorrespondsToItemAttibute"&lt;/font&gt;&lt;font color=#000000&gt;,
risk, attribute)&lt;/font&gt;&lt;/b&gt;&lt;font color=#000000&gt;);&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p lang="" style="MARGIN-BOTTOM: 0cm"&gt;
&lt;font color=#000000&gt;&lt;font size=3&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p lang="" style="MARGIN-BOTTOM: 0cm"&gt;
&lt;font color=#000000&gt;&lt;font size=3&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p style="MARGIN-BOTTOM: 0cm"&gt;
&lt;br&gt;
&lt;/p&gt;
&lt;p style="MARGIN-BOTTOM: 0cm"&gt;
The interesting part of the code are in bold. We use MbUnit's Reflector class to test
private method of the ItemProcessor class. Furthermore, the Reflector allows us to
set and get fields and properties. 
&lt;/p&gt;
&lt;p style="MARGIN-BOTTOM: 0cm"&gt;
Overall, while it isn't a perfect way to test non public methods, it sure is better
then not testing them at all :).
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.greatestcoder.com/blog/aggbug.ashx?id=1ceebefd-a4ef-4386-98a0-88915c615622" /&gt;</description>
      <comments>http://www.greatestcoder.com/blog/CommentView,guid,1ceebefd-a4ef-4386-98a0-88915c615622.aspx</comments>
      <category>Testing</category>
      <category>TDD</category>
    </item>
    <item>
      <trackback:ping>http://www.greatestcoder.com/blog/Trackback.aspx?guid=d8b5e1a8-e45b-4819-be83-f166662e83cf</trackback:ping>
      <pingback:server>http://www.greatestcoder.com/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.greatestcoder.com/blog/PermaLink,guid,d8b5e1a8-e45b-4819-be83-f166662e83cf.aspx</pingback:target>
      <dc:creator>Marcin Waligora</dc:creator>
      <wfw:comment>http://www.greatestcoder.com/blog/CommentView,guid,d8b5e1a8-e45b-4819-be83-f166662e83cf.aspx</wfw:comment>
      <wfw:commentRss>http://www.greatestcoder.com/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=d8b5e1a8-e45b-4819-be83-f166662e83cf</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
        </p>
        <p style="MARGIN-BOTTOM: 0cm">
Developing an application that supports plugins is not an easy feat. Below are some
links that will help you start the ball rolling:
</p>
        <p style="MARGIN-BOTTOM: 0cm">
          <img src="http://www.greatestcoder.com/blog/content/binary/553200_plug.jpg" border="0" />
          <br />
        </p>
        <p style="MARGIN-BOTTOM: 0cm">
          <a href="http://www.codeproject.com/cs/library/Net_AddinProjFrmwork.asp">One from
CodeProject. </a>Next one is from <a href="http://weblogs.asp.net/rosherove/"><i>Roy
Osherove</i><span style="TEXT-DECORATION: none"><span style="FONT-STYLE: normal"></span></span></a>on
MSDN. Actually, it has two parts. Part <a href="http://msdn2.microsoft.com/en-us/library/ms972962.aspx">one</a> and <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnaspp/html/searchforplugins.asp">two</a>.
After reading those you will have general idea what you should do. How to start, how
to look for appropriate plugins and so forth. I would like to point out a few things
more you should take into consideration.
</p>
        <p style="MARGIN-BOTTOM: 0cm">
          <br />
        </p>
        <p style="MARGIN-BOTTOM: 0cm">
First of all, what will the communication between the application and other plugins
look like. How and if the plugins send any information to the hosting application.
This of course depends on your applications requirements.
</p>
        <p style="MARGIN-BOTTOM: 0cm">
          <br />
        </p>
        <p style="MARGIN-BOTTOM: 0cm">
Another big one after communication is how will you visually present the plugins.
If they are to be presented in the UI (added to be MainMenu or ContextMenus) the framework
must allow it. Also remember not to pass references to your menus, because plugins
would be able to delete some entries there. Rather allow a plugin to specify location
and items that should be added to menus. This will be safer. (When returning those
objects the plugin should already have attached the required event handlers).
</p>
        <p style="MARGIN-BOTTOM: 0cm">
          <br />
        </p>
        <p style="MARGIN-BOTTOM: 0cm">
Exception handling is also very important. How will you act when your plugin will
throw an unhandled exception? Will the whole application crash or will it report gracefully
that there was a problem with a certain plugin? For WinForms development there are
two events you should register to: <a href="http://msdn2.microsoft.com/en-us/library/system.windows.forms.application.threadexception.aspx">Application.ThreadException</a></p>
        <p style="MARGIN-BOTTOM: 0cm">
          <a href="http://msdn2.microsoft.com/en-us/library/system.appdomain.unhandledexception.aspx">AppDomain.UnhandledException</a>.
</p>
        <p style="MARGIN-BOTTOM: 0cm">
          <br />
        </p>
        <p style="MARGIN-BOTTOM: 0cm">
          <br />
        </p>
        <p style="MARGIN-BOTTOM: 0cm">
On the final note, there is <a href="http://www.dnrtv.com/default.aspx?showNum=34">dnrTV
Show </a>on plugins in .NET. Be sure to watch it.
</p>
        <img width="0" height="0" src="http://www.greatestcoder.com/blog/aggbug.ashx?id=d8b5e1a8-e45b-4819-be83-f166662e83cf" />
      </body>
      <title>Plugin framework for WinForms in .NET</title>
      <guid isPermaLink="false">http://www.greatestcoder.com/blog/PermaLink,guid,d8b5e1a8-e45b-4819-be83-f166662e83cf.aspx</guid>
      <link>http://www.greatestcoder.com/blog/2007/08/09/PluginFrameworkForWinFormsInNET.aspx</link>
      <pubDate>Thu, 09 Aug 2007 14:32:09 GMT</pubDate>
      <description>&lt;p&gt;
&lt;/p&gt;
&lt;p style="MARGIN-BOTTOM: 0cm"&gt;
Developing an application that supports plugins is not an easy feat. Below are some
links that will help you start the ball rolling:
&lt;/p&gt;
&lt;p style="MARGIN-BOTTOM: 0cm"&gt;
&lt;img src="http://www.greatestcoder.com/blog/content/binary/553200_plug.jpg" border=0&gt;
&lt;br&gt;
&lt;/p&gt;
&lt;p style="MARGIN-BOTTOM: 0cm"&gt;
&lt;a href="http://www.codeproject.com/cs/library/Net_AddinProjFrmwork.asp"&gt;One from
CodeProject. &lt;/a&gt;Next one is from &lt;a href="http://weblogs.asp.net/rosherove/"&gt;&lt;i&gt;Roy
Osherove&lt;/i&gt;&lt;span style="TEXT-DECORATION: none"&gt;&lt;span style="FONT-STYLE: normal"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/a&gt;on
MSDN. Actually, it has two parts. Part &lt;a href="http://msdn2.microsoft.com/en-us/library/ms972962.aspx"&gt;one&lt;/a&gt; and &lt;a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnaspp/html/searchforplugins.asp"&gt;two&lt;/a&gt;.
After reading those you will have general idea what you should do. How to start, how
to look for appropriate plugins and so forth. I would like to point out a few things
more you should take into consideration.
&lt;/p&gt;
&lt;p style="MARGIN-BOTTOM: 0cm"&gt;
&lt;br&gt;
&lt;/p&gt;
&lt;p style="MARGIN-BOTTOM: 0cm"&gt;
First of all, what will the communication between the application and other plugins
look like. How and if the plugins send any information to the hosting application.
This of course depends on your applications requirements.
&lt;/p&gt;
&lt;p style="MARGIN-BOTTOM: 0cm"&gt;
&lt;br&gt;
&lt;/p&gt;
&lt;p style="MARGIN-BOTTOM: 0cm"&gt;
Another big one after communication is how will you visually present the plugins.
If they are to be presented in the UI (added to be MainMenu or ContextMenus) the framework
must allow it. Also remember not to pass references to your menus, because plugins
would be able to delete some entries there. Rather allow a plugin to specify location
and items that should be added to menus. This will be safer. (When returning those
objects the plugin should already have attached the required event handlers).
&lt;/p&gt;
&lt;p style="MARGIN-BOTTOM: 0cm"&gt;
&lt;br&gt;
&lt;/p&gt;
&lt;p style="MARGIN-BOTTOM: 0cm"&gt;
Exception handling is also very important. How will you act when your plugin will
throw an unhandled exception? Will the whole application crash or will it report gracefully
that there was a problem with a certain plugin? For WinForms development there are
two events you should register to: &lt;a href="http://msdn2.microsoft.com/en-us/library/system.windows.forms.application.threadexception.aspx"&gt;Application.ThreadException&lt;/a&gt;
&lt;/p&gt;
&lt;p style="MARGIN-BOTTOM: 0cm"&gt;
&lt;a href="http://msdn2.microsoft.com/en-us/library/system.appdomain.unhandledexception.aspx"&gt;AppDomain.UnhandledException&lt;/a&gt;.
&lt;/p&gt;
&lt;p style="MARGIN-BOTTOM: 0cm"&gt;
&lt;br&gt;
&lt;/p&gt;
&lt;p style="MARGIN-BOTTOM: 0cm"&gt;
&lt;br&gt;
&lt;/p&gt;
&lt;p style="MARGIN-BOTTOM: 0cm"&gt;
On the final note, there is &lt;a href="http://www.dnrtv.com/default.aspx?showNum=34"&gt;dnrTV
Show &lt;/a&gt;on plugins in .NET. Be sure to watch it.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.greatestcoder.com/blog/aggbug.ashx?id=d8b5e1a8-e45b-4819-be83-f166662e83cf" /&gt;</description>
      <comments>http://www.greatestcoder.com/blog/CommentView,guid,d8b5e1a8-e45b-4819-be83-f166662e83cf.aspx</comments>
      <category>Other</category>
    </item>
    <item>
      <trackback:ping>http://www.greatestcoder.com/blog/Trackback.aspx?guid=005d9ac4-224a-46fc-a257-eedd69085326</trackback:ping>
      <pingback:server>http://www.greatestcoder.com/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.greatestcoder.com/blog/PermaLink,guid,005d9ac4-224a-46fc-a257-eedd69085326.aspx</pingback:target>
      <dc:creator>Marcin Waligora</dc:creator>
      <wfw:comment>http://www.greatestcoder.com/blog/CommentView,guid,005d9ac4-224a-46fc-a257-eedd69085326.aspx</wfw:comment>
      <wfw:commentRss>http://www.greatestcoder.com/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=005d9ac4-224a-46fc-a257-eedd69085326</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Here is an essay I wrote for my Masters <a href="http://www.csi.ucd.ie/Postgraduates/MScAdvancedSoftwareEngineering.html">course</a>.
I think it could be an interesting read...
</p>
        <p>
 
</p>
        <p>
          <em>"Comparison between DTD and XML Schemas"</em>
        </p>
        <p>
          <em>
          </em> 
</p>
        <font size="2">
          <p>
            <strong>Introduction</strong>
          </p>
          <p>
Document Type Definition (DTD) and XML Schema are XML schema languages, therefore
both of them are used to express a set of rules to which an XML document must conform
in order to pass validation. We need schema languages in order to check whether a
given document conforms to all the rules given business must enforce.
</p>
          <p>
DTD is native to XML schema language. It has been around for a long time; however
it has some shortcomings which will be discussed later.
</p>
          <p>
XML Schema has been developed later with the same purpose as DTD in mind; however
it tries to negate DTD’s shortcomings. Furthermore, XML Schema is the first schema
language that has been recommended by W3C (World Wide Web Consortium). An instance
of XML Schema is called XML Schema Definition (XSD). As, XSD has been designed later
it isn’t as limited in functionality as DTD.
</p>
          <p>
            <strong>DTD versus XML Schema</strong>
          </p>
          <p>
DTD lacks a couple of important constructs that are vital to working with XML documents.
The biggest concern is that DTD syntax is based on SGML not the XML itself. Therefore
from the technological standpoint, there is a need for two parsers. First one to validate
XML file (just for structure integrity, not for conforming to set rules) and the second
one to validate DTD file (again, just the structure). XSD is simply an XML file; therefore
we can validate structural integrity of the XSD and the target XML document with just
one parser.
</p>
          <p>
As DTD was designed to be a schema language it is very troublesome, that it lacks
a very important feature. It lacks data typing. It is impossible to specify what should
be the type of the given element. For example it is impossible to enforce a rule that
the amount of transaction is of type double. One could still pass a string and DTD
parser would state that the XML document is valid. In XSD, one is actually forced
(it is a required attribute) to specify the type of an object for each element; hence
this problem has been completely mitigated in XSD. XSD also has type called ‘anyType’
for those special situations when type is not important, or it differs for different
documents.
</p>
          <p>
Another important shortcoming of DTD is the fact that it is impossible to specify
the number of occurrences of a given element. Therefore, a lot of the validation must
still be done even after the parser says that the given document conforms to the DTD
schema. XSD on the other hand has properties: ‘minoccurs’ and ‘maxoccurs’ which obviously
are not perfect but are definitely a step in the right direction. Of course, there
are situations where these properties will not be sufficient to specify the business
rules required and again the work lies on the shoulders of the developer that must
check whether the file corresponds to the standards.
</p>
          <p>
Since the creation of DTD, XML has evolved, newer constructs have been created. Unfortunately,
DTD has not been up to par with those. An important feature of XML files are namespaces.
They have been created due to the fact the XML has become a mainstream standard and
therefore the documents have started to grow very large. It is not uncommon for a
document to use two different set of vocabularies. If those vocabularies have the
elements with the same name then it would lead to unmanageable files. Creation of
XML namespaces has solved those problems. Unfortunately, there is no support for XML
namespaces in DTD. This is a big limitation in most modern systems they are simply
a must. On the other hand when creating an XSD file, one must specify the namespace
of the specification. This and the fact that since XSD is an XML file and has its
own namespace shows that this feature of XML documents is deeply supported.
</p>
          <p>
            <strong>Corollary</strong>
          </p>
          <p>
DTD is an old technology (it is based in SGML which was developed in 1960s). XML Schema
came into being when XML became very popular and it became clear that DTD cannot meet
the needs of the businesses. XSD was developed with all the shortcomings of DTD in
mind. It was supposed to mitigate all the problems that DTD has. It is believed that
the XML Schema is the successor of Document Type Definition.
</p>
          <p>
To sum up, there are a lot differences between the two technologies, even though they
attempt to solve the same problem. It is important to note, that even though XML Schema
seems far more superior it is simply because it was developed much later then DTD.
Most legacy systems still use DTD, however new systems tend to lean toward the usage
of XML Schema. To ease in this transition there are a lot tools that allow translating
DTD files into XSD format.
</p>
        </font>
        <img width="0" height="0" src="http://www.greatestcoder.com/blog/aggbug.ashx?id=005d9ac4-224a-46fc-a257-eedd69085326" />
      </body>
      <title>Comparison between DTD and XML Schemas</title>
      <guid isPermaLink="false">http://www.greatestcoder.com/blog/PermaLink,guid,005d9ac4-224a-46fc-a257-eedd69085326.aspx</guid>
      <link>http://www.greatestcoder.com/blog/2007/07/09/ComparisonBetweenDTDAndXMLSchemas.aspx</link>
      <pubDate>Mon, 09 Jul 2007 19:01:17 GMT</pubDate>
      <description>&lt;p&gt;
Here is an essay I wrote for my Masters &lt;a href="http://www.csi.ucd.ie/Postgraduates/MScAdvancedSoftwareEngineering.html"&gt;course&lt;/a&gt;.
I think it could be an interesting read...
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
&lt;em&gt;"Comparison between DTD and XML Schemas"&lt;/em&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;em&gt;&lt;/em&gt;&amp;nbsp;
&lt;/p&gt;
&lt;font size=2&gt; 
&lt;p&gt;
&lt;strong&gt;Introduction&lt;/strong&gt;
&lt;/p&gt;
&lt;p&gt;
Document Type Definition (DTD) and XML Schema are XML schema languages, therefore
both of them are used to express a set of rules to which an XML document must conform
in order to pass validation. We need schema languages in order to check whether a
given document conforms to all the rules given business must enforce.
&lt;/p&gt;
&lt;p&gt;
DTD is native to XML schema language. It has been around for a long time; however
it has some shortcomings which will be discussed later.
&lt;/p&gt;
&lt;p&gt;
XML Schema has been developed later with the same purpose as DTD in mind; however
it tries to negate DTD’s shortcomings. Furthermore, XML Schema is the first schema
language that has been recommended by W3C (World Wide Web Consortium). An instance
of XML Schema is called XML Schema Definition (XSD). As, XSD has been designed later
it isn’t as limited in functionality as DTD.
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;DTD versus XML Schema&lt;/strong&gt;
&lt;/p&gt;
&lt;p&gt;
DTD lacks a couple of important constructs that are vital to working with XML documents.
The biggest concern is that DTD syntax is based on SGML not the XML itself. Therefore
from the technological standpoint, there is a need for two parsers. First one to validate
XML file (just for structure integrity, not for conforming to set rules) and the second
one to validate DTD file (again, just the structure). XSD is simply an XML file; therefore
we can validate structural integrity of the XSD and the target XML document with just
one parser.
&lt;/p&gt;
&lt;p&gt;
As DTD was designed to be a schema language it is very troublesome, that it lacks
a very important feature. It lacks data typing. It is impossible to specify what should
be the type of the given element. For example it is impossible to enforce a rule that
the amount of transaction is of type double. One could still pass a string and DTD
parser would state that the XML document is valid. In XSD, one is actually forced
(it is a required attribute) to specify the type of an object for each element; hence
this problem has been completely mitigated in XSD. XSD also has type called ‘anyType’
for those special situations when type is not important, or it differs for different
documents.
&lt;/p&gt;
&lt;p&gt;
Another important shortcoming of DTD is the fact that it is impossible to specify
the number of occurrences of a given element. Therefore, a lot of the validation must
still be done even after the parser says that the given document conforms to the DTD
schema. XSD on the other hand has properties: ‘minoccurs’ and ‘maxoccurs’ which obviously
are not perfect but are definitely a step in the right direction. Of course, there
are situations where these properties will not be sufficient to specify the business
rules required and again the work lies on the shoulders of the developer that must
check whether the file corresponds to the standards.
&lt;/p&gt;
&lt;p&gt;
Since the creation of DTD, XML has evolved, newer constructs have been created. Unfortunately,
DTD has not been up to par with those. An important feature of XML files are namespaces.
They have been created due to the fact the XML has become a mainstream standard and
therefore the documents have started to grow very large. It is not uncommon for a
document to use two different set of vocabularies. If those vocabularies have the
elements with the same name then it would lead to unmanageable files. Creation of
XML namespaces has solved those problems. Unfortunately, there is no support for XML
namespaces in DTD. This is a big limitation in most modern systems they are simply
a must. On the other hand when creating an XSD file, one must specify the namespace
of the specification. This and the fact that since XSD is an XML file and has its
own namespace shows that this feature of XML documents is deeply supported.
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;Corollary&lt;/strong&gt;
&lt;/p&gt;
&lt;p&gt;
DTD is an old technology (it is based in SGML which was developed in 1960s). XML Schema
came into being when XML became very popular and it became clear that DTD cannot meet
the needs of the businesses. XSD was developed with all the shortcomings of DTD in
mind. It was supposed to mitigate all the problems that DTD has. It is believed that
the XML Schema is the successor of Document Type Definition.
&lt;/p&gt;
&lt;p&gt;
To sum up, there are a lot differences between the two technologies, even though they
attempt to solve the same problem. It is important to note, that even though XML Schema
seems far more superior it is simply because it was developed much later then DTD.
Most legacy systems still use DTD, however new systems tend to lean toward the usage
of XML Schema. To ease in this transition there are a lot tools that allow translating
DTD files into XSD format.
&lt;/p&gt;
&lt;/font&gt;&lt;img width="0" height="0" src="http://www.greatestcoder.com/blog/aggbug.ashx?id=005d9ac4-224a-46fc-a257-eedd69085326" /&gt;</description>
      <comments>http://www.greatestcoder.com/blog/CommentView,guid,005d9ac4-224a-46fc-a257-eedd69085326.aspx</comments>
      <category>Other</category>
    </item>
    <item>
      <trackback:ping>http://www.greatestcoder.com/blog/Trackback.aspx?guid=ebccdb04-ba9c-45a5-9260-cd7e3087276a</trackback:ping>
      <pingback:server>http://www.greatestcoder.com/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.greatestcoder.com/blog/PermaLink,guid,ebccdb04-ba9c-45a5-9260-cd7e3087276a.aspx</pingback:target>
      <dc:creator>Marcin Waligora</dc:creator>
      <wfw:comment>http://www.greatestcoder.com/blog/CommentView,guid,ebccdb04-ba9c-45a5-9260-cd7e3087276a.aspx</wfw:comment>
      <wfw:commentRss>http://www.greatestcoder.com/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=ebccdb04-ba9c-45a5-9260-cd7e3087276a</wfw:commentRss>
      <title>Hosting Silverlight Applications</title>
      <guid isPermaLink="false">http://www.greatestcoder.com/blog/PermaLink,guid,ebccdb04-ba9c-45a5-9260-cd7e3087276a.aspx</guid>
      <link>http://www.greatestcoder.com/blog/2007/06/28/HostingSilverlightApplications.aspx</link>
      <pubDate>Thu, 28 Jun 2007 10:16:01 GMT</pubDate>
      <description>&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
So, you wrote your first &lt;a href="http://en.wikipedia.org/wiki/Rich_Internet_application"&gt;RIA&lt;/a&gt; and
you want to publish in on the web and start counting those millions of dollars coming
in. You deploy your application, type in the link but, nothing happens. Why?
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;
&lt;o:p&gt;&amp;nbsp;&lt;img style="WIDTH: 357px; HEIGHT: 197px" height=435 src="http://www.greatestcoder.com/blog/content/binary/browser.JPG" width=443 border=0&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
It could be, that your hosting service doesn’t support .xaml files (&lt;a href="http://www.seekdotnet.com/"&gt;&lt;font color=#800080&gt;mine&lt;/font&gt;&lt;/a&gt; started
around a month age). There is a quick workaround for that, simply rename your .xaml
files to .xml. You have to update your references accordingly, such as when you create
your xaml object via JavaScript. Luckily, if you do that, everything still works (Intellisense)
inside Visual Studio so if you do this before deployment, you won’t have any problems.
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
Note: You don’t have to do this for User Controls as they are compiled into the binary
file. 
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
Let’s assume that you have created your Silverlight project that consists of one Page.xaml
file some User Controls, one Default.html page (so typical set up in Visual Studio).
Below is a list of files that need to be uploaded to the server:
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
Default.html
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
Default.html.js
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
Page.xaml (or Page.xml)
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
Silverlight.js
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
And the most important one:
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
ClientBin (the directory in which is the client DLL)
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.greatestcoder.com/blog/aggbug.ashx?id=ebccdb04-ba9c-45a5-9260-cd7e3087276a" /&gt;</description>
      <comments>http://www.greatestcoder.com/blog/CommentView,guid,ebccdb04-ba9c-45a5-9260-cd7e3087276a.aspx</comments>
      <category>Silverlight</category>
    </item>
    <item>
      <trackback:ping>http://www.greatestcoder.com/blog/Trackback.aspx?guid=bb429cd4-a7ec-4ce9-af33-e07e463fde44</trackback:ping>
      <pingback:server>http://www.greatestcoder.com/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.greatestcoder.com/blog/PermaLink,guid,bb429cd4-a7ec-4ce9-af33-e07e463fde44.aspx</pingback:target>
      <dc:creator>Marcin Waligora</dc:creator>
      <wfw:comment>http://www.greatestcoder.com/blog/CommentView,guid,bb429cd4-a7ec-4ce9-af33-e07e463fde44.aspx</wfw:comment>
      <wfw:commentRss>http://www.greatestcoder.com/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=bb429cd4-a7ec-4ce9-af33-e07e463fde44</wfw:commentRss>
      <title>Request format is unrecognized error</title>
      <guid isPermaLink="false">http://www.greatestcoder.com/blog/PermaLink,guid,bb429cd4-a7ec-4ce9-af33-e07e463fde44.aspx</guid>
      <link>http://www.greatestcoder.com/blog/2007/06/11/RequestFormatIsUnrecognizedError.aspx</link>
      <pubDate>Mon, 11 Jun 2007 12:55:07 GMT</pubDate>
      <description>&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
I was writing a short project for myself in Silverlight that involved calling my own
web service. Everything was working great in localhost, however when I uploaded it
to my website, the application crashed and I had no idea why. After some time spent
debugging (not the most pleasant thing in Silverlight I found out, that calling a
web service from generated an exception: 
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;i style="mso-bidi-font-style: normal"&gt;Request format is unrecognized for URL unexpectedly
ending in /MyMethod.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/i&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
After looking at the problem, I realized that &lt;a href="http://support.microsoft.com/default.aspx?scid=kb;en-us;819267"&gt;HTTP
GET and HTTP POST Are Disabled by Default&lt;/a&gt; starting from ASP .NET 2.0. A quick
fix has solved the problem, paste the following in the web.config and you’re good
to go.
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&amp;lt;system.web&amp;gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&amp;lt;webServices&amp;gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&amp;lt;protocols&amp;gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&amp;lt;add
name="HttpGet"/&amp;gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&amp;lt;add
name="HttpPost"/&amp;gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&amp;lt;/protocols&amp;gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&amp;lt;/webServices&amp;gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.greatestcoder.com/blog/aggbug.ashx?id=bb429cd4-a7ec-4ce9-af33-e07e463fde44" /&gt;</description>
      <comments>http://www.greatestcoder.com/blog/CommentView,guid,bb429cd4-a7ec-4ce9-af33-e07e463fde44.aspx</comments>
      <category>Silverlight</category>
    </item>
    <item>
      <trackback:ping>http://www.greatestcoder.com/blog/Trackback.aspx?guid=9b25f690-1cae-4517-b81c-d2dc5e8ac03a</trackback:ping>
      <pingback:server>http://www.greatestcoder.com/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.greatestcoder.com/blog/PermaLink,guid,9b25f690-1cae-4517-b81c-d2dc5e8ac03a.aspx</pingback:target>
      <dc:creator>Marcin Waligora</dc:creator>
      <wfw:comment>http://www.greatestcoder.com/blog/CommentView,guid,9b25f690-1cae-4517-b81c-d2dc5e8ac03a.aspx</wfw:comment>
      <wfw:commentRss>http://www.greatestcoder.com/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=9b25f690-1cae-4517-b81c-d2dc5e8ac03a</wfw:commentRss>
      <title>Http automatic redirect</title>
      <guid isPermaLink="false">http://www.greatestcoder.com/blog/PermaLink,guid,9b25f690-1cae-4517-b81c-d2dc5e8ac03a.aspx</guid>
      <link>http://www.greatestcoder.com/blog/2007/06/06/HttpAutomaticRedirect.aspx</link>
      <pubDate>Wed, 06 Jun 2007 14:27:40 GMT</pubDate>
      <description>&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
I moved my blog from &lt;a href="http://www.greatestcoder.com/"&gt;&lt;font color=#800080&gt;www.greatestcoder.com&lt;/font&gt;&lt;/a&gt; to &lt;a href="http://www.greatestcoder.com/blog/"&gt;&lt;font color=#800080&gt;www.greatestcoder.com/blog/&lt;/font&gt;&lt;/a&gt;.
If you will hit the first page though, you will be automatically redirected to the
second page. Here’s how you can do it in the easiest way possible. Create index.html
with the following content:
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&amp;lt;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;html&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt; &lt;span style="COLOR: red"&gt;xmlns&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="http://www.w3.org/1999/xhtml"&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&amp;lt;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;head&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;title&lt;/span&gt; &lt;span style="COLOR: red"&gt;title&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="Marcin
Waligora"&lt;/span&gt; &lt;span style="COLOR: blue"&gt;/&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;meta&lt;/span&gt; &lt;span style="COLOR: red"&gt;http-equiv&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="refresh"&lt;/span&gt; &lt;span style="COLOR: red"&gt;content&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="0;url=http://www.greatestcoder.com/blog/"&lt;/span&gt; &lt;span style="COLOR: blue"&gt;/&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;head&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&amp;lt;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;body&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;body&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;html&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
The only thing that is interesting here is the &lt;span style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;meta &lt;/span&gt;tag. 
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;http-equiv&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;="refresh"&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;span style="mso-no-proof: yes"&gt;This attribuge will tell the server that the page
is going to be redirected.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;span style="mso-no-proof: yes"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;content&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;="0;url=http://www.greatestcoder.com/blog&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;span style="mso-no-proof: yes"&gt;Here we have two things into consideration – 0 indicates
the amount of time (in seconds) how long the client should wait before being automatically
redirected to another page (here idicated by the url tag). 
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;span style="mso-no-proof: yes"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;span style="mso-no-proof: yes"&gt;On a lot of pages you will see some information, like
: “we’re going to redirect you to a different page in 5 seconds. Click &lt;a href="http://www.greatestcoder.com/blog/"&gt;&lt;font color=#800080&gt;here&lt;/font&gt;&lt;/a&gt; if
you don’t wish to wait”.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;span style="mso-no-proof: yes"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;span style="mso-no-proof: yes"&gt;After moving the application I had one problem, all
the pictures that I’ve embedded in the posts were using absolute path. So when I moved
my application, none of the pictures were displayed. I had to update my previous posts
to reflect this change. It would seem logical (if you’re adding your own copy of the
image) to the post that it should use relative path instead of absolute. Then, moving
a blog to a new location would be a matter of copying all the files.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;span style="mso-no-proof: yes"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;span style="mso-no-proof: yes"&gt;Hey, this sounds like a feature request for &lt;a href="http://www.dasblog.net/"&gt;das
blog&lt;/a&gt; guys &lt;/span&gt;&lt;span style="FONT-FAMILY: Wingdings; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-char-type: symbol; mso-symbol-font-family: Wingdings"&gt;&lt;span style="mso-char-type: symbol; mso-symbol-font-family: Wingdings"&gt;J&lt;/span&gt;&lt;/span&gt;&lt;span style="mso-no-proof: yes"&gt;. &lt;/span&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.greatestcoder.com/blog/aggbug.ashx?id=9b25f690-1cae-4517-b81c-d2dc5e8ac03a" /&gt;</description>
      <comments>http://www.greatestcoder.com/blog/CommentView,guid,9b25f690-1cae-4517-b81c-d2dc5e8ac03a.aspx</comments>
      <category>Html</category>
    </item>
    <item>
      <trackback:ping>http://www.greatestcoder.com/blog/Trackback.aspx?guid=c60a488b-eb0b-4d8a-b746-16793adf2ea0</trackback:ping>
      <pingback:server>http://www.greatestcoder.com/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.greatestcoder.com/blog/PermaLink,guid,c60a488b-eb0b-4d8a-b746-16793adf2ea0.aspx</pingback:target>
      <dc:creator>Marcin Waligora</dc:creator>
      <wfw:comment>http://www.greatestcoder.com/blog/CommentView,guid,c60a488b-eb0b-4d8a-b746-16793adf2ea0.aspx</wfw:comment>
      <wfw:commentRss>http://www.greatestcoder.com/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=c60a488b-eb0b-4d8a-b746-16793adf2ea0</wfw:commentRss>
      <title>Setting Image Content in Silverlight</title>
      <guid isPermaLink="false">http://www.greatestcoder.com/blog/PermaLink,guid,c60a488b-eb0b-4d8a-b746-16793adf2ea0.aspx</guid>
      <link>http://www.greatestcoder.com/blog/2007/05/04/SettingImageContentInSilverlight.aspx</link>
      <pubDate>Fri, 04 May 2007 15:15:45 GMT</pubDate>
      <description>&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
There are examples how to set image to the Image object in Silverlight (both in 1.0
and 1.1); however I haven’t found one how to set it to any object that can be filled.
The beauty of XAML based applications is that you can put whatever media you want
inside objects, so if you want to fill in Ellipse or a Path with an image you can.
The easiest way to do it is just declaratively, in XAML:
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&amp;lt;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;Rectangle&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt; &lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;x:Name&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;=&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;"&lt;span style="COLOR: blue"&gt;mainPic&lt;/span&gt;"&lt;span style="COLOR: blue"&gt; &lt;/span&gt;&lt;span style="COLOR: red"&gt;Width&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;"&lt;span style="COLOR: blue"&gt;448&lt;/span&gt;"&lt;span style="COLOR: blue"&gt; &lt;/span&gt;&lt;span style="COLOR: red"&gt;Height&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;"&lt;span style="COLOR: blue"&gt;386&lt;/span&gt;"&lt;span style="COLOR: blue"&gt; &lt;/span&gt;&lt;span style="COLOR: red"&gt;Canvas.Left&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;"&lt;span style="COLOR: blue"&gt;288&lt;/span&gt;"&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&amp;lt;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;Rectangle.Fill&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&amp;lt;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;ImageBrush&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt; &lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;ImageSource&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;=&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;"&lt;span style="COLOR: blue"&gt;pic.jpg&lt;/span&gt;"&lt;span style="COLOR: blue"&gt; /&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&amp;lt;/&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;Rectangle.Fill&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;Rectangle&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
This is great for static content, but what if you want to set it programmatically
using Downloader object. 
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
Below is the solution for 1.0 (I tested in on Feb CTP release)
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;var&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt; wpfe;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;function&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt; root_Loaded(sender,
args) {&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;wpfe
= document.getElementById(&lt;span style="COLOR: #a31515"&gt;"wpfeControl1"&lt;/span&gt;);&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;&lt;span style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;mainDownloader
= wpfe.createObject(&lt;span style="COLOR: #a31515"&gt;"Downloader"&lt;/span&gt;);&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;&lt;span style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;mainDownloader.completed
= &lt;span style="COLOR: #a31515"&gt;"javascript:mainDownloadCompleted"&lt;/span&gt;;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;&lt;span style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;mainDownloader.DownloadProgressChanged
= &lt;span style="COLOR: #a31515"&gt;"javascript:mainDownloadProgressChanged"&lt;/span&gt;;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;&lt;span style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;&lt;span style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;mainDownloader.open(&lt;span style="COLOR: #a31515"&gt;"GET"&lt;/span&gt;, &lt;span style="COLOR: #a31515"&gt;"SomePic.JPG"&lt;/span&gt;, &lt;span style="COLOR: blue"&gt;true&lt;/span&gt;);&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;&lt;span style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;mainDownloader.send();&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;}&lt;span style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;function&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt; mainDownloadCompleted(sender,
args) {&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none"&gt;
&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;sender.findName(&lt;span style="COLOR: #a31515"&gt;"mainPic"&lt;/span&gt;).Fill.ImageSource
= sender.Uri;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/b&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;}&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
Apart from setting the downloader, the most important code line is this:
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none"&gt;
&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;sender.findName(&lt;span style="COLOR: #a31515"&gt;"mainPic"&lt;/span&gt;).Fill.ImageSource
= sender.Uri;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/b&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
When the image gets downloaded we set the Rectangle’s ImageBrush to its URL. 
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
Now solution for 1.1 in C#:
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;public&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt; &lt;span style="COLOR: blue"&gt;void&lt;/span&gt; Page_Loaded(&lt;span style="COLOR: blue"&gt;object&lt;/span&gt; o, &lt;span style="COLOR: #2b91af"&gt;EventArgs&lt;/span&gt; e)&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="COLOR: green"&gt;//
Required to initialize variables&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;InitializeComponent();&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="COLOR: #2b91af"&gt;Downloader&lt;/span&gt; downloader
= &lt;span style="COLOR: blue"&gt;new&lt;/span&gt; &lt;span style="COLOR: #2b91af"&gt;Downloader&lt;/span&gt;();&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;downloader.Completed
+= &lt;span style="COLOR: blue"&gt;new&lt;/span&gt; &lt;span style="COLOR: #2b91af"&gt;EventHandler&lt;/span&gt;(downloader_Completed);&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;downloader.Open(&lt;span style="COLOR: #a31515"&gt;"GET"&lt;/span&gt;, &lt;span style="COLOR: blue"&gt;new&lt;/span&gt; &lt;span style="COLOR: #2b91af"&gt;Uri&lt;/span&gt;(&lt;span style="COLOR: #a31515"&gt;"SomePic.JPG"&lt;/span&gt;, &lt;span style="COLOR: #2b91af"&gt;UriKind&lt;/span&gt;.Relative), &lt;span style="COLOR: blue"&gt;true&lt;/span&gt;);&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;downloader.Send();&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;void&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt; downloader_Completed(&lt;span style="COLOR: blue"&gt;object&lt;/span&gt; sender, &lt;span style="COLOR: #2b91af"&gt;EventArgs&lt;/span&gt; e)&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;(mainPic.Fill &lt;span style="COLOR: blue"&gt;as&lt;/span&gt; &lt;span style="COLOR: #2b91af"&gt;ImageBrush&lt;/span&gt;).ImageSource
= (sender &lt;span style="COLOR: blue"&gt;as&lt;/span&gt; &lt;span style="COLOR: #2b91af"&gt;Downloader&lt;/span&gt;).Uri;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/b&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;span s