<?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>CLR Hoser - Loader</title>
    <link>http://hoser.lander.ca/</link>
    <description>(none)</description>
    <language>en-us</language>
    <copyright>Rich Lander</copyright>
    <lastBuildDate>Thu, 23 Oct 2008 17:40:49 GMT</lastBuildDate>
    <generator>newtelligence dasBlog 2.3.9074.18820</generator>
    <managingEditor>rich@lander.ca</managingEditor>
    <webMaster>rich@lander.ca</webMaster>
    <item>
      <trackback:ping>http://hoser.lander.ca/Trackback.aspx?guid=25f1cfe6-f2e2-45f4-aabd-b1eee016fd17</trackback:ping>
      <pingback:server>http://hoser.lander.ca/pingback.aspx</pingback:server>
      <pingback:target>http://hoser.lander.ca/PermaLink,guid,25f1cfe6-f2e2-45f4-aabd-b1eee016fd17.aspx</pingback:target>
      <dc:creator>Rich Lander</dc:creator>
      <wfw:comment>http://hoser.lander.ca/CommentView,guid,25f1cfe6-f2e2-45f4-aabd-b1eee016fd17.aspx</wfw:comment>
      <wfw:commentRss>http://hoser.lander.ca/SyndicationService.asmx/GetEntryCommentsRss?guid=25f1cfe6-f2e2-45f4-aabd-b1eee016fd17</wfw:commentRss>
      <slash:comments>9</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
          <a href="http://hoser.lander.ca/content/binary/WindowsLiveWriter/WhatdoIwantforv2Applications_938B/20081014%20028.jpg">
            <img style="BORDER-RIGHT-WIDTH: 0px; MARGIN: 0px 0px 0px 5px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title="20081014 028" border="0" alt="20081014 028" align="right" src="http://hoser.lander.ca/content/binary/WindowsLiveWriter/WhatdoIwantforv2Applications_938B/20081014%20028_thumb.jpg" width="308" height="207" />
          </a> I’m
addressing the v2 question first. It is hard to know what to do in v1 if you don’t
know where you want to end up when you go to build and deploy v2 (and later versions)
of your product.
</p>
        <p>
First, I'm going back to the three different product categories that I <a href="http://hoser.lander.ca/2008/09/26/LookingIntoDeploymentShippingYourV2.aspx">outlined
earlier</a>. I'm going to collapse the two different types of applications into just
one category. Today's post is about applications. The next one will be about components.
</p>
        <p>
          <strong>
            <font size="2">Applications</font>
          </strong>
        </p>
        <p>
For v2, you will want one of two situations: 
</p>
        <ul>
          <li>
my v2 application completely replaces my v1 version entirely, or 
</li>
          <li>
my v2 application installs side-by-side with v1 and the two versions do not affect
or interact with one another 
</li>
        </ul>
        <p>
In most cases, I suspect that folks want the former. As an example, almost no one
expects or wants to continue to use Office 2003 after installing Office 2007 on their
machine. Something like TurboTax is the example that breaks that rule.
</p>
        <p>
If you opt to install your application side-by-side with the older version of your
application, then you might need to consider the safety of side-by-side versions of
the various libraries that you depend on. The specific scenario that I’m imagining
is that v2 of your application might be perfectly side-by-side with the v1 version,
but the newer version of the MathLib library that you depend on might not be properly
designed for a side-by-side install. Let's assume that you purchased MathLib from
MathCorp, and that the versioning/servicing scheme of MathLib is different (naturally)
than what you employ for the libraries that you build for your own application.
</p>
        <p>
There are (at least) two obvious gotchas that I can imagine: 
</p>
        <ul>
          <li>
MathLib doesn’t install side-by-side, but always overwrites older library versions
with newer versions, and the MathLib developers made a breaking change this release
(oops!), or 
</li>
          <li>
MathLib reads mathematic constants from a file at a particular location, and the format
of the file changed, but the location did not (oops!), which will break the old version 
</li>
        </ul>
        <p>
And to the other option, if you opt to replace the earlier version of your application,
you don't risk breaking the earlier version of your app (since it is now gone), but
you still have the risk that you might affect another app on the machine that relies
on MathLib in the same ways described above.
</p>
        <p>
What I’ve just described is essentially the well-known “dll hell” problem. I’d hope
that most developers are familiar with this problem and have enough information to
avoid it. However, it is sometimes non-obvious that you are about to walk off that
cliff. This post is really intended to get folks to think a little more about that
cliff.
</p>
        <p>
This whole scenario assumes that MathLib is installed in some global fashion, either
to the GAC, or to a global directory, such as "C:\Program Files\MathCorp\MathLib".
If MathLib is installed with the application, in the application directory, then this
whole problem goes away. At that point, you really are back to the monolithic application
that I discussed earlier where the entirety of the application is installed and serviced
uniformly, in time and location.
</p>
        <p>
To be clear, I'm not trying to push developers toward private installs. There are
downsides to approach that too. The meta-message is that you need to understand the
potential impact of deploying your v2, and align your v2 goals around avoiding those
impacts.
</p>
        <p>
What's with the picture in the post? I recently purchased a digital SLR and am getting
into photography as a hobby of sorts. The pic is just to add something extra to the
post. I like this particular picture since there is a lot to look at visually, and
because the focus is pretty narrow and well off center. It is also fun to see a child’s
toy as an artifact to study.
</p>
        <img width="0" height="0" src="http://hoser.lander.ca/aggbug.ashx?id=25f1cfe6-f2e2-45f4-aabd-b1eee016fd17" />
      </body>
      <title>What do I want for v2: Applications?</title>
      <guid isPermaLink="false">http://hoser.lander.ca/PermaLink,guid,25f1cfe6-f2e2-45f4-aabd-b1eee016fd17.aspx</guid>
      <link>http://hoser.lander.ca/2008/10/23/WhatDoIWantForV2Applications.aspx</link>
      <pubDate>Thu, 23 Oct 2008 17:40:49 GMT</pubDate>
      <description>&lt;p&gt;
&lt;a href="http://hoser.lander.ca/content/binary/WindowsLiveWriter/WhatdoIwantforv2Applications_938B/20081014%20028.jpg"&gt;&lt;img style="BORDER-RIGHT-WIDTH: 0px; MARGIN: 0px 0px 0px 5px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title="20081014 028" border=0 alt="20081014 028" align=right src="http://hoser.lander.ca/content/binary/WindowsLiveWriter/WhatdoIwantforv2Applications_938B/20081014%20028_thumb.jpg" width=308 height=207&gt;&lt;/a&gt; I’m
addressing the v2 question first. It is hard to know what to do in v1 if you don’t
know where you want to end up when you go to build and deploy v2 (and later versions)
of your product.
&lt;/p&gt;
&lt;p&gt;
First, I'm going back to the three different product categories that I &lt;a href="http://hoser.lander.ca/2008/09/26/LookingIntoDeploymentShippingYourV2.aspx"&gt;outlined
earlier&lt;/a&gt;. I'm going to collapse the two different types of applications into just
one category. Today's post is about applications. The next one will be about components.
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;&lt;font size=2&gt;Applications&lt;/font&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;p&gt;
For v2, you will want one of two situations: 
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
my v2 application completely replaces my v1 version entirely, or 
&lt;li&gt;
my v2 application installs side-by-side with v1 and the two versions do not affect
or interact with one another 
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
In most cases, I suspect that folks want the former. As an example, almost no one
expects or wants to continue to use Office 2003 after installing Office 2007 on their
machine. Something like TurboTax is the example that breaks that rule.
&lt;/p&gt;
&lt;p&gt;
If you opt to install your application side-by-side with the older version of your
application, then you might need to consider the safety of side-by-side versions of
the various libraries that you depend on. The specific scenario that I’m imagining
is that v2 of your application might be perfectly side-by-side with the v1 version,
but the newer version of the MathLib library that you depend on might not be properly
designed for a side-by-side install. Let's assume that you purchased MathLib from
MathCorp, and that the versioning/servicing scheme of MathLib is different (naturally)
than what you employ for the libraries that you build for your own application.
&lt;/p&gt;
&lt;p&gt;
There are (at least) two obvious gotchas that I can imagine: 
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
MathLib doesn’t install side-by-side, but always overwrites older library versions
with newer versions, and the MathLib developers made a breaking change this release
(oops!), or 
&lt;li&gt;
MathLib reads mathematic constants from a file at a particular location, and the format
of the file changed, but the location did not (oops!), which will break the old version 
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
And to the other option, if you opt to replace the earlier version of your application,
you don't risk breaking the earlier version of your app (since it is now gone), but
you still have the risk that you might affect another app on the machine that relies
on MathLib in the same ways described above.
&lt;/p&gt;
&lt;p&gt;
What I’ve just described is essentially the well-known “dll hell” problem. I’d hope
that most developers are familiar with this problem and have enough information to
avoid it. However, it is sometimes non-obvious that you are about to walk off that
cliff. This post is really intended to get folks to think a little more about that
cliff.
&lt;/p&gt;
&lt;p&gt;
This whole scenario assumes that MathLib is installed in some global fashion, either
to the GAC, or to a global directory, such as "C:\Program Files\MathCorp\MathLib".
If MathLib is installed with the application, in the application directory, then this
whole problem goes away. At that point, you really are back to the monolithic application
that I discussed earlier where the entirety of the application is installed and serviced
uniformly, in time and location.
&lt;/p&gt;
&lt;p&gt;
To be clear, I'm not trying to push developers toward private installs. There are
downsides to approach that too. The meta-message is that you need to understand the
potential impact of deploying your v2, and align your v2 goals around avoiding those
impacts.
&lt;/p&gt;
&lt;p&gt;
What's with the picture in the post? I recently purchased a digital SLR and am getting
into photography as a hobby of sorts. The pic is just to add something extra to the
post. I like this particular picture since there is a lot to look at visually, and
because the focus is pretty narrow and well off center. It is also fun to see a child’s
toy as an artifact to study.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://hoser.lander.ca/aggbug.ashx?id=25f1cfe6-f2e2-45f4-aabd-b1eee016fd17" /&gt;</description>
      <comments>http://hoser.lander.ca/CommentView,guid,25f1cfe6-f2e2-45f4-aabd-b1eee016fd17.aspx</comments>
      <category>Deployment</category>
      <category>Loader</category>
      <category>Versioning</category>
    </item>
    <item>
      <trackback:ping>http://hoser.lander.ca/Trackback.aspx?guid=731a3383-6d88-40fa-967b-19c3a3e6fe7c</trackback:ping>
      <pingback:server>http://hoser.lander.ca/pingback.aspx</pingback:server>
      <pingback:target>http://hoser.lander.ca/PermaLink,guid,731a3383-6d88-40fa-967b-19c3a3e6fe7c.aspx</pingback:target>
      <dc:creator>Rich Lander</dc:creator>
      <wfw:comment>http://hoser.lander.ca/CommentView,guid,731a3383-6d88-40fa-967b-19c3a3e6fe7c.aspx</wfw:comment>
      <wfw:commentRss>http://hoser.lander.ca/SyndicationService.asmx/GetEntryCommentsRss?guid=731a3383-6d88-40fa-967b-19c3a3e6fe7c</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p style="MARGIN: 0in 0in 10pt" class="MsoNormal">
          <font color="#000000" size="3" face="Calibri">Lately, I’ve been thinking about the
overall .NET deployment and servicing story. There are a number of aspects of deployment
that one can consider. The particular issues that are salient for your product depend
a lot on the kind of code you deploy onto end-user machines. </font>
        </p>
        <p style="MARGIN: 0in 0in 10pt" class="MsoNormal">
          <font color="#000000" size="3" face="Calibri">First, let’s look at the different kinds
of products that developers might build, and need to deploy:</font>
        </p>
        <p style="TEXT-INDENT: -0.25in; MARGIN: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo1" class="MsoListParagraphCxSpFirst">
          <font color="#000000">
            <span style="mso-ascii-font-family: Calibri; mso-fareast-font-family: Calibri; mso-hansi-font-family: Calibri; mso-bidi-font-family: Calibri">
              <span style="mso-list: Ignore">
                <font size="3" face="Calibri">-</font>
                <span style="FONT: 7pt 'Times New Roman'">          </span>
              </span>
            </span>
            <font size="3" face="Calibri">Monolithic
applications</font>
          </font>
        </p>
        <p style="TEXT-INDENT: -0.25in; MARGIN: 0in 0in 0pt 1in; mso-list: l0 level2 lfo1; mso-add-space: auto" class="MsoListParagraphCxSpMiddle">
          <font color="#000000">
            <span style="FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Courier New'">
              <span style="mso-list: Ignore">
                <font size="3">o</font>
                <span style="FONT: 7pt 'Times New Roman'">   </span>
              </span>
            </span>
            <font size="3" face="Calibri">A
single exe that is not dependent on any libraries, other than the .NET Framework itself,
or</font>
          </font>
        </p>
        <p style="TEXT-INDENT: -0.25in; MARGIN: 0in 0in 0pt 1in; mso-list: l0 level2 lfo1; mso-add-space: auto" class="MsoListParagraphCxSpMiddle">
          <font color="#000000">
            <span style="FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Courier New'">
              <span style="mso-list: Ignore">
                <font size="3">o</font>
                <span style="FONT: 7pt 'Times New Roman'">   </span>
              </span>
            </span>
            <font size="3" face="Calibri">Solely
dependent on libraries that are serviced/upgraded with the application</font>
          </font>
        </p>
        <p style="TEXT-INDENT: -0.25in; MARGIN: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo1" class="MsoListParagraphCxSpMiddle">
          <font color="#000000">
            <span style="mso-ascii-font-family: Calibri; mso-fareast-font-family: Calibri; mso-hansi-font-family: Calibri; mso-bidi-font-family: Calibri">
              <span style="mso-list: Ignore">
                <font size="3" face="Calibri">-</font>
                <span style="FONT: 7pt 'Times New Roman'">          </span>
              </span>
            </span>
            <font size="3" face="Calibri">Aggregate
applications</font>
          </font>
        </p>
        <p style="TEXT-INDENT: -0.25in; MARGIN: 0in 0in 0pt 1in; mso-list: l0 level2 lfo1; mso-add-space: auto" class="MsoListParagraphCxSpMiddle">
          <font color="#000000">
            <span style="FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Courier New'">
              <span style="mso-list: Ignore">
                <font size="3">o</font>
                <span style="FONT: 7pt 'Times New Roman'">   </span>
              </span>
            </span>
            <font size="3" face="Calibri">Dependent
(at least partially) on libraries (or controls or components) that are installed/serviced/upgraded
separately (in ‘time’ and/or ‘location’) from the application</font>
          </font>
        </p>
        <p style="TEXT-INDENT: -0.25in; MARGIN: 0in 0in 0pt 1in; mso-list: l0 level2 lfo1; mso-add-space: auto" class="MsoListParagraphCxSpMiddle">
          <font color="#000000">
            <span style="FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Courier New'">
              <span style="mso-list: Ignore">
                <font size="3">o</font>
                <span style="FONT: 7pt 'Times New Roman'">   </span>
              </span>
            </span>
            <font face="Calibri">
              <font size="3">These
libraries are likely sourced from a 3<sup>rd</sup></font>
              <font size="3"> party</font>
            </font>
          </font>
        </p>
        <p style="TEXT-INDENT: -0.25in; MARGIN: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo1" class="MsoListParagraphCxSpMiddle">
          <font color="#000000">
            <span style="mso-ascii-font-family: Calibri; mso-fareast-font-family: Calibri; mso-hansi-font-family: Calibri; mso-bidi-font-family: Calibri">
              <span style="mso-list: Ignore">
                <font size="3" face="Calibri">-</font>
                <span style="FONT: 7pt 'Times New Roman'">          </span>
              </span>
            </span>
            <font size="3" face="Calibri">Components,
controls or class libraries</font>
          </font>
        </p>
        <p style="TEXT-INDENT: -0.25in; MARGIN: 0in 0in 10pt 1in; mso-list: l0 level2 lfo1; mso-add-space: auto" class="MsoListParagraphCxSpLast">
          <font color="#000000">
            <span style="FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Courier New'">
              <span style="mso-list: Ignore">
                <font size="3">o</font>
                <span style="FONT: 7pt 'Times New Roman'">   </span>
              </span>
            </span>
            <font size="3" face="Calibri">You
build assemblies that other developers reference in their applications (both ‘Monolithic’
and ‘Aggregate’ applications as described above) or other libraries</font>
          </font>
        </p>
        <p style="MARGIN: 0in 0in 10pt" class="MsoNormal">
          <font color="#000000" size="3" face="Calibri">While we’re thinking broadly, one is
left wondering what the critical questions are to think about for each of the deployment
cases above. There are a lot of questions that one can imagine looking into. They
range from .NET Framework and application deployment, to servicing multiple versions
of your applications out in the wild, to safely deploying a new version of your API
(class libraries) onto end-user machines w/o any adverse impact.</font>
        </p>
        <p style="MARGIN: 0in 0in 10pt" class="MsoNormal">
          <font color="#000000" size="3" face="Calibri">The first one that I’d like to look
at is: “Am I building my product correctly for the future?” This question, though,
really boils down into two important questions:</font>
        </p>
        <p style="TEXT-INDENT: -0.25in; MARGIN: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo1" class="MsoListParagraphCxSpFirst">
          <font color="#000000">
            <span style="mso-ascii-font-family: Calibri; mso-fareast-font-family: Calibri; mso-hansi-font-family: Calibri; mso-bidi-font-family: Calibri">
              <span style="mso-list: Ignore">
                <font size="3" face="Calibri">-</font>
                <span style="FONT: 7pt 'Times New Roman'">          </span>
              </span>
            </span>
            <font size="3" face="Calibri">What
do I need to think about when shipping v1 of my product?</font>
          </font>
        </p>
        <p style="TEXT-INDENT: -0.25in; MARGIN: 0in 0in 10pt 0.5in; mso-list: l0 level1 lfo1" class="MsoListParagraphCxSpLast">
          <font color="#000000">
            <span style="mso-ascii-font-family: Calibri; mso-fareast-font-family: Calibri; mso-hansi-font-family: Calibri; mso-bidi-font-family: Calibri">
              <span style="mso-list: Ignore">
                <font size="3" face="Calibri">-</font>
                <span style="FONT: 7pt 'Times New Roman'">          </span>
              </span>
            </span>
            <font size="3" face="Calibri">What
do I need to do to safely, correctly and seamlessly ship v2 of my product?</font>
          </font>
        </p>
        <p style="MARGIN: 0in 0in 10pt" class="MsoNormal">
          <font color="#000000" size="3" face="Calibri">Those questions seem very simple, and
they are on the surface. The answers are not overly complicated, but do require some
up-front thought to ensure that you end up where you want to. </font>
        </p>
        <p style="MARGIN: 0in 0in 10pt" class="MsoNormal">
          <font color="#000000" size="3" face="Calibri">We have had folks come to us after a
successful v1, not quite sure what to do for v2. You may be wondering what the crux
of this is … you just hit ‘go’ on csc/vbc another time and you’re done, right? Maybe.
It all depends on how you want your code to behave when you ship your second version.</font>
        </p>
        <p style="MARGIN: 0in 0in 10pt" class="MsoNormal">
          <font color="#000000" size="3" face="Calibri">Note that I call out v2 specifically
(and not v3 and v4) since v2 is the first version after your initial one, and will
be the time when you need to address any issues that come up with shipping again.
Once you’ve got a plan in place, you’ll be able to rinse and repeat for each subsequent
version (provided that you have a good plan).</font>
        </p>
        <p style="MARGIN: 0in 0in 10pt" class="MsoNormal">
          <font color="#000000" size="3" face="Calibri">In my next posts, I’ll answer this question
for each of the product types listed at the top of the post.</font>
        </p>
        <img width="0" height="0" src="http://hoser.lander.ca/aggbug.ashx?id=731a3383-6d88-40fa-967b-19c3a3e6fe7c" />
      </body>
      <title>Looking into Deployment – Shipping your v2</title>
      <guid isPermaLink="false">http://hoser.lander.ca/PermaLink,guid,731a3383-6d88-40fa-967b-19c3a3e6fe7c.aspx</guid>
      <link>http://hoser.lander.ca/2008/09/26/LookingIntoDeploymentShippingYourV2.aspx</link>
      <pubDate>Fri, 26 Sep 2008 16:57:56 GMT</pubDate>
      <description>&lt;p style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;
&lt;font color=#000000 size=3 face=Calibri&gt;Lately, I’ve been thinking about the overall
.NET deployment and servicing story. There are a number of aspects of deployment that
one can consider. The particular issues that are salient for your product depend a
lot on the kind of code you deploy onto end-user machines. &lt;/font&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;
&lt;font color=#000000 size=3 face=Calibri&gt;First, let’s look at the different kinds of
products that developers might build, and need to deploy:&lt;/font&gt;
&lt;/p&gt;
&lt;p style="TEXT-INDENT: -0.25in; MARGIN: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo1" class=MsoListParagraphCxSpFirst&gt;
&lt;font color=#000000&gt;&lt;span style="mso-ascii-font-family: Calibri; mso-fareast-font-family: Calibri; mso-hansi-font-family: Calibri; mso-bidi-font-family: Calibri"&gt;&lt;span style="mso-list: Ignore"&gt;&lt;font size=3 face=Calibri&gt;-&lt;/font&gt;&lt;span style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;font size=3 face=Calibri&gt;Monolithic
applications&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p style="TEXT-INDENT: -0.25in; MARGIN: 0in 0in 0pt 1in; mso-list: l0 level2 lfo1; mso-add-space: auto" class=MsoListParagraphCxSpMiddle&gt;
&lt;font color=#000000&gt;&lt;span style="FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Courier New'"&gt;&lt;span style="mso-list: Ignore"&gt;&lt;font size=3&gt;o&lt;/font&gt;&lt;span style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;font size=3 face=Calibri&gt;A
single exe that is not dependent on any libraries, other than the .NET Framework itself,
or&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p style="TEXT-INDENT: -0.25in; MARGIN: 0in 0in 0pt 1in; mso-list: l0 level2 lfo1; mso-add-space: auto" class=MsoListParagraphCxSpMiddle&gt;
&lt;font color=#000000&gt;&lt;span style="FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Courier New'"&gt;&lt;span style="mso-list: Ignore"&gt;&lt;font size=3&gt;o&lt;/font&gt;&lt;span style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;font size=3 face=Calibri&gt;Solely
dependent on libraries that are serviced/upgraded with the application&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p style="TEXT-INDENT: -0.25in; MARGIN: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo1" class=MsoListParagraphCxSpMiddle&gt;
&lt;font color=#000000&gt;&lt;span style="mso-ascii-font-family: Calibri; mso-fareast-font-family: Calibri; mso-hansi-font-family: Calibri; mso-bidi-font-family: Calibri"&gt;&lt;span style="mso-list: Ignore"&gt;&lt;font size=3 face=Calibri&gt;-&lt;/font&gt;&lt;span style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;font size=3 face=Calibri&gt;Aggregate
applications&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p style="TEXT-INDENT: -0.25in; MARGIN: 0in 0in 0pt 1in; mso-list: l0 level2 lfo1; mso-add-space: auto" class=MsoListParagraphCxSpMiddle&gt;
&lt;font color=#000000&gt;&lt;span style="FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Courier New'"&gt;&lt;span style="mso-list: Ignore"&gt;&lt;font size=3&gt;o&lt;/font&gt;&lt;span style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;font size=3 face=Calibri&gt;Dependent
(at least partially) on libraries (or controls or components) that are installed/serviced/upgraded
separately (in ‘time’ and/or ‘location’) from the application&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p style="TEXT-INDENT: -0.25in; MARGIN: 0in 0in 0pt 1in; mso-list: l0 level2 lfo1; mso-add-space: auto" class=MsoListParagraphCxSpMiddle&gt;
&lt;font color=#000000&gt;&lt;span style="FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Courier New'"&gt;&lt;span style="mso-list: Ignore"&gt;&lt;font size=3&gt;o&lt;/font&gt;&lt;span style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;font face=Calibri&gt;&lt;font size=3&gt;These
libraries are likely sourced from a 3&lt;sup&gt;rd&lt;/sup&gt;&lt;/font&gt;&lt;font size=3&gt; party&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p style="TEXT-INDENT: -0.25in; MARGIN: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo1" class=MsoListParagraphCxSpMiddle&gt;
&lt;font color=#000000&gt;&lt;span style="mso-ascii-font-family: Calibri; mso-fareast-font-family: Calibri; mso-hansi-font-family: Calibri; mso-bidi-font-family: Calibri"&gt;&lt;span style="mso-list: Ignore"&gt;&lt;font size=3 face=Calibri&gt;-&lt;/font&gt;&lt;span style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;font size=3 face=Calibri&gt;Components,
controls or class libraries&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p style="TEXT-INDENT: -0.25in; MARGIN: 0in 0in 10pt 1in; mso-list: l0 level2 lfo1; mso-add-space: auto" class=MsoListParagraphCxSpLast&gt;
&lt;font color=#000000&gt;&lt;span style="FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Courier New'"&gt;&lt;span style="mso-list: Ignore"&gt;&lt;font size=3&gt;o&lt;/font&gt;&lt;span style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;font size=3 face=Calibri&gt;You
build assemblies that other developers reference in their applications (both ‘Monolithic’
and ‘Aggregate’ applications as described above) or other libraries&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;
&lt;font color=#000000 size=3 face=Calibri&gt;While we’re thinking broadly, one is left
wondering what the critical questions are to think about for each of the deployment
cases above. There are a lot of questions that one can imagine looking into. They
range from .NET Framework and application deployment, to servicing multiple versions
of your applications out in the wild, to safely deploying a new version of your API
(class libraries) onto end-user machines w/o any adverse impact.&lt;/font&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;
&lt;font color=#000000 size=3 face=Calibri&gt;The first one that I’d like to look at is:
“Am I building my product correctly for the future?” This question, though, really
boils down into two important questions:&lt;/font&gt;
&lt;/p&gt;
&lt;p style="TEXT-INDENT: -0.25in; MARGIN: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo1" class=MsoListParagraphCxSpFirst&gt;
&lt;font color=#000000&gt;&lt;span style="mso-ascii-font-family: Calibri; mso-fareast-font-family: Calibri; mso-hansi-font-family: Calibri; mso-bidi-font-family: Calibri"&gt;&lt;span style="mso-list: Ignore"&gt;&lt;font size=3 face=Calibri&gt;-&lt;/font&gt;&lt;span style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;font size=3 face=Calibri&gt;What
do I need to think about when shipping v1 of my product?&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p style="TEXT-INDENT: -0.25in; MARGIN: 0in 0in 10pt 0.5in; mso-list: l0 level1 lfo1" class=MsoListParagraphCxSpLast&gt;
&lt;font color=#000000&gt;&lt;span style="mso-ascii-font-family: Calibri; mso-fareast-font-family: Calibri; mso-hansi-font-family: Calibri; mso-bidi-font-family: Calibri"&gt;&lt;span style="mso-list: Ignore"&gt;&lt;font size=3 face=Calibri&gt;-&lt;/font&gt;&lt;span style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;font size=3 face=Calibri&gt;What
do I need to do to safely, correctly and seamlessly ship v2 of my product?&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;
&lt;font color=#000000 size=3 face=Calibri&gt;Those questions seem very simple, and they
are on the surface. The answers are not overly complicated, but do require some up-front
thought to ensure that you end up where you want to. &lt;/font&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;
&lt;font color=#000000 size=3 face=Calibri&gt;We have had folks come to us after a successful
v1, not quite sure what to do for v2. You may be wondering what the crux of this is
… you just hit ‘go’ on csc/vbc another time and you’re done, right? Maybe. It all
depends on how you want your code to behave when you ship your second version.&lt;/font&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;
&lt;font color=#000000 size=3 face=Calibri&gt;Note that I call out v2 specifically (and
not v3 and v4) since v2 is the first version after your initial one, and will be the
time when you need to address any issues that come up with shipping again. Once you’ve
got a plan in place, you’ll be able to rinse and repeat for each subsequent version
(provided that you have a good plan).&lt;/font&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;
&lt;font color=#000000 size=3 face=Calibri&gt;In my next posts, I’ll answer this question
for each of the product types listed at the top of the post.&lt;/font&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://hoser.lander.ca/aggbug.ashx?id=731a3383-6d88-40fa-967b-19c3a3e6fe7c" /&gt;</description>
      <comments>http://hoser.lander.ca/CommentView,guid,731a3383-6d88-40fa-967b-19c3a3e6fe7c.aspx</comments>
      <category>Loader</category>
      <category>Versioning</category>
      <category>Deployment</category>
    </item>
    <item>
      <trackback:ping>http://hoser.lander.ca/Trackback.aspx?guid=d96d6c72-c981-49a0-a50f-654dda2da2d1</trackback:ping>
      <pingback:server>http://hoser.lander.ca/pingback.aspx</pingback:server>
      <pingback:target>http://hoser.lander.ca/PermaLink,guid,d96d6c72-c981-49a0-a50f-654dda2da2d1.aspx</pingback:target>
      <dc:creator>Rich Lander</dc:creator>
      <wfw:comment>http://hoser.lander.ca/CommentView,guid,d96d6c72-c981-49a0-a50f-654dda2da2d1.aspx</wfw:comment>
      <wfw:commentRss>http://hoser.lander.ca/SyndicationService.asmx/GetEntryCommentsRss?guid=d96d6c72-c981-49a0-a50f-654dda2da2d1</wfw:commentRss>
      <title>Getting the list of loaded assemblies from another App domain</title>
      <guid isPermaLink="false">http://hoser.lander.ca/PermaLink,guid,d96d6c72-c981-49a0-a50f-654dda2da2d1.aspx</guid>
      <link>http://hoser.lander.ca/2006/12/20/GettingTheListOfLoadedAssembliesFromAnotherAppDomain.aspx</link>
      <pubDate>Wed, 20 Dec 2006 20:40:10 GMT</pubDate>
      <description>&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;font face=Calibri color=#000000 size=3&gt;I&amp;nbsp;wrote a recent post about &lt;a href="http://hoser.lander.ca/Getting+The+List+Of+Loaded+Assemblies.aspx"&gt;getting
the list of loaded assemblies&lt;/a&gt;. That’s a pretty straight-forward operation as shown
by the code listed in that post. I’d like to step up the problem one notch by looking
at getting the list of assemblies from another domain. Seems like a very reasonable
thing to do ... Or we’ll see …&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;font face=Calibri color=#000000 size=3&gt;To properly setup this example, I need to
create another domain and keep a reference to that domain. That’s easy:&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; 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;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: green"&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;//Create
new domain&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; 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;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: teal"&gt;AppDomain&lt;/span&gt;&lt;font color=#000000&gt; domain
= &lt;/font&gt;&lt;span style="COLOR: teal"&gt;AppDomain&lt;/span&gt;&lt;font color=#000000&gt;.CreateDomain(&lt;/font&gt;&lt;span style="COLOR: maroon"&gt;"domain2"&lt;/span&gt;&lt;font color=#000000&gt;);&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;o:p&gt;
&lt;font face=Calibri color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;font face=Calibri color=#000000 size=3&gt;Next, we need to load some code in that domain,
or else there won’t be any assemblies loaded there to actually query. Note that &lt;/font&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: teal; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;Host&lt;/span&gt;&lt;font face=Calibri color=#000000 size=3&gt; is
one of my types, as you’ll see later. The method below loads the DomainHost assembly
in domain2, creates an instance of the &lt;/font&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: teal; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;DomainHost.Host&lt;/span&gt;&lt;font face=Calibri color=#000000 size=3&gt; type
in domain2 and also returns a reference to that instance in the current domain. That’s
why you see the cast to &lt;/font&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: teal; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;Host&lt;/span&gt;&lt;font face=Calibri color=#000000 size=3&gt;.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; 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;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: teal"&gt;Host&lt;/span&gt;&lt;font color=#000000&gt; host
= (&lt;/font&gt;&lt;span style="COLOR: teal"&gt;Host&lt;/span&gt;&lt;font color=#000000&gt;)domain.CreateInstanceAndUnwrap(&lt;/font&gt;&lt;span style="COLOR: maroon"&gt;"DomainHost"&lt;/span&gt;&lt;font color=#000000&gt;, &lt;/font&gt;&lt;span style="COLOR: maroon"&gt;"DomainHost.Host"&lt;/span&gt;&lt;font color=#000000&gt;);&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;o:p&gt;
&lt;font face=Calibri color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;font face=Calibri color=#000000 size=3&gt;OK … this is the part that where it gets interesting.
It is actually a little non-obvious on how you are intended to get the list of loaded
assemblies from the other domains. Let’s first look at the most intuitive approach
for doing this. There is the same GetAssemblies() method on &lt;/font&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: teal; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;AppDomain&lt;/span&gt;&lt;font color=#000000&gt;&lt;span style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt; &lt;/span&gt;&lt;font face=Calibri&gt;&lt;font size=3&gt;that
I used in the last post.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;&lt;/font&gt;&lt;font size=3&gt;So,
given that I have a reference to the domain2 &lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: teal; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;AppDomain&lt;/span&gt;&lt;font color=#000000&gt;&lt;span style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt; &lt;/span&gt;&lt;font face=Calibri size=3&gt;instance,
why not just call GetAssemblies() on it? This is what the code would look like:&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&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;domain.GetAssemblies();&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;o:p&gt;
&lt;font face=Calibri color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;font face=Calibri color=#000000 size=3&gt;For a variety of reasons, assemblies are not
marked as serializable objects, which means that they cannot be remoted across an
appdomain (or any other) boundary. You can get around this limitation by remoting
and then loading an assembly as a Byte[], but that’s a different blog post. This call
gets around the limitation by remoting an array of representative &lt;/font&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: teal; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;AssemblyName&lt;/span&gt;&lt;font face=Calibri color=#000000 size=3&gt; objects,
as opposed to the actual assemblies. The loader then does the equivalent of the following,
assuming the &lt;/font&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: teal; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;AssemblyName[]&lt;/span&gt;&lt;font face=Calibri color=#000000 size=3&gt;is
called asmNames:&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; 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;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;foreach&lt;/span&gt;&lt;font color=#000000&gt; (&lt;/font&gt;&lt;span style="COLOR: teal"&gt;AssemblyName&lt;/span&gt;&lt;font color=#000000&gt; asmName &lt;/font&gt;&lt;span style="COLOR: blue"&gt;in&lt;/span&gt;&lt;font color=#000000&gt; asmNames)&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&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;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; 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;&lt;font color=#000000&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; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: teal"&gt;Assembly&lt;/span&gt;&lt;font color=#000000&gt;.Load(asmName);&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;span style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&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;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;font face=Calibri color=#000000 size=3&gt;This behavior is not really expected or desirable.
First, you really want the &lt;/font&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: teal; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;AssemblyName&lt;/span&gt;&lt;font face=Calibri color=#000000 size=3&gt; objects,
not the &lt;/font&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: teal; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;Assembly&lt;/span&gt;&lt;font face=Calibri color=#000000 size=3&gt; objects,
and you definitely do not want to cause the assemblies to be loaded in this domain.
In addition, if the assemblies are not located in the GAC, and the other domain has
a different AppBase, then it is very likely that the assembly loads will fail, resulting
in the loader throwing an exception that you might not be prepared to catch. Ouch.
That’s really bad. It is also important that not all assemblies play nicely with this
behavior. For example, Reflection.Emit assemblies cannot be re-loaded cross domain,
for fairly obvious reasons. Mixed-mode assemblies have another set of problems. So,
let’s skip that option.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;font face=Calibri color=#000000 size=3&gt;Another option is to call &lt;/font&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: teal; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;AppDomain&lt;/span&gt;&lt;font color=#000000&gt;&lt;span style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;.GetAssemblies()&lt;/span&gt;&lt;font face=Calibri size=3&gt; in
the other domain, and then to remote the &lt;/font&gt;&lt;/font&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: teal; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;Assembly[]&lt;/span&gt;&lt;font face=Calibri color=#000000 size=3&gt; back
through to the current domain.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;That will
have the same effect as what I just discussed above. &lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;font face=Calibri&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/span&gt;I’ve
skipped over some important details that I need to explain. My &lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: teal; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;DomainHost.Host&lt;/span&gt;&lt;font face=Calibri color=#000000 size=3&gt; type
is a regular old that type that happens to inherit from &lt;/font&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: teal; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;System.MarshalByRefObject&lt;/span&gt;&lt;font face=Calibri color=#000000 size=3&gt;.
The fact that it inherits from this type is more of a marking than anything else,
as I don’t override any of MBRO’s methods, nor do I have to know what they are. This
is very conceptually similar to marking a type with the [&lt;/font&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: teal; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;Serializable&lt;/span&gt;&lt;font face=Calibri color=#000000 size=3&gt;]
attribute. The difference is that MBRO provides copy-by-ref semantics as opposed to
copy-by-value across a boundary, which is what the [Serializable] attribute provides.
This means that MBRO-inherited types can be remoted across a domain, process or even
machine boundary as a reference that you can easily call across. The method calls
only affect the domain in which the type actually resides (not where the reference
resides), with the exception that return types (which must be either MBRO or [Serializable])
are returned to where the call was made from (the current domain). The reference is
called a transparent proxy, and you can see that in the debugger when you try to peer
into what turns out to be the largely opaque &lt;/font&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: teal; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;System.Runtime.Remoting.Proxies.__TransparentProxy&lt;/span&gt;&lt;font face=Calibri color=#000000 size=3&gt; type.
Woah! The fact that&lt;/font&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: teal; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt; DomainHost.Host&lt;/span&gt;&lt;font face=Calibri color=#000000 size=3&gt; is
MBRO is going to turn out quite useful, as we’ll see. &lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;font face=Calibri color=#000000 size=3&gt;OK, now to the real solution. I need to add
a method to &lt;/font&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: teal; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;DomainHost.Host&lt;/span&gt;&lt;font face=Calibri color=#000000 size=3&gt; that
I can call that returns &lt;/font&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: teal; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;AssemblyName[]&lt;/span&gt;&lt;font face=Calibri color=#000000 size=3&gt; and
that does not interact with the loader in any way on this side of the domain boundary,
as I want to avoid any assembly loads on these &lt;/font&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: teal; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;AssemblyName&lt;/span&gt;&lt;font face=Calibri color=#000000 size=3&gt; objects.
Let’s see what the method would look like:&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; 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;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;public&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: teal"&gt;AssemblyName&lt;/span&gt;&lt;font color=#000000&gt;[]
GetAssemblyNames()&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&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;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; 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;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: teal"&gt;AssemblyName&lt;/span&gt;&lt;font color=#000000&gt;[]
names;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; 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;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: teal"&gt;Assembly&lt;/span&gt;&lt;font color=#000000&gt;[]
asms;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; 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;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&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;asms
= &lt;/font&gt;&lt;span style="COLOR: teal"&gt;AppDomain&lt;/span&gt;&lt;font color=#000000&gt;.CurrentDomain.GetAssemblies();&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&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;names
= &lt;/font&gt;&lt;span style="COLOR: blue"&gt;new&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: teal"&gt;AssemblyName&lt;/span&gt;&lt;font color=#000000&gt;[asms.Length];&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; 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;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; 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;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;for&lt;/span&gt;&lt;font color=#000000&gt; (&lt;/font&gt;&lt;span style="COLOR: teal"&gt;Int32&lt;/span&gt;&lt;font color=#000000&gt; i
= 0; i &amp;lt; asms.Length; i++ )&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&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;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;names[i]
= asms[i].GetName();&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&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;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; 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;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; 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;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;return&lt;/span&gt;&lt;font color=#000000&gt; names;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;span style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&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;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;font face=Calibri color=#000000 size=3&gt;This method uses the AppDomain.GetAssemblies()
method to get the list of loaded assemblies, but doesn’t return that. It creates an
equal length &lt;/font&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: teal; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;AssemblyName[]&lt;/span&gt;&lt;font face=Calibri color=#000000 size=3&gt; array
to the &lt;/font&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: teal; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;Assembly[]&lt;/span&gt;&lt;font face=Calibri color=#000000 size=3&gt; that
it already has.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;It then populates that
array with the assembly name of each of the assemblies. After the assembly name array
is populated, the method returns that array of serializable objects back to the caller,
which happens to be on the other side of the appdomain boundary. And how does one
call such a method on the other side of the appdomain boundary? Easy:&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; 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;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: teal"&gt;AssemblyName&lt;/span&gt;&lt;font color=#000000&gt;[]
asmNames = host.GetAssemblyNames();&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;o:p&gt;
&lt;font face=Calibri color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;font face=Calibri color=#000000 size=3&gt;This ease of cross-boundary calls is the beauty
of .NET Remoting. You just call methods as if the instances were located directly
beside you. Cool.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;font face=Calibri color=#000000 size=3&gt;Well, that’s now about it. Let’s take a look
at the whole program:&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;font face=Calibri color=#000000 size=3&gt;Main program:&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;using&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt; System;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;using&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt; System.Reflection;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;using&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt; DomainHost;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; 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;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;namespace&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt; GetAssemblyNamesFromDomain&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt;{&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; 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;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;class&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: teal"&gt;Program&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; 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;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;static&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;void&lt;/span&gt;&lt;font color=#000000&gt; Main(&lt;/font&gt;&lt;span style="COLOR: blue"&gt;string&lt;/span&gt;&lt;font color=#000000&gt;[]
args)&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&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;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; 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;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: teal"&gt;AppDomain&lt;/span&gt;&lt;font color=#000000&gt; domain;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; 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;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: teal"&gt;Host&lt;/span&gt;&lt;font color=#000000&gt; host;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; 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;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: teal"&gt;AssemblyName&lt;/span&gt;&lt;font color=#000000&gt;[]
asmNames;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; 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;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; 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;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: green"&gt;//Create
new domain&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&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;domain
= &lt;/font&gt;&lt;span style="COLOR: teal"&gt;AppDomain&lt;/span&gt;&lt;font color=#000000&gt;.CreateDomain(&lt;/font&gt;&lt;span style="COLOR: maroon"&gt;"domain2"&lt;/span&gt;&lt;font color=#000000&gt;);&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: 0.5in; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;//Load
assembly in domain2 and create instance of DomainHost.Host&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: 0.5in; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;//A
reference to the instance of DomainHost.Host is returned&lt;/span&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: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&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;host
= (&lt;/font&gt;&lt;span style="COLOR: teal"&gt;Host&lt;/span&gt;&lt;font color=#000000&gt;)domain.CreateInstanceAndUnwrap(&lt;/font&gt;&lt;span style="COLOR: maroon"&gt;"DomainHost"&lt;/span&gt;&lt;font color=#000000&gt;, &lt;/font&gt;&lt;span style="COLOR: maroon"&gt;"DomainHost.Host"&lt;/span&gt;&lt;font color=#000000&gt;);&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; 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;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; 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;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: green"&gt;//Most
obvious method for getting the list of loaded assemblies.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; 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;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: green"&gt;//This
method will cause the assemblies in the remote domain to&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; 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;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: green"&gt;//be
loaded in this domain, which frequently won't work. Ouch!&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; 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;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: green"&gt;//domain.GetAssemblies();&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: green; 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: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&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;asmNames
= host.GetAssemblyNames();&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; 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;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: teal"&gt;Console&lt;/span&gt;&lt;font color=#000000&gt;.WriteLine();&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; 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;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: teal"&gt;Console&lt;/span&gt;&lt;font color=#000000&gt;.WriteLine(&lt;/font&gt;&lt;span style="COLOR: maroon"&gt;"Printing
assemblies:"&lt;/span&gt;&lt;font color=#000000&gt;);&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; 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;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;foreach&lt;/span&gt;&lt;font color=#000000&gt; (&lt;/font&gt;&lt;span style="COLOR: teal"&gt;AssemblyName&lt;/span&gt;&lt;font color=#000000&gt; asmName &lt;/font&gt;&lt;span style="COLOR: blue"&gt;in&lt;/span&gt;&lt;font color=#000000&gt; asmNames)&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&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;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; 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;&lt;font color=#000000&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; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: teal"&gt;Console&lt;/span&gt;&lt;font color=#000000&gt;.WriteLine(asmName.FullName);&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&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;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; 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;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&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;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt;}&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;o:p&gt;
&lt;font face=Calibri color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;font face=Calibri color=#000000 size=3&gt;DomainHost.Host (in DomainHost.dll)&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;using&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt; System;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;using&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt; System.Reflection;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; 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;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;namespace&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt; DomainHost&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt;{&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; 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;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;public&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;class&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: teal"&gt;Host&lt;/span&gt;&lt;font color=#000000&gt; : &lt;/font&gt;&lt;span style="COLOR: teal"&gt;MarshalByRefObject&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; 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;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;public&lt;/span&gt;&lt;font color=#000000&gt; Host()&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&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;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; 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;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: teal"&gt;Console&lt;/span&gt;&lt;font color=#000000&gt;.WriteLine(&lt;/font&gt;&lt;span style="COLOR: maroon"&gt;"Loading
host in domain {0}"&lt;/span&gt;&lt;font color=#000000&gt;,&lt;/font&gt;&lt;span style="COLOR: teal"&gt;AppDomain&lt;/span&gt;&lt;font color=#000000&gt;.CurrentDomain.FriendlyName);&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&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;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; 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;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; 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;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;public&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: teal"&gt;AssemblyName&lt;/span&gt;&lt;font color=#000000&gt;[]
GetAssemblyNames()&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&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;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; 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;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: teal"&gt;AssemblyName&lt;/span&gt;&lt;font color=#000000&gt;[]
names;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; 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;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: teal"&gt;Assembly&lt;/span&gt;&lt;font color=#000000&gt;[]
asms;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; 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;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&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;asms
= &lt;/font&gt;&lt;span style="COLOR: teal"&gt;AppDomain&lt;/span&gt;&lt;font color=#000000&gt;.CurrentDomain.GetAssemblies();&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&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;names
= &lt;/font&gt;&lt;span style="COLOR: blue"&gt;new&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: teal"&gt;AssemblyName&lt;/span&gt;&lt;font color=#000000&gt;[asms.Length];&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; 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;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; 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;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;for&lt;/span&gt;&lt;font color=#000000&gt; (&lt;/font&gt;&lt;span style="COLOR: teal"&gt;Int32&lt;/span&gt;&lt;font color=#000000&gt; i
= 0; i &amp;lt; asms.Length; i++ )&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&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;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;names[i]
= asms[i].GetName();&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&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;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; 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;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; 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;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;return&lt;/span&gt;&lt;font color=#000000&gt; names;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&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;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; 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;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt;}&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;o:p&gt;
&lt;font face=Calibri color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;font face=Calibri color=#000000 size=3&gt;The output of the program looks like:&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;
&lt;font face=Calibri color=#000000 size=3&gt;Loading host in domain domain2&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;
&lt;font face=Calibri color=#000000 size=3&gt;Printing assemblies:&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;
&lt;font face=Calibri color=#000000 size=3&gt;mscorlib, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;
&lt;font face=Calibri color=#000000 size=3&gt;Microsoft.VisualStudio.HostingProcess.Utilities,
Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;
&lt;font face=Calibri color=#000000 size=3&gt;DomainHost, Version=1.0.0.0, Culture=neutral,
PublicKeyToken=null&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;o:p&gt;
&lt;font face=Calibri color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;font face=Calibri color=#000000 size=3&gt;The fact that I see “Microsoft.VisualStudio.HostingProcess.Utilities”
loaded is a VS weirdness. VS is loading an assembly in domain2 to somehow “help me”,
but I don’t know why. This only occurs when I’m running/debugging my app through VS.
If I run the program outside of VS, I don’t see that assembly loaded. You have noticed
executables ending in vshost.exe. That’s a similar issue, but for another day.&lt;/font&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://hoser.lander.ca/aggbug.ashx?id=d96d6c72-c981-49a0-a50f-654dda2da2d1" /&gt;</description>
      <comments>http://hoser.lander.ca/CommentView,guid,d96d6c72-c981-49a0-a50f-654dda2da2d1.aspx</comments>
      <category>AppDomains</category>
      <category>Code Samples</category>
      <category>Loader</category>
    </item>
    <item>
      <trackback:ping>http://hoser.lander.ca/Trackback.aspx?guid=9595f71a-5137-4d06-b9c0-8bd1b0726439</trackback:ping>
      <pingback:server>http://hoser.lander.ca/pingback.aspx</pingback:server>
      <pingback:target>http://hoser.lander.ca/PermaLink,guid,9595f71a-5137-4d06-b9c0-8bd1b0726439.aspx</pingback:target>
      <dc:creator>Rich Lander</dc:creator>
      <wfw:comment>http://hoser.lander.ca/CommentView,guid,9595f71a-5137-4d06-b9c0-8bd1b0726439.aspx</wfw:comment>
      <wfw:commentRss>http://hoser.lander.ca/SyndicationService.asmx/GetEntryCommentsRss?guid=9595f71a-5137-4d06-b9c0-8bd1b0726439</wfw:commentRss>
      <slash:comments>2</slash:comments>
      <title>How to avoid assembly loads</title>
      <guid isPermaLink="false">http://hoser.lander.ca/PermaLink,guid,9595f71a-5137-4d06-b9c0-8bd1b0726439.aspx</guid>
      <link>http://hoser.lander.ca/2006/12/07/HowToAvoidAssemblyLoads.aspx</link>
      <pubDate>Thu, 07 Dec 2006 20:25:44 GMT</pubDate>
      <description>&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;font face=Calibri color=#000000 size=3&gt;A guy from a well-known company mailed me
asking how to avoid deploying statically referenced assemblies that he knows will
not be loaded at runtime. The issue is that the assembly is being loaded, but he doesn’t
believe that it is being actually used. His current workaround is to deploy the assembly
to avoid FileNotFound exceptions, which nobody likes.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;font face=Calibri color=#000000 size=3&gt;I have two questions for the guy:&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoListParagraph style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l1 level1 lfo1"&gt;
&lt;font face="Times New Roman"&gt;&lt;span style="mso-fareast-font-family: 'Times New Roman'"&gt;&lt;span style="mso-list: Ignore"&gt;&lt;font color=#000000&gt;&lt;font size=3&gt;1.&lt;/font&gt;&lt;span style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font color=#000000 size=3&gt;Why
are you so certain that the assembly will not be needed?&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoListParagraph style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l1 level1 lfo1"&gt;
&lt;font face="Times New Roman"&gt;&lt;span style="mso-fareast-font-family: 'Times New Roman'"&gt;&lt;span style="mso-list: Ignore"&gt;&lt;font color=#000000&gt;&lt;font size=3&gt;2.&lt;/font&gt;&lt;span style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font color=#000000 size=3&gt;Is
the assembly used in other scenarios, just not this one? There must be a reason that
it is statically referenced by your app in the first place.&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;
&lt;o:p&gt;
&lt;font face=Calibri color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;font face=Calibri color=#000000 size=3&gt;As you can guess, this whole exercise is a
bit of a dangerous situation. You can spend a lot of time ensuring that certain code
paths will never be called, and then your users do something unexpected and low-and-behold,
that darned FileNotFound exception is thrown. Ouch.&lt;/font&gt;
&lt;/p&gt;
&lt;h2 style="MARGIN: 10pt 0in 0pt"&gt;&lt;font face=Cambria color=#4f81bd size=4&gt;Why is this
a problem?&lt;/font&gt;
&lt;/h2&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;font face=Calibri color=#000000 size=3&gt;Anyway, the core of the problem is at the
level of the JIT (just-in-time compiler). The JIT jits code (MSIL) at a method-level
basis.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;The following is how things work
at a high-level:&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoListParagraph style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo2"&gt;
&lt;font face="Times New Roman"&gt;&lt;span style="mso-fareast-font-family: 'Times New Roman'"&gt;&lt;span style="mso-list: Ignore"&gt;&lt;font color=#000000&gt;&lt;font size=3&gt;1.&lt;/font&gt;&lt;span style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font color=#000000 size=3&gt;The
app calls a method&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoListParagraph style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo2"&gt;
&lt;font face="Times New Roman"&gt;&lt;span style="mso-fareast-font-family: 'Times New Roman'"&gt;&lt;span style="mso-list: Ignore"&gt;&lt;font color=#000000&gt;&lt;font size=3&gt;2.&lt;/font&gt;&lt;span style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font color=#000000 size=3&gt;The
method cannot be executed because it hasn’t yet been jitted to machine code&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoListParagraph style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo2"&gt;
&lt;font face="Times New Roman"&gt;&lt;span style="mso-fareast-font-family: 'Times New Roman'"&gt;&lt;span style="mso-list: Ignore"&gt;&lt;font color=#000000&gt;&lt;font size=3&gt;3.&lt;/font&gt;&lt;span style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font color=#000000 size=3&gt;The
JIT compiles the method (MSIL) into x86 (or X64 or IA64) code&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoListParagraph style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo2"&gt;
&lt;font face="Times New Roman"&gt;&lt;span style="mso-fareast-font-family: 'Times New Roman'"&gt;&lt;span style="mso-list: Ignore"&gt;&lt;font color=#000000&gt;&lt;font size=3&gt;4.&lt;/font&gt;&lt;span style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font color=#000000 size=3&gt;For
every method call that the JIT sees, it must fully understand the signature of that
method, specifically the return type and the arguments/parameters. This requirement
may cause an assembly load.&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoListParagraph style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo2"&gt;
&lt;font face="Times New Roman"&gt;&lt;span style="mso-fareast-font-family: 'Times New Roman'"&gt;&lt;span style="mso-list: Ignore"&gt;&lt;font color=#000000&gt;&lt;font size=3&gt;5.&lt;/font&gt;&lt;span style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font color=#000000 size=3&gt;The
method can now be called. The method will not need to be jitted again (at least in
this app domain).&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;o:p&gt;
&lt;font face=Calibri color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;font face=Calibri color=#000000 size=3&gt;For example, the return type might be a value
type, requiring the JIT to know how large that type is. To get that information, the
JIT must load the type, and must request that the assembly (in which the type is contained)
be loaded if it is not already loaded. This is still the case even if the method call
is within an if statement, and might not actually be called.&lt;/font&gt;
&lt;/p&gt;
&lt;h2 style="MARGIN: 10pt 0in 0pt"&gt;&lt;font face=Cambria color=#4f81bd size=4&gt;Code that
exposes the problem&lt;/font&gt;
&lt;/h2&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;font face=Calibri color=#000000 size=3&gt;As already suggested, you are going to run
into this problem anytime you have a direct cross-assembly method call anywhere in
a method you know that you will call, and hence JIT. This is even true under an if
statement where the condition will not be true in this scenario.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; 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;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;static&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;void&lt;/span&gt;&lt;font color=#000000&gt; Method1()&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&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;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; 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;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;if&lt;/span&gt;&lt;font color=#000000&gt; (condition)&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&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;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; 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;&lt;font color=#000000&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; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: green"&gt;//directly
calling method from ClassLibrary2&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; 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;&lt;font color=#000000&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; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: teal"&gt;Class2&lt;/span&gt;&lt;font color=#000000&gt;.Multiply(100,
200);&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&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;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;span style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&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;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;o:p&gt;
&lt;font face=Calibri color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;h2 style="MARGIN: 10pt 0in 0pt"&gt;&lt;font face=Cambria color=#4f81bd size=4&gt;Code that
avoids this problem&lt;/font&gt;
&lt;/h2&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;font face=Calibri color=#000000 size=3&gt;It is pretty easy to avoid this problem. Write
the following code instead.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; 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;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;static&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;void&lt;/span&gt;&lt;font color=#000000&gt; Method1()&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&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;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; 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;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;if&lt;/span&gt;&lt;font color=#000000&gt; (condition)&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&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;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; 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;&lt;font color=#000000&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; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: green"&gt;//indirectly
calling method from ClassLibrary2&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; 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;&lt;font color=#000000&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; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: teal"&gt;Method2()&lt;/span&gt;&lt;font color=#000000&gt;;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&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;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;span style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&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;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; 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;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;static&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;void&lt;/span&gt;&lt;font color=#000000&gt; Method2()&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&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;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; 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;&lt;font color=#000000&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; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: green"&gt;//directly
calling method from ClassLibrary2&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; 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;&lt;font color=#000000&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; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: teal"&gt;Class2&lt;/span&gt;&lt;font color=#000000&gt;.Multiply(100,
200);&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;span style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&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;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;font face=Calibri color=#000000 size=3&gt;As you can see, the call to &lt;/font&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: teal; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;Class2&lt;/span&gt;&lt;font color=#000000&gt;&lt;span style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;.Multiply()&lt;/span&gt;&lt;font face=Calibri size=3&gt; is
now an indirect call and does not require the JIT to know anything about the Class2
or require ClassLibrary2 to be loaded (the symptom to be avoided), unless of course
the condition is met and Method2() is called. This trick is a little awkward sometimes,
but it is a great option to at least defer and even completely avoid assembly loads.&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;h2 style="MARGIN: 10pt 0in 0pt"&gt;&lt;font face=Cambria color=#4f81bd size=4&gt;Gotcha&lt;/font&gt;
&lt;/h2&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;font face=Calibri color=#000000 size=3&gt;Unfortunately, there is a gotcha. The JIT
does optimize code by inlining methods. When this happens, you lose your indirect
call, and you are now in the same bad boat you were in before. I don’t know much about
the JIT inlining policy, so cannot provide a list of where this happens. This is merely
a caveat that my workaround doesn’t work in all cases. &lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/span&gt;If
folks are interested, I can talk to the folks on the JIT and perf teams to learn more
about this gotcha.&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://hoser.lander.ca/aggbug.ashx?id=9595f71a-5137-4d06-b9c0-8bd1b0726439" /&gt;</description>
      <comments>http://hoser.lander.ca/CommentView,guid,9595f71a-5137-4d06-b9c0-8bd1b0726439.aspx</comments>
      <category>Code Samples</category>
      <category>Loader</category>
    </item>
    <item>
      <trackback:ping>http://hoser.lander.ca/Trackback.aspx?guid=9807acb4-9197-44fc-bb37-35fce1974cbd</trackback:ping>
      <pingback:server>http://hoser.lander.ca/pingback.aspx</pingback:server>
      <pingback:target>http://hoser.lander.ca/PermaLink,guid,9807acb4-9197-44fc-bb37-35fce1974cbd.aspx</pingback:target>
      <dc:creator>Rich Lander</dc:creator>
      <wfw:comment>http://hoser.lander.ca/CommentView,guid,9807acb4-9197-44fc-bb37-35fce1974cbd.aspx</wfw:comment>
      <wfw:commentRss>http://hoser.lander.ca/SyndicationService.asmx/GetEntryCommentsRss?guid=9807acb4-9197-44fc-bb37-35fce1974cbd</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
We often talk about the loaded assemblies list over here. This is the list of assemblies
currently loaded in the app domain. Big surprise. There isn't anything incredible
special about this list. It is pretty easy to access and use. At the minimum, you
can print out the list of assemblies. Beyond that, you can load and instantiate any
of the types within those assemblies. That's where reflection comes in.
</p>
        <p>
Here's some code that prints out the list of loaded assemblies:
</p>
        <pre>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
            <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">using</span> System;<br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">using</span> System.Reflection;<br /><br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">namespace</span> GetLoadedAssemblies<br />
{<br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">class</span> Program<br />
{<br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">static</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">void</span> Main(<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">string</span>[]
args)<br />
{<br />
Assembly[] asms;<br /><br />
asms <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span> AppDomain.CurrentDomain.GetAssemblies();<br /><br />
Console.WriteLine(<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"There
are {0} assemblies loaded:"</span>, asms.Length);<br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">foreach</span> (Assembly
asm <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">in</span> asms)<br />
{<br />
Console.WriteLine(asm.FullName);<br />
}<br /><br />
Console.WriteLine();<br />
Console.WriteLine(<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"The
currently executing assembly is:"</span>);<br />
Console.WriteLine(Assembly.GetExecutingAssembly().FullName);<br /><br />
}<br />
}<br />
}<br /></span>
        </pre>
        <img width="0" height="0" src="http://hoser.lander.ca/aggbug.ashx?id=9807acb4-9197-44fc-bb37-35fce1974cbd" />
      </body>
      <title>Getting the list of loaded assemblies</title>
      <guid isPermaLink="false">http://hoser.lander.ca/PermaLink,guid,9807acb4-9197-44fc-bb37-35fce1974cbd.aspx</guid>
      <link>http://hoser.lander.ca/2006/12/05/GettingTheListOfLoadedAssemblies.aspx</link>
      <pubDate>Tue, 05 Dec 2006 23:51:00 GMT</pubDate>
      <description>&lt;p&gt;
We often talk about the loaded assemblies list over here. This is the list of assemblies
currently loaded in the app domain. Big surprise. There isn't anything incredible
special about this list. It is pretty easy to access and use. At the minimum, you
can print out the list of assemblies. Beyond that, you can load and instantiate any
of the types within those assemblies. That's where reflection comes in.
&lt;/p&gt;
&lt;p&gt;
Here's some code that prints out the list of loaded assemblies:
&lt;/p&gt;
&lt;pre&gt;&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;using&lt;/span&gt; System;&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;using&lt;/span&gt; System.Reflection;&lt;br&gt;
&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;namespace&lt;/span&gt; GetLoadedAssemblies&lt;br&gt;
{&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;class&lt;/span&gt; Program&lt;br&gt;
{&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;static&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;void&lt;/span&gt; Main(&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;string&lt;/span&gt;[]
args)&lt;br&gt;
{&lt;br&gt;
Assembly[] asms;&lt;br&gt;
&lt;br&gt;
asms &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; AppDomain.CurrentDomain.GetAssemblies();&lt;br&gt;
&lt;br&gt;
Console.WriteLine(&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"There
are {0} assemblies loaded:"&lt;/span&gt;, asms.Length);&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;foreach&lt;/span&gt; (Assembly
asm &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;in&lt;/span&gt; asms)&lt;br&gt;
{&lt;br&gt;
Console.WriteLine(asm.FullName);&lt;br&gt;
}&lt;br&gt;
&lt;br&gt;
Console.WriteLine();&lt;br&gt;
Console.WriteLine(&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"The
currently executing assembly is:"&lt;/span&gt;);&lt;br&gt;
Console.WriteLine(Assembly.GetExecutingAssembly().FullName);&lt;br&gt;
&lt;br&gt;
}&lt;br&gt;
}&lt;br&gt;
}&lt;br&gt;
&lt;/span&gt;&lt;/pre&gt;&lt;img width="0" height="0" src="http://hoser.lander.ca/aggbug.ashx?id=9807acb4-9197-44fc-bb37-35fce1974cbd" /&gt;</description>
      <comments>http://hoser.lander.ca/CommentView,guid,9807acb4-9197-44fc-bb37-35fce1974cbd.aspx</comments>
      <category>AppDomains</category>
      <category>Code Samples</category>
      <category>Loader</category>
    </item>
    <item>
      <trackback:ping>http://hoser.lander.ca/Trackback.aspx?guid=0947990c-3ca6-4e15-9a39-cfc609b5141b</trackback:ping>
      <pingback:server>http://hoser.lander.ca/pingback.aspx</pingback:server>
      <pingback:target>http://hoser.lander.ca/PermaLink,guid,0947990c-3ca6-4e15-9a39-cfc609b5141b.aspx</pingback:target>
      <dc:creator>Rich Lander</dc:creator>
      <wfw:comment>http://hoser.lander.ca/CommentView,guid,0947990c-3ca6-4e15-9a39-cfc609b5141b.aspx</wfw:comment>
      <wfw:commentRss>http://hoser.lander.ca/SyndicationService.asmx/GetEntryCommentsRss?guid=0947990c-3ca6-4e15-9a39-cfc609b5141b</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
I took another look at the FileVersion sample. I wish the API was actually a little
different. The API actually makes sense as a general use API, but it isn't as user-friendly
as I would like. I wish that there were an instance method on the Assembly class called
"GetFileVersion" or something like that it took nothing and returned a Version class.
</p>
        <p>
Here is more of less what it would look like, except that the GetFileVersion wouldn't
be static, it wouldn't take anything and would be on the assembly class.
</p>
        <p>
If you look @ the FileVersion class, there is a lot of stuff on there, and it is a
super wonky API anyway. I don't understand why it has a single static method that
more or less acts that the instance constructor. Why not just have a constructor that
takes a string or a FileInfo or even a FileStream. Bad API design. I prefer the Version
class a lot more since it is super simple. I
</p>
        <pre>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
            <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">using</span> System;<br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">using</span> System.Reflection;<br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">using</span> System.Diagnostics;<br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">namespace</span> FileVersion<br />
{<br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">class</span> Program<br />
{<br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">static</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">void</span> Main(<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">string</span>[]
args)<br />
{<br />
Assembly asm;<br />
Version ver;<br /><br />
asm <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span> Assembly.Load(<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"mscorlib,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"</span>);<br />
ver <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span> GetFileVersion(asm);<br />
Console.WriteLine(ver.ToString());<br />
}<br /><br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">static</span> Version
GetFileVersion(Assembly asm)<br />
{<br />
FileVersionInfo versionInfo;<br />
Version ver;<br /><br />
versionInfo <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span> FileVersionInfo.GetVersionInfo(asm.Location);<br />
ver <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">new</span> Version(versionInfo.FileMajorPart,
versionInfo.FileMinorPart, versionInfo.FileBuildPart, versionInfo.FilePrivatePart);<br /><br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">return</span> ver;<br />
}<br />
}<br />
}</span>
        </pre>
        <p>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
            <font face="Verdana" color="#003300" size="2">If
you look @ the FileVersion class, there is a lot of stuff on there, and it is a super
wonky API anyway. I don't understand why it has a single static method that more or
less acts like an instance constructor. Why not just have a constructor that takes
a string or a FileInfo or even a FileStream. Bad API design. I prefer the above method
(for the assembly case) that returns the Version class since it is super simple. I
realize that the native file version is a string, so can contain more stuff, but the
4-part version number is really all I want.</font>
            <br />
          </span>
        </p>
        <img width="0" height="0" src="http://hoser.lander.ca/aggbug.ashx?id=0947990c-3ca6-4e15-9a39-cfc609b5141b" />
      </body>
      <title>FileVersion Sample</title>
      <guid isPermaLink="false">http://hoser.lander.ca/PermaLink,guid,0947990c-3ca6-4e15-9a39-cfc609b5141b.aspx</guid>
      <link>http://hoser.lander.ca/2006/11/29/FileVersionSample.aspx</link>
      <pubDate>Wed, 29 Nov 2006 03:39:29 GMT</pubDate>
      <description>&lt;p&gt;
I took another look at the FileVersion sample. I wish the API was actually a little
different. The API actually makes sense as a general use API, but it isn't as user-friendly
as I would like. I wish that there were an instance method on the Assembly class called
"GetFileVersion" or something like that it took nothing and returned a Version class.
&lt;/p&gt;
&lt;p&gt;
Here is more of less what it would look like, except that the GetFileVersion wouldn't
be static, it wouldn't take anything and would be on the assembly class.
&lt;/p&gt;
&lt;p&gt;
If you look @ the FileVersion class, there is a lot of stuff on there, and it is a
super wonky API anyway. I don't understand why it has a single static method that
more or less acts that the instance constructor. Why not just have a constructor that
takes a string or a FileInfo or even a FileStream. Bad API design. I prefer the Version
class a lot more since it is super simple. I
&lt;/p&gt;
&lt;pre&gt;&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;using&lt;/span&gt; System;&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;using&lt;/span&gt; System.Reflection;&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;using&lt;/span&gt; System.Diagnostics;&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;namespace&lt;/span&gt; FileVersion&lt;br&gt;
{&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;class&lt;/span&gt; Program&lt;br&gt;
{&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;static&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;void&lt;/span&gt; Main(&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;string&lt;/span&gt;[]
args)&lt;br&gt;
{&lt;br&gt;
Assembly asm;&lt;br&gt;
Version ver;&lt;br&gt;
&lt;br&gt;
asm &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; Assembly.Load(&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"mscorlib,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"&lt;/span&gt;);&lt;br&gt;
ver &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; GetFileVersion(asm);&lt;br&gt;
Console.WriteLine(ver.ToString());&lt;br&gt;
}&lt;br&gt;
&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;static&lt;/span&gt; Version
GetFileVersion(Assembly asm)&lt;br&gt;
{&lt;br&gt;
FileVersionInfo versionInfo;&lt;br&gt;
Version ver;&lt;br&gt;
&lt;br&gt;
versionInfo &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; FileVersionInfo.GetVersionInfo(asm.Location);&lt;br&gt;
ver &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;new&lt;/span&gt; Version(versionInfo.FileMajorPart,
versionInfo.FileMinorPart, versionInfo.FileBuildPart, versionInfo.FilePrivatePart);&lt;br&gt;
&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;return&lt;/span&gt; ver;&lt;br&gt;
}&lt;br&gt;
}&lt;br&gt;
}&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;font face=Verdana color=#003300 size=2&gt;If
you look @ the FileVersion class, there is a lot of stuff on there, and it is a super
wonky API anyway. I don't understand why it has a single static method that more or
less acts like an instance constructor. Why not just have a constructor that takes
a string or a FileInfo or even a FileStream. Bad API design. I prefer the above method
(for the assembly case) that returns the Version class since it is super simple. I
realize that the native file version is a string, so can contain more stuff, but the
4-part version number is really all I want.&lt;/font&gt;
&lt;br&gt;
&lt;/p&gt;
&gt;&lt;img width="0" height="0" src="http://hoser.lander.ca/aggbug.ashx?id=0947990c-3ca6-4e15-9a39-cfc609b5141b" /&gt;</description>
      <comments>http://hoser.lander.ca/CommentView,guid,0947990c-3ca6-4e15-9a39-cfc609b5141b.aspx</comments>
      <category>Code Samples</category>
      <category>Loader</category>
      <category>Versioning</category>
    </item>
    <item>
      <trackback:ping>http://hoser.lander.ca/Trackback.aspx?guid=59fd3932-1564-4412-b94f-edf4a447302e</trackback:ping>
      <pingback:server>http://hoser.lander.ca/pingback.aspx</pingback:server>
      <pingback:target>http://hoser.lander.ca/PermaLink,guid,59fd3932-1564-4412-b94f-edf4a447302e.aspx</pingback:target>
      <dc:creator>Rich Lander</dc:creator>
      <wfw:comment>http://hoser.lander.ca/CommentView,guid,59fd3932-1564-4412-b94f-edf4a447302e.aspx</wfw:comment>
      <wfw:commentRss>http://hoser.lander.ca/SyndicationService.asmx/GetEntryCommentsRss?guid=59fd3932-1564-4412-b94f-edf4a447302e</wfw:commentRss>
      <title>Native File Version</title>
      <guid isPermaLink="false">http://hoser.lander.ca/PermaLink,guid,59fd3932-1564-4412-b94f-edf4a447302e.aspx</guid>
      <link>http://hoser.lander.ca/2006/11/29/NativeFileVersion.aspx</link>
      <pubDate>Wed, 29 Nov 2006 00:00:36 GMT</pubDate>
      <description>&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;font face=Calibri color=#000000 size=3&gt;The file version number is a native code concept
– meaning not originating from the .NET Framework. This version number is a resource
found within the resource section of the &lt;/font&gt;&lt;a href="http://www.microsoft.com/whdc/system/platform/firmware/PECOFF.mspx"&gt;&lt;font face=Calibri size=3&gt;windows
PE (portable executable) format&lt;/font&gt;&lt;/a&gt;&lt;font face=Calibri color=#000000 size=3&gt; of
a managed or native code dll. This resource is named “FILEVERSION”. This version number
is used for information purposes only, not for any runtime purposes such as binding.
In addition, this version number does not have to conform to a particular format,
but is only a string, although it does typically takes the form of a simple four-part
number (i.e. 1.2.3.4).&lt;/font&gt;
&lt;/p&gt;
&lt;h3 style="MARGIN: 10pt 0in 0pt"&gt;&lt;font face=Cambria color=#4f81bd size=3&gt;Reading the
File Version&lt;/font&gt;
&lt;/h3&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;font face=Calibri color=#000000 size=3&gt;The easiest way to view this number is to
view the properties of a file in Windows Explorer. The version number listed is the
file version number. The product version is also listed, although I don’t know how
the two numbers differ exactly. Naturally, you can access the file version from code.
The following code does just that, largely using the &lt;/font&gt;&lt;span style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt;System.Diagnostics.&lt;/font&gt;&lt;span style="COLOR: teal"&gt;FileVersionInfo&lt;/span&gt;&lt;/span&gt;&lt;font face=Calibri color=#000000 size=3&gt; class,
which I’ve never used before. In fact, I had to ask someone else on the loader team
for that information.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;using&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt; System;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;using&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt; System.Reflection;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;using&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt; System.Diagnostics;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;namespace&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt; FileVersion&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt;{&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; 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;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;class&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: teal"&gt;Program&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; 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;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;static&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;void&lt;/span&gt;&lt;font color=#000000&gt; Main(&lt;/font&gt;&lt;span style="COLOR: blue"&gt;string&lt;/span&gt;&lt;font color=#000000&gt;[]
args)&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&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;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; 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;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: teal"&gt;Assembly&lt;/span&gt;&lt;font color=#000000&gt; asm
= &lt;/font&gt;&lt;span style="COLOR: teal"&gt;Assembly&lt;/span&gt;&lt;font color=#000000&gt;.Load(&lt;/font&gt;&lt;span style="COLOR: maroon"&gt;"mscorlib,
Version=2.0.0.0, Culture=neutral, &amp;nbsp;PublicKeyToken=b77a5c561934e089"&lt;/span&gt;&lt;font color=#000000&gt;);&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&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;System.Diagnostics.&lt;/font&gt;&lt;span style="COLOR: teal"&gt;FileVersionInfo&lt;/span&gt;&lt;font color=#000000&gt; fvi
= &lt;/font&gt;&lt;span style="COLOR: teal"&gt;FileVersionInfo&lt;/span&gt;&lt;font color=#000000&gt;.GetVersionInfo(asm.Location);&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; 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;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: teal"&gt;Console&lt;/span&gt;&lt;font color=#000000&gt;.WriteLine(fvi.FileVersion);&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&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;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt;}&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;o:p&gt;
&lt;font face=Calibri color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;h3 style="MARGIN: 10pt 0in 0pt"&gt;&lt;font face=Cambria color=#4f81bd size=3&gt;Setting the
File Version&lt;/font&gt;
&lt;/h3&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;font face=Calibri color=#000000 size=3&gt;The CLR provides an assembly-level custom
attribute to set this version number for an assembly from managed code. This attribute
is called &lt;/font&gt;&lt;span style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt;System.Reflection.&lt;/font&gt;&lt;span style="COLOR: teal"&gt;AssemblyFileVersion&lt;/span&gt;&lt;/span&gt;&lt;font face=Calibri color=#000000 size=3&gt;.
You can see how to set it below.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;using&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt; System;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;using&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt; System.Reflection;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; 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;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt;[assembly:System.Reflection.&lt;/font&gt;&lt;span style="COLOR: teal"&gt;AssemblyFileVersion&lt;/span&gt;&lt;font color=#000000&gt;(&lt;/font&gt;&lt;span style="COLOR: maroon"&gt;"2.3.4.5"&lt;/span&gt;&lt;font color=#000000&gt;)]&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; 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;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;namespace&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt; ConsoleApplication1&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt;{&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; 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;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;class&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: teal"&gt;Program&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; 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;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;static&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;void&lt;/span&gt;&lt;font color=#000000&gt; Main(&lt;/font&gt;&lt;span style="COLOR: blue"&gt;string&lt;/span&gt;&lt;font color=#000000&gt;[]
args)&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&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;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&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;Console.WriteLine(&lt;/font&gt;&lt;span style="COLOR: maroon"&gt;"I
just set the file version!"&lt;/span&gt;&lt;font color=#000000&gt;);&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&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;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt;}&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;o:p&gt;
&lt;font face=Calibri color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;font face=Calibri color=#000000 size=3&gt;You can actually set this attribute in Visual
Studio 2005 via the properties menu. In that case, you cannot set it in code, as I’ve
done above, since you’ll then have two instances of the attribute. You only need to
set the attribute directly, as I’ve done&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;above,
if you are using the compiler directly, from the commandline.&lt;/font&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://hoser.lander.ca/aggbug.ashx?id=59fd3932-1564-4412-b94f-edf4a447302e" /&gt;</description>
      <comments>http://hoser.lander.ca/CommentView,guid,59fd3932-1564-4412-b94f-edf4a447302e.aspx</comments>
      <category>Code Samples</category>
      <category>Loader</category>
      <category>Versioning</category>
    </item>
    <item>
      <trackback:ping>http://hoser.lander.ca/Trackback.aspx?guid=6effcb5f-d4c9-491a-84d5-05ec8306c6d8</trackback:ping>
      <pingback:server>http://hoser.lander.ca/pingback.aspx</pingback:server>
      <pingback:target>http://hoser.lander.ca/PermaLink,guid,6effcb5f-d4c9-491a-84d5-05ec8306c6d8.aspx</pingback:target>
      <dc:creator>Rich Lander</dc:creator>
      <wfw:comment>http://hoser.lander.ca/CommentView,guid,6effcb5f-d4c9-491a-84d5-05ec8306c6d8.aspx</wfw:comment>
      <wfw:commentRss>http://hoser.lander.ca/SyndicationService.asmx/GetEntryCommentsRss?guid=6effcb5f-d4c9-491a-84d5-05ec8306c6d8</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
          <font color="#000000">Versioning and version numbers are always a bit confusing. For
the CLR and the .NET Framework, we’ve got lots of version numbers to think about.
I’d like to debunk any confusion around them, explain what each version number means,
how to view it and how to set it (if appropriate). Let’s take a look …</font>
        </p>
        <p class="MsoNormal" style="MARGIN: 0in 0in 10pt">
          <font color="#000000">The version numbers that I’m going to discuss are:</font>
        </p>
        <p class="MsoListParagraphCxSpFirst" style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo1">
          <font color="#000000">
            <font face="Verdana">
              <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
                <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'"><font size="2">         </font></span></span>
              </span>Native
file version</font>
          </font>
        </p>
        <p class="MsoListParagraphCxSpMiddle" style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo1">
          <font color="#000000">
            <font face="Verdana">
              <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
                <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'"><font size="2">         </font></span></span>
              </span>Managed
assembly version</font>
          </font>
        </p>
        <p class="MsoListParagraphCxSpMiddle" style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo1">
          <font color="#000000">
            <font face="Verdana">
              <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
                <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'"><font size="2">         </font></span></span>
              </span>Metadata
version</font>
          </font>
        </p>
        <p class="MsoListParagraphCxSpMiddle" style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo1">
          <font color="#000000">
            <font face="Verdana">
              <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
                <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'"><font size="2">         </font></span></span>
              </span>Metadata
format version</font>
          </font>
        </p>
        <p class="MsoListParagraphCxSpLast" style="MARGIN: 0in 0in 10pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo1">
          <font color="#000000">
            <font face="Verdana">
              <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
                <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'"><font size="2">         </font></span></span>
              </span>.NET
Framework versions</font>
          </font>
        </p>
        <p class="MsoNormal" style="MARGIN: 0in 0in 10pt">
          <font color="#000000">I’m going to discuss these version numbers (and anything else
that comes up) across the next few posts.</font>
        </p>
        <img width="0" height="0" src="http://hoser.lander.ca/aggbug.ashx?id=6effcb5f-d4c9-491a-84d5-05ec8306c6d8" />
      </body>
      <title>.NET Framework Versions Numbers</title>
      <guid isPermaLink="false">http://hoser.lander.ca/PermaLink,guid,6effcb5f-d4c9-491a-84d5-05ec8306c6d8.aspx</guid>
      <link>http://hoser.lander.ca/2006/11/28/NETFrameworkVersionsNumbers.aspx</link>
      <pubDate>Tue, 28 Nov 2006 23:53:35 GMT</pubDate>
      <description>&lt;p&gt;
&lt;font color=#000000&gt;Versioning and version numbers are always a bit confusing. For
the CLR and the .NET Framework, we’ve got lots of version numbers to think about.
I’d like to debunk any confusion around them, explain what each version number means,
how to view it and how to set it (if appropriate). Let’s take a look …&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;font color=#000000&gt;The version numbers that I’m going to discuss are:&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoListParagraphCxSpFirst style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo1"&gt;
&lt;font color=#000000&gt;&lt;font face=Verdana&gt;&lt;span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"&gt;&lt;span style="mso-list: Ignore"&gt;·&lt;span style="FONT: 7pt 'Times New Roman'"&gt;&lt;font size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;Native
file version&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo1"&gt;
&lt;font color=#000000&gt;&lt;font face=Verdana&gt;&lt;span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"&gt;&lt;span style="mso-list: Ignore"&gt;·&lt;span style="FONT: 7pt 'Times New Roman'"&gt;&lt;font size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;Managed
assembly version&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo1"&gt;
&lt;font color=#000000&gt;&lt;font face=Verdana&gt;&lt;span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"&gt;&lt;span style="mso-list: Ignore"&gt;·&lt;span style="FONT: 7pt 'Times New Roman'"&gt;&lt;font size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;Metadata
version&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo1"&gt;
&lt;font color=#000000&gt;&lt;font face=Verdana&gt;&lt;span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"&gt;&lt;span style="mso-list: Ignore"&gt;·&lt;span style="FONT: 7pt 'Times New Roman'"&gt;&lt;font size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;Metadata
format version&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoListParagraphCxSpLast style="MARGIN: 0in 0in 10pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo1"&gt;
&lt;font color=#000000&gt;&lt;font face=Verdana&gt;&lt;span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"&gt;&lt;span style="mso-list: Ignore"&gt;·&lt;span style="FONT: 7pt 'Times New Roman'"&gt;&lt;font size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;.NET
Framework versions&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;font color=#000000&gt;I’m going to discuss these version numbers (and anything else
that comes up) across the next few posts.&lt;/font&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://hoser.lander.ca/aggbug.ashx?id=6effcb5f-d4c9-491a-84d5-05ec8306c6d8" /&gt;</description>
      <comments>http://hoser.lander.ca/CommentView,guid,6effcb5f-d4c9-491a-84d5-05ec8306c6d8.aspx</comments>
      <category>Loader</category>
      <category>Versioning</category>
    </item>
    <item>
      <trackback:ping>http://hoser.lander.ca/Trackback.aspx?guid=78361ed5-e944-4b22-8395-e86c79e3ee3f</trackback:ping>
      <pingback:server>http://hoser.lander.ca/pingback.aspx</pingback:server>
      <pingback:target>http://hoser.lander.ca/PermaLink,guid,78361ed5-e944-4b22-8395-e86c79e3ee3f.aspx</pingback:target>
      <dc:creator>Rich Lander</dc:creator>
      <wfw:comment>http://hoser.lander.ca/CommentView,guid,78361ed5-e944-4b22-8395-e86c79e3ee3f.aspx</wfw:comment>
      <wfw:commentRss>http://hoser.lander.ca/SyndicationService.asmx/GetEntryCommentsRss?guid=78361ed5-e944-4b22-8395-e86c79e3ee3f</wfw:commentRss>
      <title>Assembly Identity Concept</title>
      <guid isPermaLink="false">http://hoser.lander.ca/PermaLink,guid,78361ed5-e944-4b22-8395-e86c79e3ee3f.aspx</guid>
      <link>http://hoser.lander.ca/2006/11/02/AssemblyIdentityConcept.aspx</link>
      <pubDate>Thu, 02 Nov 2006 23:12:05 GMT</pubDate>
      <description>&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt; LINE-HEIGHT: normal; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto"&gt;
&lt;span style="FONT-SIZE: 12pt; COLOR: #003300; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;I
made reference to the concept of &lt;a href="http://hoser.lander.ca/Loading+By+Identity.aspx"&gt;&lt;span style="COLOR: blue"&gt;textual
identity&lt;/span&gt;&lt;/a&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt; in
my last post, but didn’t go into a lot of detail. In this post, I’d like to describe
the broader concept of assembly identity to provide folks with further insight as
to what I was going on about. The following text is from a spec that I wrote; it should
apply equally to v1.0, v1.1 and v2.0 and future .NET Framework versions.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;
&lt;a name=_Toc147904556&gt;&lt;span style="FONT-SIZE: 13.5pt; COLOR: #0072bc; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;Assembly
Identity&lt;/span&gt;&lt;/a&gt;&lt;span style="mso-bookmark: _Toc147904556"&gt;&lt;/span&gt;&lt;span style="FONT-SIZE: 12pt; COLOR: #003300; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;
&lt;span style="FONT-SIZE: 12pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;The
assembly identity is the name of an assembly. The filename, path, file hash or other
characteristics are not part of the identity. The identity is used in two different
ways: (1) to define the name of an assembly, and (2) to reference an assembly by name.
These are sometimes referred to as “def” and “ref”. Both of these are assembly identity.
In the case of a reference, the identity is used during binding to determine if and
where an assembly is available.&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #003300; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: #003300; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;
&lt;a name=_Toc146619192&gt;&lt;/a&gt;&lt;a name=_Toc147205706&gt;&lt;/a&gt;&lt;a name=_Toc147904557&gt;&lt;span style="mso-bookmark: _Toc147205706"&gt;&lt;span style="mso-bookmark: _Toc146619192"&gt;&lt;span style="FONT-SIZE: 12pt; COLOR: #0072bc; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;Identity
Composition&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;span style="mso-bookmark: _Toc146619192"&gt;&lt;/span&gt;&lt;span style="mso-bookmark: _Toc147205706"&gt;&lt;/span&gt;&lt;span style="mso-bookmark: _Toc147904557"&gt;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #003300; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;
&lt;span style="FONT-SIZE: 12pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;The
assembly identity is composed of several distinct attributes that detail different
characteristics about an assembly. Each attribute is used in binding if it is provided.
The allowed attributes follow:&lt;/span&gt;&lt;span style="FONT-SIZE: 12pt; COLOR: #003300; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;
&lt;span style="FONT-SIZE: 12pt; COLOR: #003300; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in; LINE-HEIGHT: normal"&gt;
&lt;span style="FONT-SIZE: 12pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: Symbol"&gt;·&lt;/span&gt;&lt;span style="FONT-SIZE: 7pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: Symbol"&gt;&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;&lt;span style="FONT-SIZE: 12pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;Simple
name 
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/b&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt 1in; LINE-HEIGHT: normal; tab-stops: list 1.0in"&gt;
&lt;span style="FONT-SIZE: 12pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Courier New'"&gt;o&lt;/span&gt;&lt;span style="FONT-SIZE: 7pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;span style="FONT-SIZE: 12pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;Format:&lt;/span&gt;&lt;/b&gt;&lt;span style="FONT-SIZE: 12pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt; string &lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #003300; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt 1in; LINE-HEIGHT: normal; tab-stops: list 1.0in"&gt;
&lt;span style="FONT-SIZE: 12pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Courier New'"&gt;o&lt;/span&gt;&lt;span style="FONT-SIZE: 7pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;span style="FONT-SIZE: 12pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;Description:&lt;/span&gt;&lt;/b&gt;&lt;span style="FONT-SIZE: 12pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt; The
name is the simple name of the assembly. It is essentially the name without all the
other attributes&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #003300; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt 1in; LINE-HEIGHT: normal; tab-stops: list 1.0in"&gt;
&lt;span style="FONT-SIZE: 12pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Courier New'"&gt;o&lt;/span&gt;&lt;span style="FONT-SIZE: 7pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;span style="FONT-SIZE: 12pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;Note:&lt;/span&gt;&lt;/b&gt;&lt;span style="FONT-SIZE: 12pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt; The
name should always be the same as filename minus extension&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #003300; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in; LINE-HEIGHT: normal"&gt;
&lt;span style="FONT-SIZE: 12pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: Symbol"&gt;·&lt;/span&gt;&lt;span style="FONT-SIZE: 7pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: Symbol"&gt;&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;&lt;span style="FONT-SIZE: 12pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;Version&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/b&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt 1in; LINE-HEIGHT: normal; tab-stops: list 1.0in"&gt;
&lt;span style="FONT-SIZE: 12pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Courier New'"&gt;o&lt;/span&gt;&lt;span style="FONT-SIZE: 7pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;span style="FONT-SIZE: 12pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;Format:&lt;/span&gt;&lt;/b&gt;&lt;span style="FONT-SIZE: 12pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt; Four
16-bit integers separated by “.”&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #003300; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt 1in; LINE-HEIGHT: normal; tab-stops: list 1.0in"&gt;
&lt;span style="FONT-SIZE: 12pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Courier New'"&gt;o&lt;/span&gt;&lt;span style="FONT-SIZE: 7pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;span style="FONT-SIZE: 12pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;Description:&lt;/span&gt;&lt;/b&gt;&lt;span style="FONT-SIZE: 12pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt; A
four-part version number (Major.Minor.Build.Revision)&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #003300; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt 1in; LINE-HEIGHT: normal; tab-stops: list 1.0in"&gt;
&lt;span style="FONT-SIZE: 12pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Courier New'"&gt;o&lt;/span&gt;&lt;span style="FONT-SIZE: 7pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;span style="FONT-SIZE: 12pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;Note:&lt;/span&gt;&lt;/b&gt;&lt;span style="FONT-SIZE: 12pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt; Each
one of the 16-bit integers overflow at 165536 and underflow at -1&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #003300; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in; LINE-HEIGHT: normal"&gt;
&lt;span style="FONT-SIZE: 12pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: Symbol"&gt;·&lt;/span&gt;&lt;span style="FONT-SIZE: 7pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: Symbol"&gt;&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;&lt;span style="FONT-SIZE: 12pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;PublicKeyToken
or PublicKey&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/b&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt 1in; LINE-HEIGHT: normal; tab-stops: list 1.0in"&gt;
&lt;span style="FONT-SIZE: 12pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Courier New'"&gt;o&lt;/span&gt;&lt;span style="FONT-SIZE: 7pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;span style="FONT-SIZE: 12pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;Format: &lt;/span&gt;&lt;/b&gt;&lt;span style="FONT-SIZE: 12pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;An
8-byte or variable length (48- to 2048-byte) string, respectively or “neutral” or
“null”&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #003300; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt 1in; LINE-HEIGHT: normal; tab-stops: list 1.0in"&gt;
&lt;span style="FONT-SIZE: 12pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Courier New'"&gt;o&lt;/span&gt;&lt;span style="FONT-SIZE: 7pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;span style="FONT-SIZE: 12pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;Description:&lt;/span&gt;&lt;/b&gt;&lt;span style="FONT-SIZE: 12pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt; The
public key token or key specifies the cryptographic signature of an assembly, guaranteeing
that the assembly is from a particular publisher or set of assemblies (with that same
token or key)&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #003300; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt 1in; LINE-HEIGHT: normal; tab-stops: list 1.0in"&gt;
&lt;span style="FONT-SIZE: 12pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Courier New'"&gt;o&lt;/span&gt;&lt;span style="FONT-SIZE: 7pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;span style="FONT-SIZE: 12pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;Note:&lt;/span&gt;&lt;/b&gt;&lt;span style="FONT-SIZE: 12pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt; The
token is almost always provided instead of the much longer key&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #003300; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in; LINE-HEIGHT: normal"&gt;
&lt;span style="FONT-SIZE: 12pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: Symbol"&gt;·&lt;/span&gt;&lt;span style="FONT-SIZE: 7pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: Symbol"&gt;&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;&lt;span style="FONT-SIZE: 12pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;Culture&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/b&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt 1in; LINE-HEIGHT: normal; tab-stops: list 1.0in"&gt;
&lt;span style="FONT-SIZE: 12pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Courier New'"&gt;o&lt;/span&gt;&lt;span style="FONT-SIZE: 7pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;span style="FONT-SIZE: 12pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;Format:&lt;/span&gt;&lt;/b&gt;&lt;span style="FONT-SIZE: 12pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt; string
or “neutral” or “null”&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #003300; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt 1in; LINE-HEIGHT: normal; tab-stops: list 1.0in"&gt;
&lt;span style="FONT-SIZE: 12pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Courier New'"&gt;o&lt;/span&gt;&lt;span style="FONT-SIZE: 7pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;span style="FONT-SIZE: 12pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;Description:&lt;/span&gt;&lt;/b&gt;&lt;span style="FONT-SIZE: 12pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt; An
arbitrary string that represents a culture installed on the system&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #003300; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in; LINE-HEIGHT: normal"&gt;
&lt;span style="FONT-SIZE: 12pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: Symbol"&gt;·&lt;/span&gt;&lt;span style="FONT-SIZE: 7pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: Symbol"&gt;&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;&lt;span style="FONT-SIZE: 12pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;ProcessorArchitecture&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/b&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt 1in; LINE-HEIGHT: normal; tab-stops: list 1.0in"&gt;
&lt;span style="FONT-SIZE: 12pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Courier New'"&gt;o&lt;/span&gt;&lt;span style="FONT-SIZE: 7pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;span style="FONT-SIZE: 12pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;Format:&lt;/span&gt;&lt;/b&gt;&lt;span style="FONT-SIZE: 12pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;“MSIL”
or “X86” or “X64” or “IA64”&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #003300; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt 1in; LINE-HEIGHT: normal; tab-stops: list 1.0in"&gt;
&lt;span style="FONT-SIZE: 12pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Courier New'"&gt;o&lt;/span&gt;&lt;span style="FONT-SIZE: 7pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;span style="FONT-SIZE: 12pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;Description:&lt;/span&gt;&lt;/b&gt;&lt;span style="FONT-SIZE: 12pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt; The
processor architecture (PA) attribute specifies the requirement of a particular platform
to execute a particular assembly. “MSIL” is an agnostic PA, as “MSIL” assemblies are
allowed to be executed on any processor. All other PA options are “bit-specific” and
must be run on a specific platform.&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #003300; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt 1in; LINE-HEIGHT: normal; tab-stops: list 1.0in"&gt;
&lt;span style="FONT-SIZE: 12pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Courier New'"&gt;o&lt;/span&gt;&lt;span style="FONT-SIZE: 7pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;span style="FONT-SIZE: 12pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;Note:&lt;/span&gt;&lt;/b&gt;&lt;span style="FONT-SIZE: 12pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt; PA
doesn’t relate directly to processor or CPU. For example, X86 assemblies can be execute
on X64 machines using the WoW64 infrastructure.&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #003300; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in; LINE-HEIGHT: normal"&gt;
&lt;span style="FONT-SIZE: 12pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: Symbol"&gt;·&lt;/span&gt;&lt;span style="FONT-SIZE: 7pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: Symbol"&gt;&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;&lt;span style="FONT-SIZE: 12pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;Retargetable&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/b&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt 1in; LINE-HEIGHT: normal; tab-stops: list 1.0in"&gt;
&lt;span style="FONT-SIZE: 12pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Courier New'"&gt;o&lt;/span&gt;&lt;span style="FONT-SIZE: 7pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;span style="FONT-SIZE: 12pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;Format:&lt;/span&gt;&lt;/b&gt;&lt;span style="FONT-SIZE: 12pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt; “yes”
or “no”&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #003300; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt 1in; LINE-HEIGHT: normal; tab-stops: list 1.0in"&gt;
&lt;span style="FONT-SIZE: 12pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Courier New'"&gt;o&lt;/span&gt;&lt;span style="FONT-SIZE: 7pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;span style="FONT-SIZE: 12pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;Description:&lt;/span&gt;&lt;/b&gt;&lt;span style="FONT-SIZE: 12pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt; The
retargetable attribute specifies that an assembly can be retargeted to another assembly,
meaning a reference to another assembly can be retargeted to this one.&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #003300; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt 1in; LINE-HEIGHT: normal; tab-stops: list 1.0in"&gt;
&lt;span style="FONT-SIZE: 12pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Courier New'"&gt;o&lt;/span&gt;&lt;span style="FONT-SIZE: 7pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;span style="FONT-SIZE: 12pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;Note:&lt;/span&gt;&lt;/b&gt;&lt;span style="FONT-SIZE: 12pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt; The
retargeting mechanism is more complicated than described here, and is not at all a
common scenario&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #003300; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in; LINE-HEIGHT: normal; tab-stops: .5in"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: #003300; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;
&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;span style="FONT-SIZE: 12pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;Note:&lt;/span&gt;&lt;/b&gt;&lt;span style="FONT-SIZE: 12pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt; In
all cases, the attributes and enumeration values are matched during binding case insensitively. &lt;/span&gt;&lt;span style="FONT-SIZE: 12pt; COLOR: #003300; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;
&lt;span style="FONT-SIZE: 12pt; COLOR: #003300; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;
&lt;a name=_Toc146619196&gt;&lt;/a&gt;&lt;a name=_Toc147205710&gt;&lt;/a&gt;&lt;a name=_Toc147904561&gt;&lt;span style="mso-bookmark: _Toc147205710"&gt;&lt;span style="mso-bookmark: _Toc146619196"&gt;&lt;span style="FONT-SIZE: 12pt; COLOR: #0072bc; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;Textual
Identity&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;span style="mso-bookmark: _Toc146619196"&gt;&lt;/span&gt;&lt;span style="mso-bookmark: _Toc147205710"&gt;&lt;/span&gt;&lt;span style="mso-bookmark: _Toc147904561"&gt;&lt;/span&gt;&lt;span style="FONT-SIZE: 12pt; COLOR: #003300; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;
&lt;span style="FONT-SIZE: 12pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;The
assembly identity can be specified in a string format, most often referred to as a
“textual identity”. This form of the assembly identity is used by many APIs within
the .NET Framework. There are also APIs that parse the textual identity string and
return the identity back as a class, removing the need for developers to parse or
create a textual identity string. More on that class later.&lt;/span&gt;&lt;span style="FONT-SIZE: 12pt; COLOR: #003300; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;
&lt;span style="FONT-SIZE: 12pt; COLOR: #003300; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;
&lt;a name=_Toc146619197&gt;&lt;/a&gt;&lt;a name=_Toc147205711&gt;&lt;/a&gt;&lt;a name=_Toc147904562&gt;&lt;span style="mso-bookmark: _Toc147205711"&gt;&lt;span style="mso-bookmark: _Toc146619197"&gt;&lt;span style="FONT-SIZE: 12pt; COLOR: #0072bc; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;Textual
Identity Specification&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;span style="mso-bookmark: _Toc146619197"&gt;&lt;/span&gt;&lt;span style="mso-bookmark: _Toc147205711"&gt;&lt;/span&gt;&lt;span style="mso-bookmark: _Toc147904562"&gt;&lt;/span&gt;&lt;span style="FONT-SIZE: 12pt; COLOR: #003300; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;
&lt;span style="FONT-SIZE: 12pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;The
specification of this format follows:&lt;/span&gt;&lt;span style="FONT-SIZE: 12pt; COLOR: #003300; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;
&lt;span style="FONT-SIZE: 12pt; COLOR: #003300; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;
&lt;span style="FONT-SIZE: 12pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;simple_name
(“,” attribute “=” value)+&lt;/span&gt;&lt;span style="FONT-SIZE: 12pt; COLOR: #003300; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;
&lt;span style="FONT-SIZE: 12pt; COLOR: #003300; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;
&lt;span style="FONT-SIZE: 12pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;The
textual identity starts with the simple name, and then a set of attributes and their
values. Each attribute starts with a “,” and then its name, followed by a “=” and
then a quoted or non-quoted value for that attribute. Whitespace can occur pretty
much anywhere within the string, except within the attribute names, which are essentially
tokens. &lt;/span&gt;&lt;span style="FONT-SIZE: 12pt; COLOR: #003300; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;
&lt;span style="FONT-SIZE: 12pt; COLOR: #003300; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;
&lt;span style="FONT-SIZE: 12pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;The
allowed attributes, mapping directly to the components described in the previous section,
are listed below:&lt;/span&gt;&lt;span style="FONT-SIZE: 12pt; COLOR: #003300; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;ul style="MARGIN-TOP: 0in" type=disc&gt;
&lt;li class=MsoNormal style="MARGIN: 0in 0in 0pt; COLOR: #003300; LINE-HEIGHT: normal; mso-list: l0 level1 lfo1; tab-stops: list .5in"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;Simple
name &lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Wingdings; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Arial; 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;à&lt;/span&gt;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt; has
no attribute name, requiring only its value&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt; 
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt; 
&lt;li class=MsoNormal style="MARGIN: 0in 0in 0pt; COLOR: #003300; LINE-HEIGHT: normal; mso-list: l0 level1 lfo1; tab-stops: list .5in"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;Version &lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Wingdings; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Arial; 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;à&lt;/span&gt;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt; “Version”&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt; 
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt; 
&lt;li class=MsoNormal style="MARGIN: 0in 0in 0pt; COLOR: #003300; LINE-HEIGHT: normal; mso-list: l0 level1 lfo1; tab-stops: list .5in"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;Culture &lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Wingdings; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Arial; 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;à&lt;/span&gt;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt; “Culture”&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt; 
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt; 
&lt;li class=MsoNormal style="MARGIN: 0in 0in 0pt; COLOR: #003300; LINE-HEIGHT: normal; mso-list: l0 level1 lfo1; tab-stops: list .5in"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;Public
key or token &lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Wingdings; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Arial; 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;à&lt;/span&gt;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt; “PublicKey”
or “PublicKeyToken”&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt; 
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt; 
&lt;li class=MsoNormal style="MARGIN: 0in 0in 0pt; COLOR: #003300; LINE-HEIGHT: normal; mso-list: l0 level1 lfo1; tab-stops: list .5in"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;Processor
architecture &lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Wingdings; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Arial; 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;à&lt;/span&gt;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt; “ProcessorArchitecture”&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt; 
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt; 
&lt;li class=MsoNormal style="MARGIN: 0in 0in 0pt; COLOR: #003300; LINE-HEIGHT: normal; mso-list: l0 level1 lfo1; tab-stops: list .5in"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;Retargetable &lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Wingdings; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Arial; 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;à&lt;/span&gt;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt; “Retargetable”&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;
&lt;span style="FONT-SIZE: 12pt; COLOR: #003300; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;
&lt;span style="FONT-SIZE: 12pt; COLOR: #003300; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;
&lt;span style="FONT-SIZE: 12pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;The
following characters can be escaped as part of the identity, with the escape character
“\”:&lt;/span&gt;&lt;span style="FONT-SIZE: 12pt; COLOR: #003300; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;ul style="MARGIN-TOP: 0in" type=disc&gt;
&lt;li class=MsoNormal style="MARGIN: 0in 0in 0pt; COLOR: #003300; LINE-HEIGHT: normal; mso-list: l2 level1 lfo2; tab-stops: list .5in"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;’&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt; 
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt; 
&lt;li class=MsoNormal style="MARGIN: 0in 0in 0pt; COLOR: #003300; LINE-HEIGHT: normal; mso-list: l2 level1 lfo2; tab-stops: list .5in"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;t&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt; 
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt; 
&lt;li class=MsoNormal style="MARGIN: 0in 0in 0pt; COLOR: #003300; LINE-HEIGHT: normal; mso-list: l2 level1 lfo2; tab-stops: list .5in"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;r&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt; 
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt; 
&lt;li class=MsoNormal style="MARGIN: 0in 0in 0pt; COLOR: #003300; LINE-HEIGHT: normal; mso-list: l2 level1 lfo2; tab-stops: list .5in"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;n&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt; 
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt; 
&lt;li class=MsoNormal style="MARGIN: 0in 0in 0pt; COLOR: #003300; LINE-HEIGHT: normal; mso-list: l2 level1 lfo2; tab-stops: list .5in"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;\&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt; 
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt; 
&lt;li class=MsoNormal style="MARGIN: 0in 0in 0pt; COLOR: #003300; LINE-HEIGHT: normal; mso-list: l2 level1 lfo2; tab-stops: list .5in"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;=&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt; 
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt; 
&lt;li class=MsoNormal style="MARGIN: 0in 0in 0pt; COLOR: #003300; LINE-HEIGHT: normal; mso-list: l2 level1 lfo2; tab-stops: list .5in"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;‘&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt; 
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt; 
&lt;li class=MsoNormal style="MARGIN: 0in 0in 0pt; COLOR: #003300; LINE-HEIGHT: normal; mso-list: l2 level1 lfo2; tab-stops: list .5in"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;U(HexChar)&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;
&lt;a name=_Toc146619198&gt;&lt;/a&gt;&lt;a name=_Toc147205712&gt;&lt;/a&gt;&lt;a name=_Toc147904563&gt;&lt;span style="mso-bookmark: _Toc147205712"&gt;&lt;span style="mso-bookmark: _Toc146619198"&gt;&lt;span style="FONT-SIZE: 12pt; COLOR: #0072bc; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;Textual
Identity Error Cases&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;span style="mso-bookmark: _Toc146619198"&gt;&lt;/span&gt;&lt;span style="mso-bookmark: _Toc147205712"&gt;&lt;/span&gt;&lt;span style="mso-bookmark: _Toc147904563"&gt;&lt;/span&gt;&lt;span style="FONT-SIZE: 12pt; COLOR: #003300; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;
&lt;span style="FONT-SIZE: 12pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;The
textual identity parser will error in the following cases:&lt;/span&gt;&lt;span style="FONT-SIZE: 12pt; COLOR: #003300; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;
&lt;span style="FONT-SIZE: 12pt; COLOR: #003300; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;ul style="MARGIN-TOP: 0in" type=disc&gt;
&lt;li class=MsoNormal style="MARGIN: 0in 0in 0pt; COLOR: #003300; LINE-HEIGHT: normal; mso-list: l1 level1 lfo3; tab-stops: list .5in"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;The
textual identity doesn’t match the correct general format (“,” attribute “=” value)+&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt; 
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt; 
&lt;li class=MsoNormal style="MARGIN: 0in 0in 0pt; COLOR: #003300; LINE-HEIGHT: normal; mso-list: l1 level1 lfo3; tab-stops: list .5in"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;The
textual identity includes attributes that are unknown (i.e. foo=bar)&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt; 
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt; 
&lt;li class=MsoNormal style="MARGIN: 0in 0in 0pt; COLOR: #003300; LINE-HEIGHT: normal; mso-list: l1 level1 lfo3; tab-stops: list .5in"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;There
is a value that doesn’t match a member of a given enumeration (i.e. “powerpc”)&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt; 
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt; 
&lt;li class=MsoNormal style="MARGIN: 0in 0in 0pt; COLOR: #003300; LINE-HEIGHT: normal; mso-list: l1 level1 lfo3; tab-stops: list .5in"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;A
part of any version number under- or over-flows the integer&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;
&lt;a name=_Toc146619199&gt;&lt;/a&gt;&lt;a name=_Toc147205713&gt;&lt;/a&gt;&lt;a name=_Toc147904564&gt;&lt;span style="mso-bookmark: _Toc147205713"&gt;&lt;span style="mso-bookmark: _Toc146619199"&gt;&lt;span style="FONT-SIZE: 12pt; COLOR: #0072bc; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;AssemblyName&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;span style="FONT-SIZE: 12pt; COLOR: #0072bc; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt; Class&lt;/span&gt;&lt;span style="FONT-SIZE: 12pt; COLOR: #003300; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;
&lt;span style="FONT-SIZE: 12pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;The
.NET Framework includes a class called System.Reflection.AssemblyName. An AssemblyName
takes the textual identity in its constructor, parses the string and then provides
access to each attribute of the identity via handy properties. The constructor throws
if the provided string is invalid according to the specification provided above.&lt;/span&gt;&lt;span style="FONT-SIZE: 12pt; COLOR: #003300; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;
&lt;span style="FONT-SIZE: 12pt; COLOR: #003300; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;
&lt;span style="FONT-SIZE: 12pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;The
term “assembly name” is sometimes used interchangeably with “assembly identity”. It
is generally best to think of “assembly name” as the AssemblyName class, and “assembly
identity” as the boarder concept of the multi-part name of an assembly as described
earlier.&lt;/span&gt;&lt;span style="FONT-SIZE: 12pt; COLOR: #003300; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;
&lt;span style="FONT-SIZE: 12pt; COLOR: #003300; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;
&lt;span style="FONT-SIZE: 12pt; COLOR: #0072bc; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;Strong
versus Partial versus Weak Names&lt;/span&gt;&lt;span style="FONT-SIZE: 12pt; COLOR: #003300; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;
&lt;span style="FONT-SIZE: 12pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;Up
until this point, the assembly identity has been described as if all the parts always
have to be there. That is not the case. There are essentially three categories of
names, depending on how much of the identity attributes are specified.&lt;/span&gt;&lt;span style="FONT-SIZE: 12pt; COLOR: #003300; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;
&lt;span style="FONT-SIZE: 12pt; COLOR: #003300; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;
&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;span style="FONT-SIZE: 12pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;Strong
name&lt;/span&gt;&lt;/b&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;span style="FONT-SIZE: 12pt; COLOR: #003300; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/b&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; LINE-HEIGHT: normal"&gt;
&lt;span style="FONT-SIZE: 12pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: Symbol"&gt;·&lt;/span&gt;&lt;span style="FONT-SIZE: 7pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: Symbol"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="FONT-SIZE: 12pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;Simple
name&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #003300; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; LINE-HEIGHT: normal"&gt;
&lt;span style="FONT-SIZE: 12pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: Symbol"&gt;·&lt;/span&gt;&lt;span style="FONT-SIZE: 7pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: Symbol"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="FONT-SIZE: 12pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;Version&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #003300; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; LINE-HEIGHT: normal"&gt;
&lt;span style="FONT-SIZE: 12pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: Symbol"&gt;·&lt;/span&gt;&lt;span style="FONT-SIZE: 7pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: Symbol"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="FONT-SIZE: 12pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;Culture&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #003300; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; LINE-HEIGHT: normal"&gt;
&lt;span style="FONT-SIZE: 12pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: Symbol"&gt;·&lt;/span&gt;&lt;span style="FONT-SIZE: 7pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: Symbol"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="FONT-SIZE: 12pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;PublicKey
or PublicKeyToken&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #003300; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;
&lt;span style="FONT-SIZE: 12pt; COLOR: #003300; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;
&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;span style="FONT-SIZE: 12pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;Weak
name&lt;/span&gt;&lt;/b&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;span style="FONT-SIZE: 12pt; COLOR: #003300; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/b&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; LINE-HEIGHT: normal"&gt;
&lt;span style="FONT-SIZE: 12pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: Symbol"&gt;·&lt;/span&gt;&lt;span style="FONT-SIZE: 7pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: Symbol"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="FONT-SIZE: 12pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;Simple
name&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #003300; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;
&lt;span style="FONT-SIZE: 12pt; COLOR: #003300; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;
&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;span style="FONT-SIZE: 12pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;Partial
name&lt;/span&gt;&lt;/b&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;span style="FONT-SIZE: 12pt; COLOR: #003300; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/b&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; LINE-HEIGHT: normal"&gt;
&lt;span style="FONT-SIZE: 12pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: Symbol"&gt;·&lt;/span&gt;&lt;span style="FONT-SIZE: 7pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: Symbol"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="FONT-SIZE: 12pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;A
weak name, or&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #003300; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; LINE-HEIGHT: normal"&gt;
&lt;span style="FONT-SIZE: 12pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: Symbol"&gt;·&lt;/span&gt;&lt;span style="FONT-SIZE: 7pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: Symbol"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="FONT-SIZE: 12pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;Additional
attributes beyond a weak name, but not enough to be considered a strong name&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #003300; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;
&lt;span style="FONT-SIZE: 12pt; COLOR: #003300; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;
&lt;span style="FONT-SIZE: 12pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;There
are two other attributes: ProcessorArchitecture and Retargetable. ProcessorArchitecture
is always optional, and just really makes a strong name more stronger. Retargetable
is not commonly used.&lt;/span&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://hoser.lander.ca/aggbug.ashx?id=78361ed5-e944-4b22-8395-e86c79e3ee3f" /&gt;</description>
      <comments>http://hoser.lander.ca/CommentView,guid,78361ed5-e944-4b22-8395-e86c79e3ee3f.aspx</comments>
      <category>Loader</category>
    </item>
    <item>
      <trackback:ping>http://hoser.lander.ca/Trackback.aspx?guid=eec48629-9409-4526-832e-e9ad4553a82b</trackback:ping>
      <pingback:server>http://hoser.lander.ca/pingback.aspx</pingback:server>
      <pingback:target>http://hoser.lander.ca/PermaLink,guid,eec48629-9409-4526-832e-e9ad4553a82b.aspx</pingback:target>
      <dc:creator>Rich Lander</dc:creator>
      <wfw:comment>http://hoser.lander.ca/CommentView,guid,eec48629-9409-4526-832e-e9ad4553a82b.aspx</wfw:comment>
      <wfw:commentRss>http://hoser.lander.ca/SyndicationService.asmx/GetEntryCommentsRss?guid=eec48629-9409-4526-832e-e9ad4553a82b</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
The CLR loader offers a few APIs for loading assemblies, each of which have
a slightly different model and behaviour for how they go about the task. I'd like
to cover those and hopefully set folks on the best path for using loading assemblies.
</p>
        <p>
The APIs that I have in mind are:
</p>
        <ul>
          <li>
Assembly.Load(), and 
</li>
          <li>
Assembly.LoadWithPartialName()</li>
        </ul>
        <p>
First, you need to understand the concepts of fully-specified and partial assembly
names.  A fully specified name contains the following parts: the simple name,
version, culture, and public key or public key token. A partial name contains at least
the simple name and optionally any of the other parts of the full-specified name.
This concept is most relevant to the textual identity of an assembly. For example,
here is the fully-specified assembly textual identity for v2.0 System.dll: "System,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089". The textual identity
is a specially formatted string that is used to describe some or all of the aspects
of identifying an assembly. 
</p>
        <p>
Assembly.Load() takes a string as one of the overloads. The textual identity, as you
see formatted above, is just the sort of string that Load() is expecting. Load() also
takes other types, such as AssemblyName, but that's not important for the moment.
The textual identity can be fully or partially specified, and which one it is has
an important impact on the way that these loader APIs operate. The one you see above
for System.dll is fully specified, since all the parts are there. Note that there
is an additional part (or attribute) of the textual indentity that I've missed -- ProcessorArchitecture
-- but that complicates the discussion too much for not much benefit, so I'm
not going to cover it here.
</p>
        <p>
The following bit of code shows the use of these APIs with full- and partially-specified
names. The comments inline should pretty well explain what to expect
</p>
        <pre>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
            <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">using</span> System;<br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">using</span> System.Reflection;<br /><br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">namespace</span> BindingByIdentity<br />
{<br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">class</span> Program<br />
{<br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">static</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">void</span> Main(<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">string</span>[]
args)<br />
{<br />
Assembly asm;<br /><br /><span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">//LoadWithPartialName()
looks in both the appbase and the GAC, looking for the best match,</span><br /><span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">//where
"best match" isn't very clearly defined</span><br /><span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">//In
addition, this method has been deprecated, which means "don't use this anymore, and
it may be removed later"</span><br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">try</span><br />
{<br />
Console.WriteLine(<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"Calling
LoadWithPartialName"</span>);<br />
asm <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span> Assembly.LoadWithPartialName(<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"System"</span>);<br />
Console.WriteLine(<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"Loaded:
{0}"</span>,asm.FullName);<br />
}<br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">catch</span>(Exception
e)<br />
{<br />
Console.WriteLine(<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"LoadWithPartialName
threw with the following exception:"</span>);<br />
Console.WriteLine(e.Message);<br />
}<br /><br /><br /><span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">//Load()
with a partial name looks only in the appbase</span><br /><span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">//There
is no gaurantee that you will get the assembly that you want</span><br /><span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">//In
the case that you have private bin paths specified, there are no order gaurantees</span><br /><span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">//This
particular use of the Assembly.Load() will always throw, since this assembly will
not be found (because it is GAC'd)</span><br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">try</span><br />
{<br />
Console.WriteLine(<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"Calling
Load"</span>);<br />
asm <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span> Assembly.Load(<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"System,
PublicKeyToken=b77a5c561934e089"</span>);<br />
Console.WriteLine(<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"Loaded:
{0}"</span>, asm.FullName);<br />
}<br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">catch</span>(Exception
e)<br />
{<br />
Console.WriteLine(<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"Load
threw with the following exception:"</span>);<br />
Console.WriteLine(e.Message);<br />
}<br /><br /><span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">//Load()
with a fully-specified name looks in the appbase and the GAC and gaurantees that you</span><br /><span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">//will
get the assembly that you asked for</span><br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">try</span><br />
{<br />
Console.WriteLine(<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"Calling
Load"</span>);<br />
asm <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span> Assembly.Load(<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"System,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"</span>);<br />
Console.WriteLine(<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"Loaded:
{0}"</span>, asm.FullName);<br />
}<br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">catch</span> (Exception
e)<br />
{<br />
Console.WriteLine(<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"Load
threw with the following exception:"</span>);<br />
Console.WriteLine(e.Message);<br />
}<br /><br /><br />
}<br />
}<br />
}<br /></span>
        </pre>
        <p>
Output:
</p>
        <p>
          <font color="#000000">Calling LoadWithPartialName<br />
Loaded: System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089<br />
Calling Load<br />
Load threw with the following exception:<br />
Could not load file or assembly 'System, PublicKeyToken=b77a5c561934e089' or one<br />
 of its dependencies. The system cannot find the file specified.<br />
Calling Load<br />
Loaded: System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</font>
        </p>
        <p>
The moral of this story is that Assembly.LoadWithPartialName() is always bad and shouldn't
be used since its behaviour isn't well-defined or predictable, and that you should
always fully-specify the textual identity strings that you pass into Assembly.Load().
It may be the case that partially specified strings "work" since the assemblies you
are attempted to load are always going to be in the app-base, but the fully-specified
names do make your code and your intentions more clear, particularly for the next
guy that has to look at the code you wrote. The funny thing is that sometimes "the
next guy" is you, just two months later ;)
</p>
        <p>
There is also the case that your code might not be strong-named. You should still
specify everything but the publickey/token in that case.
</p>
        <img width="0" height="0" src="http://hoser.lander.ca/aggbug.ashx?id=eec48629-9409-4526-832e-e9ad4553a82b" />
      </body>
      <title>Loading by Identity</title>
      <guid isPermaLink="false">http://hoser.lander.ca/PermaLink,guid,eec48629-9409-4526-832e-e9ad4553a82b.aspx</guid>
      <link>http://hoser.lander.ca/2006/10/26/LoadingByIdentity.aspx</link>
      <pubDate>Thu, 26 Oct 2006 06:43:59 GMT</pubDate>
      <description>&lt;p&gt;
The&amp;nbsp;CLR loader&amp;nbsp;offers a few APIs for loading assemblies, each of which have
a slightly different model and behaviour for how they go about the task. I'd like
to cover those and hopefully set folks on the best path for using loading assemblies.
&lt;/p&gt;
&lt;p&gt;
The APIs that I have in mind are:
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
Assembly.Load(), and 
&lt;li&gt;
Assembly.LoadWithPartialName()&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
First, you need to understand the concepts of fully-specified and partial assembly
names. &amp;nbsp;A fully specified name contains the following parts: the simple name,
version, culture, and public key or public key token. A partial name contains at least
the simple name and optionally any of the other parts of the full-specified name.
This concept is most relevant to the textual identity of an assembly. For example,
here is the fully-specified assembly textual identity for v2.0 System.dll: "System,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089". The textual identity
is a specially formatted string that is used to describe some or all of the aspects
of identifying an assembly. 
&lt;/p&gt;
&lt;p&gt;
Assembly.Load() takes a string as one of the overloads. The textual identity, as you
see formatted above, is just the sort of string that Load() is expecting. Load() also
takes other types, such as AssemblyName, but that's not important for the moment.
The textual identity can be fully or partially specified, and which one it is has
an important impact on the way that these loader APIs operate. The one you see above
for System.dll is fully specified, since all the parts are there. Note that there
is an additional part (or attribute) of the textual indentity that I've missed --&amp;nbsp;ProcessorArchitecture
--&amp;nbsp;but that complicates the discussion too much for not much benefit, so I'm
not going to cover it here.
&lt;/p&gt;
&lt;p&gt;
The following bit of code shows the use of these APIs with full- and partially-specified
names. The comments inline should pretty well explain what to expect
&lt;/p&gt;
&lt;pre&gt;&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;using&lt;/span&gt; System;&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;using&lt;/span&gt; System.Reflection;&lt;br&gt;
&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;namespace&lt;/span&gt; BindingByIdentity&lt;br&gt;
{&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;class&lt;/span&gt; Program&lt;br&gt;
{&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;static&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;void&lt;/span&gt; Main(&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;string&lt;/span&gt;[]
args)&lt;br&gt;
{&lt;br&gt;
Assembly asm;&lt;br&gt;
&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;//LoadWithPartialName()
looks in both the appbase and the GAC, looking for the best match,&lt;/span&gt;
&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;//where
"best match" isn't very clearly defined&lt;/span&gt;
&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;//In
addition, this method has been deprecated, which means "don't use this anymore, and
it may be removed later"&lt;/span&gt;
&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;try&lt;/span&gt;
&lt;br&gt;
{&lt;br&gt;
Console.WriteLine(&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"Calling
LoadWithPartialName"&lt;/span&gt;);&lt;br&gt;
asm &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; Assembly.LoadWithPartialName(&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"System"&lt;/span&gt;);&lt;br&gt;
Console.WriteLine(&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"Loaded:
{0}"&lt;/span&gt;,asm.FullName);&lt;br&gt;
}&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;catch&lt;/span&gt;(Exception
e)&lt;br&gt;
{&lt;br&gt;
Console.WriteLine(&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"LoadWithPartialName
threw with the following exception:"&lt;/span&gt;);&lt;br&gt;
Console.WriteLine(e.Message);&lt;br&gt;
}&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;//Load()
with a partial name looks only in the appbase&lt;/span&gt;
&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;//There
is no gaurantee that you will get the assembly that you want&lt;/span&gt;
&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;//In
the case that you have private bin paths specified, there are no order gaurantees&lt;/span&gt;
&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;//This
particular use of the Assembly.Load() will always throw, since this assembly will
not be found (because it is GAC'd)&lt;/span&gt;
&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;try&lt;/span&gt;
&lt;br&gt;
{&lt;br&gt;
Console.WriteLine(&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"Calling
Load"&lt;/span&gt;);&lt;br&gt;
asm &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; Assembly.Load(&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"System,
PublicKeyToken=b77a5c561934e089"&lt;/span&gt;);&lt;br&gt;
Console.WriteLine(&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"Loaded:
{0}"&lt;/span&gt;, asm.FullName);&lt;br&gt;
}&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;catch&lt;/span&gt;(Exception
e)&lt;br&gt;
{&lt;br&gt;
Console.WriteLine(&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"Load
threw with the following exception:"&lt;/span&gt;);&lt;br&gt;
Console.WriteLine(e.Message);&lt;br&gt;
}&lt;br&gt;
&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;//Load()
with a fully-specified name looks in the appbase and the GAC and gaurantees that you&lt;/span&gt;
&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;//will
get the assembly that you asked for&lt;/span&gt;
&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;try&lt;/span&gt;
&lt;br&gt;
{&lt;br&gt;
Console.WriteLine(&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"Calling
Load"&lt;/span&gt;);&lt;br&gt;
asm &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; Assembly.Load(&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"System,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"&lt;/span&gt;);&lt;br&gt;
Console.WriteLine(&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"Loaded:
{0}"&lt;/span&gt;, asm.FullName);&lt;br&gt;
}&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;catch&lt;/span&gt; (Exception
e)&lt;br&gt;
{&lt;br&gt;
Console.WriteLine(&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"Load
threw with the following exception:"&lt;/span&gt;);&lt;br&gt;
Console.WriteLine(e.Message);&lt;br&gt;
}&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
}&lt;br&gt;
}&lt;br&gt;
}&lt;br&gt;
&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;
Output:
&lt;/p&gt;
&lt;p&gt;
&lt;font color=#000000&gt;Calling LoadWithPartialName&lt;br&gt;
Loaded: System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089&lt;br&gt;
Calling Load&lt;br&gt;
Load threw with the following exception:&lt;br&gt;
Could not load file or assembly 'System, PublicKeyToken=b77a5c561934e089' or one&lt;br&gt;
&amp;nbsp;of its dependencies. The system cannot find the file specified.&lt;br&gt;
Calling Load&lt;br&gt;
Loaded: System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
The moral of this story is that Assembly.LoadWithPartialName() is always bad and shouldn't
be used since its behaviour isn't well-defined or predictable, and that you should
always fully-specify the textual identity strings that you pass into Assembly.Load().
It may be the case that partially specified strings "work" since the assemblies you
are attempted to load are always going to be in the app-base, but the fully-specified
names do make your code and your intentions more clear, particularly for the next
guy that has to look at the code you wrote. The funny thing is that sometimes "the
next guy" is you, just two months later ;)
&lt;/p&gt;
&lt;p&gt;
There is also the case that your code might not be strong-named. You should still
specify everything but the publickey/token in that case.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://hoser.lander.ca/aggbug.ashx?id=eec48629-9409-4526-832e-e9ad4553a82b" /&gt;</description>
      <comments>http://hoser.lander.ca/CommentView,guid,eec48629-9409-4526-832e-e9ad4553a82b.aspx</comments>
      <category>Code Samples</category>
      <category>Loader</category>
      <category>Versioning</category>
    </item>
    <item>
      <trackback:ping>http://hoser.lander.ca/Trackback.aspx?guid=40c20020-ce12-45e9-8f9c-770e90629173</trackback:ping>
      <pingback:server>http://hoser.lander.ca/pingback.aspx</pingback:server>
      <pingback:target>http://hoser.lander.ca/PermaLink,guid,40c20020-ce12-45e9-8f9c-770e90629173.aspx</pingback:target>
      <dc:creator>Rich Lander</dc:creator>
      <wfw:comment>http://hoser.lander.ca/CommentView,guid,40c20020-ce12-45e9-8f9c-770e90629173.aspx</wfw:comment>
      <wfw:commentRss>http://hoser.lander.ca/SyndicationService.asmx/GetEntryCommentsRss?guid=40c20020-ce12-45e9-8f9c-770e90629173</wfw:commentRss>
      <slash:comments>1</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
I've heard "convention over configuration" a number of times, largely in reference
to Ruby on Rails. It's actually a really interested concept. It is simple in nature,
and those kind of concepts are always the best. As an aside, I think I'm done with
complicated concepts at this point ;) The question is where does the CLR loader lie
w/rt CoC and is that the correct place to be.
</p>
        <p>
I can tell you right away that the loader and binder are way, way over on the side
of configuration. And the default behaviour -- the behaviour you get before you need
to get into configuration -- is only useful for basic scenarios. Let me offer an example
if this is seeming a little too vague. So, you've got assembly A (A, Version=2.0.0.0)
and then you want to service it, giving us A' (A, Version=2.0.0.1). That's all good
and seems to make sense. It makes sense to increment the (managed) version number
to differentiate the two versions of the assembly. The only problem is that apps bound
to A (A, Version=2.0.0.0) will still load 2.0.0.0 and not 2.0.0.1 (assuming A and
A' were in the GAC).
</p>
        <p>
Hmmm ... where does that leave us, since that's not quite the behaviour (read:convention)
that we wanted. Well, we get to configure. Here are the choices available to us: re-compile
all apps out there with A', configure (app.config) all apps to bind to A' or generate
and install publisher policy to centrally configure all apps to bind to A'. And there
is one more option still available that differs from the rest: don't change the (managed)
version number in the first place to <i>better</i> conform to the loader convention.
Ughh!
</p>
        <p>
Hmmm again ... none of that sounds too good. So, what does Microsoft do, since you'd
think that they are going with the better option or maybe have some secret hidden
option for their use alone. Well, we (for the most part) go with not changing the
(managed) version number when we service our binaries, thereby conforming to the convention.
Pretty crappy, eh?
</p>
        <p>
The good news is that we're moving much more toward convention-based approaches for
v3. There will still be plenty of <a href="http://www.kintespace.com/rasxlog/?p=362">configurability
via XML</a>, but the vast majority of cases should just fall out of convention. Yeahh!!
</p>
        <p>
This sort of thing really does make you need to stop and think. Are the default behaviours
correct? Do they cover enough of the common scenarios? Do they address those common
scenarios deeply enough? There's nothing worse than software that covers a lot of
scenarios, but only 50% deeply enough in each. 100% enough in each is where I'm headed.
</p>
        <img width="0" height="0" src="http://hoser.lander.ca/aggbug.ashx?id=40c20020-ce12-45e9-8f9c-770e90629173" />
      </body>
      <title>Convention over Configuration  as part of the CLR Loader</title>
      <guid isPermaLink="false">http://hoser.lander.ca/PermaLink,guid,40c20020-ce12-45e9-8f9c-770e90629173.aspx</guid>
      <link>http://hoser.lander.ca/2006/06/21/ConventionOverConfigurationAsPartOfTheCLRLoader.aspx</link>
      <pubDate>Wed, 21 Jun 2006 20:30:11 GMT</pubDate>
      <description>&lt;p&gt;
I've heard "convention over configuration" a number of times, largely in reference
to Ruby on Rails. It's actually a really interested concept. It is simple in nature,
and those kind of concepts are always the best. As an aside, I think I'm done with
complicated concepts at this point ;) The question is where does the CLR loader lie
w/rt CoC and is that the correct place to be.
&lt;/p&gt;
&lt;p&gt;
I can tell you right away that the loader and binder are way, way over on the side
of configuration. And the default behaviour -- the behaviour you get before you need
to get into configuration -- is only useful for basic scenarios. Let me offer an example
if this is seeming a little too vague. So, you've got assembly A (A, Version=2.0.0.0)
and then you want to service it, giving us A' (A, Version=2.0.0.1). That's all good
and seems to make sense. It makes sense to increment the (managed) version number
to differentiate the two versions of the assembly. The only problem is that apps bound
to A (A, Version=2.0.0.0) will still load 2.0.0.0 and not 2.0.0.1 (assuming A and
A' were in the GAC).
&lt;/p&gt;
&lt;p&gt;
Hmmm ... where does that leave us, since that's not quite the behaviour (read:convention)
that we wanted. Well, we get to configure. Here are the choices available to us: re-compile
all apps out there with A', configure (app.config) all apps to bind to A' or generate
and install publisher policy to centrally configure all apps to bind to A'. And there
is one more option still available that differs from the rest: don't change the (managed)
version number in the first place to &lt;i&gt;better&lt;/i&gt; conform to the loader convention.
Ughh!
&lt;/p&gt;
&lt;p&gt;
Hmmm again ... none of that sounds too good. So, what does Microsoft do, since you'd
think that they are going with the better option or maybe have some secret hidden
option for their use alone. Well, we (for the most part) go with not changing the
(managed) version number when we service our binaries, thereby conforming to the convention.
Pretty crappy, eh?
&lt;/p&gt;
&lt;p&gt;
The good news is that we're moving much more toward convention-based approaches for
v3. There will still be plenty of &lt;a href="http://www.kintespace.com/rasxlog/?p=362"&gt;configurability
via XML&lt;/a&gt;, but the vast majority of cases should just fall out of convention. Yeahh!!
&lt;/p&gt;
&lt;p&gt;
This sort of thing really does make you need to stop and think. Are the default behaviours
correct? Do they cover enough of the common scenarios? Do they address those common
scenarios deeply enough? There's nothing worse than software that covers a lot of
scenarios, but only 50% deeply enough in each. 100% enough in each is where I'm headed.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://hoser.lander.ca/aggbug.ashx?id=40c20020-ce12-45e9-8f9c-770e90629173" /&gt;</description>
      <comments>http://hoser.lander.ca/CommentView,guid,40c20020-ce12-45e9-8f9c-770e90629173.aspx</comments>
      <category>Loader</category>
      <category>Versioning</category>
    </item>
    <item>
      <trackback:ping>http://hoser.lander.ca/Trackback.aspx?guid=5a5eedb4-b295-4bd4-8ff4-5d3ba959f08c</trackback:ping>
      <pingback:server>http://hoser.lander.ca/pingback.aspx</pingback:server>
      <pingback:target>http://hoser.lander.ca/PermaLink,guid,5a5eedb4-b295-4bd4-8ff4-5d3ba959f08c.aspx</pingback:target>
      <dc:creator>Rich Lander</dc:creator>
      <wfw:comment>http://hoser.lander.ca/CommentView,guid,5a5eedb4-b295-4bd4-8ff4-5d3ba959f08c.aspx</wfw:comment>
      <wfw:commentRss>http://hoser.lander.ca/SyndicationService.asmx/GetEntryCommentsRss?guid=5a5eedb4-b295-4bd4-8ff4-5d3ba959f08c</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
I've been running an early adopter program for a couple months now for a bunch of
changes that we're making to the CLR binder/loader in the CLR v3 timeframe. The changes
are related to the binding model, versioning, servicing and an add-in model. Also,
just to be clear, this isn't .NET Framework v3.0 (AKA WinFX). This is the one after
that. Here is the blurb that I sent folks who I thought might be interested. Please
@ <a href="mailto:rlander@microsoft.com">mail me</a> if you are interested in participating.
</p>
        <p>
          <i>We have been busy designing some exciting new changes to the CLR loader/binder.
We'd like to start collecting feedback from customers about our change early, in order
to ensure that the final product is rock solid. The first phase of the program is
to validate that our changes are useful and to understand the compatibility of these
changes. In order to collect this information, we’d like you to run two tools on your
system so that we can learn more about how you – actually the managed apps you use
– use the loader and GAC. The one tool is a tool that collects very basic information
about the GAC, while the second tool is actually an instrumented CLR which logs data
about how the loader, binder and domains are used. The next phases involve running
a prototype version of the CLR that includes the new changes, but we’ll get to that
later, as it comes available.</i>
        </p>
        <p>
There are also a couple legal documents to sign, specifically an MSFT NDA and a license.
I'm happy to discuss those if you want to go to that stage.
</p>
        <img width="0" height="0" src="http://hoser.lander.ca/aggbug.ashx?id=5a5eedb4-b295-4bd4-8ff4-5d3ba959f08c" />
      </body>
      <title>Early Adopter Program for CLR v3 -- Who's in?</title>
      <guid isPermaLink="false">http://hoser.lander.ca/PermaLink,guid,5a5eedb4-b295-4bd4-8ff4-5d3ba959f08c.aspx</guid>
      <link>http://hoser.lander.ca/2006/06/21/EarlyAdopterProgramForCLRV3WhosIn.aspx</link>
      <pubDate>Wed, 21 Jun 2006 00:38:12 GMT</pubDate>
      <description>&lt;p&gt;
I've been running an early adopter program for a couple months now for a bunch of
changes that we're making to the CLR binder/loader in the CLR v3 timeframe. The changes
are related to the binding model, versioning, servicing and an add-in model. Also,
just to be clear, this isn't .NET Framework v3.0 (AKA WinFX). This is the one after
that. Here is the blurb that I sent folks who I thought might be interested. Please
@ &lt;a href="mailto:rlander@microsoft.com"&gt;mail me&lt;/a&gt; if you are interested in participating.
&lt;/p&gt;
&lt;p&gt;
&lt;i&gt;We have been busy designing some exciting new changes to the CLR loader/binder.
We'd like to start collecting feedback from customers about our change early, in order
to ensure that the final product is rock solid. The first phase of the program is
to validate that our changes are useful and to understand the compatibility of these
changes. In order to collect this information, we’d like you to run two tools on your
system so that we can learn more about how you – actually the managed apps you use
– use the loader and GAC. The one tool is a tool that collects very basic information
about the GAC, while the second tool is actually an instrumented CLR which logs data
about how the loader, binder and domains are used. The next phases involve running
a prototype version of the CLR that includes the new changes, but we’ll get to that
later, as it comes available.&lt;/i&gt;
&lt;/p&gt;
&lt;p&gt;
There are also a couple legal documents to sign, specifically an MSFT NDA and a license.
I'm happy to discuss those if you want to go to that stage.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://hoser.lander.ca/aggbug.ashx?id=5a5eedb4-b295-4bd4-8ff4-5d3ba959f08c" /&gt;</description>
      <comments>http://hoser.lander.ca/CommentView,guid,5a5eedb4-b295-4bd4-8ff4-5d3ba959f08c.aspx</comments>
      <category>AppDomains</category>
      <category>Compatibility</category>
      <category>Loader</category>
      <category>Versioning</category>
    </item>
    <item>
      <trackback:ping>http://hoser.lander.ca/Trackback.aspx?guid=86a83ac9-6bbe-41de-92c9-26bbf228ca60</trackback:ping>
      <pingback:server>http://hoser.lander.ca/pingback.aspx</pingback:server>
      <pingback:target>http://hoser.lander.ca/PermaLink,guid,86a83ac9-6bbe-41de-92c9-26bbf228ca60.aspx</pingback:target>
      <dc:creator>Rich Lander</dc:creator>
      <wfw:comment>http://hoser.lander.ca/CommentView,guid,86a83ac9-6bbe-41de-92c9-26bbf228ca60.aspx</wfw:comment>
      <wfw:commentRss>http://hoser.lander.ca/SyndicationService.asmx/GetEntryCommentsRss?guid=86a83ac9-6bbe-41de-92c9-26bbf228ca60</wfw:commentRss>
      <slash:comments>1</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
I <a href="http://hoser.lander.ca/GacutilV20.aspx">posted</a> almost a month ago about
all the searches that I've been noticing on my blog about gacutil.exe.
I believe I've determined the question that at least some of the folks are wanting
to ask. Folks don't know where to get it.
</p>
        <p>
gacutil.exe and other tools such as ildasm.exe are part of the <a href="http://msdn.microsoft.com/netframework/downloads/updates/default.aspx">.NET
Framework SDK</a>. The .Net Framework admin tool, which used to be part
of the redist, is now part of the SDK.
</p>
        <p>
There may be some confusion around gacutil in particular. It has never shipped with
the redist, but apparently a servicing package of the redist in the Everett (v1.1)
timeframe used it as part of its servicing logic (oops) and didn't properly clean
up after itself (double oops). As a result, there may be developers out there that
have gotten used to gacutil being in the framework directory. If that's the case,
we're sorry for giving the wrong impression. gacutil is intended to be a developer-only
tool, used as part of development.
</p>
        <p>
Instead of using gacutil at deployment time (as our not-so-smart servicing package
did), you should use MSI or code against the <a href="http://blogs.msdn.com/junfeng/articles/229648.aspx">fusion
APIs</a> yourself (with the former being the preferred method). For more info,
you might take a look through <a href="http://blogs.msdn.com/junfeng/default.aspx">Junfeng's
blog</a>.
</p>
        <p>
Happy GACing.
</p>
        <img width="0" height="0" src="http://hoser.lander.ca/aggbug.ashx?id=86a83ac9-6bbe-41de-92c9-26bbf228ca60" />
      </body>
      <title>GACUtil v2.0 -- Where to Get it</title>
      <guid isPermaLink="false">http://hoser.lander.ca/PermaLink,guid,86a83ac9-6bbe-41de-92c9-26bbf228ca60.aspx</guid>
      <link>http://hoser.lander.ca/2005/12/06/GACUtilV20WhereToGetIt.aspx</link>
      <pubDate>Tue, 06 Dec 2005 06:43:16 GMT</pubDate>
      <description>&lt;p&gt;
I &lt;a href="http://hoser.lander.ca/GacutilV20.aspx"&gt;posted&lt;/a&gt; almost a month ago about
all the searches that I've been&amp;nbsp;noticing on&amp;nbsp;my blog&amp;nbsp;about gacutil.exe.
I believe I've determined the question that at least some of the folks are wanting
to ask. Folks don't know where to get it.
&lt;/p&gt;
&lt;p&gt;
gacutil.exe and other tools such as ildasm.exe are part of the &lt;a href="http://msdn.microsoft.com/netframework/downloads/updates/default.aspx"&gt;.NET
Framework&amp;nbsp;SDK&lt;/a&gt;. The .Net Framework admin tool, which used to be&amp;nbsp;part
of the redist,&amp;nbsp;is now part of the SDK.
&lt;/p&gt;
&lt;p&gt;
There may be some confusion around gacutil in particular. It has never shipped with
the redist, but apparently a servicing package of the redist in the Everett (v1.1)
timeframe used it as part of its servicing logic (oops) and didn't properly clean
up after itself (double oops). As a result, there may be developers out there that
have gotten used to gacutil being in the framework directory. If that's the case,
we're sorry for giving the wrong impression. gacutil is intended to be a developer-only
tool, used as part of development.
&lt;/p&gt;
&lt;p&gt;
Instead of using gacutil at deployment time (as our not-so-smart servicing package
did), you should use MSI or code against the &lt;a href="http://blogs.msdn.com/junfeng/articles/229648.aspx"&gt;fusion
APIs&lt;/a&gt; yourself (with the former being the preferred method).&amp;nbsp;For more info,
you might take a look through &lt;a href="http://blogs.msdn.com/junfeng/default.aspx"&gt;Junfeng's
blog&lt;/a&gt;.
&lt;/p&gt;
&lt;p&gt;
Happy GACing.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://hoser.lander.ca/aggbug.ashx?id=86a83ac9-6bbe-41de-92c9-26bbf228ca60" /&gt;</description>
      <comments>http://hoser.lander.ca/CommentView,guid,86a83ac9-6bbe-41de-92c9-26bbf228ca60.aspx</comments>
      <category>Loader</category>
      <category>Wonders of the Whidbey GAC</category>
    </item>
    <item>
      <trackback:ping>http://hoser.lander.ca/Trackback.aspx?guid=e3c1498a-2a48-4ab4-ba16-cb4de3fee73b</trackback:ping>
      <pingback:server>http://hoser.lander.ca/pingback.aspx</pingback:server>
      <pingback:target>http://hoser.lander.ca/PermaLink,guid,e3c1498a-2a48-4ab4-ba16-cb4de3fee73b.aspx</pingback:target>
      <dc:creator>Rich Lander</dc:creator>
      <wfw:comment>http://hoser.lander.ca/CommentView,guid,e3c1498a-2a48-4ab4-ba16-cb4de3fee73b.aspx</wfw:comment>
      <wfw:commentRss>http://hoser.lander.ca/SyndicationService.asmx/GetEntryCommentsRss?guid=e3c1498a-2a48-4ab4-ba16-cb4de3fee73b</wfw:commentRss>
      <title>The Wonders of Whidbey Factoring Features – Part III: Friend Assemblies</title>
      <guid isPermaLink="false">http://hoser.lander.ca/PermaLink,guid,e3c1498a-2a48-4ab4-ba16-cb4de3fee73b.aspx</guid>
      <link>http://hoser.lander.ca/2005/11/21/TheWondersOfWhidbeyFactoringFeaturesPartIIIFriendAssemblies.aspx</link>
      <pubDate>Mon, 21 Nov 2005 18:46:14 GMT</pubDate>
      <description>&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;We’re now at least half way into
this set of posts on factoring features in Visual Studio 2005. The more I’ve thought
about getting this set of posts fully written up, the more I’ve found these features
interesting. My team produced them, so that helps, but I believe that a lot of developers
will end up needing these features as a part of their versioning plan.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;font face="Times New Roman"&gt;AKA
InternalsVisibleTo&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/b&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;Friend assemblies are a nickname
for the InternalsVisibleTo attribute in the System.Runtime.CompilerServices namespace.
Not much of a stretch from the name, the use of the attribute allows you to specify
which assemblies (your friends) should have access to your internal types and members.
Just to remind you, “internal” != “private” – “internal” == “internal”.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;As you might guess, this attribute
must be set at the assembly-level. You might hope, however, that you could set this
attribute at a more fine-grained level. I can explain that more later.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;font face="Times New Roman"&gt;Syntax&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/b&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;The attribute is set in the following
way:&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;[assembly:InternalsVisibleTo(“MyOtherAssembly,
PublicKey=4asdsadasdsd”)&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;Couple things … The constructor
of the attribute -- remember attributes are just types -- takes a textual assembly
identity. Next, you must specify at least an assembly name and optionally a public
key token. You can specify a culture as long as it is neutral. You cannot specify
a version. Some of this may be a surprise to you. I’ll explain that below.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;font face="Times New Roman"&gt;Design
Decision Points&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/b&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;In retrospect, I’m not sure that
making the public key token optional was the absolute best idea, but it was probably
was necessary for a lot of interesting scenarios. First, friend assemblies is not
a security feature, in the sense that visibility is not a security feature. Friend
assemblies is just about changing the usual bounds of visibility to something that
is more convenient for developers in a lot of cases.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;That all being said, friend assemblies
are really best kept to strong-named assemblies. Weak- or simple-named are very easily
spoof-able (by definition). As a result, someone can simply use a particular name
for their assembly and then get access to the internal fields in a simply-named assembly
from which you’ve granted friendship. Even if you only ship your code internally within
your business, this still isn’t a great plan. Think about it for a while and you’ll
probably begin to better understand why.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;It probably mostly goes without
saying, but strong-named assemblies can only have strong-named friends. Strong-named
assemblies can only depend on strong-named assemblies, so this point is moot anyway.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;I do feel strongly that disallowing
the version number was the right thing to do. The reason for that is that CLR binding
doesn’t always produce the version of an assembly that you expect. There are a lot
of mechanisms that can be at play, such as publisher policy, binding-redirects and
other binding/versioning changes that we have planned for the CLR v3. As a result,
you cannot assume that an assembly that depends on you is always going to be the same.
Remember, with friends, it isn’t that you are assuming that a dependency of yours
is going to be a particular version, but an assembly that is dependent on you. We
would have potentially made a different decision if friends was the opposite way around,
being a statement about your dependencies, but it isn’t.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;The ability to specify culture provided
that it is neutral is mostly a red-herring. There is no harm to specifying it, which
is why we allowed it, but it is best to think in general that culture isn’t allowed.
The main reason here is that you should not have code in culture-specific assemblies.&lt;/font&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://hoser.lander.ca/aggbug.ashx?id=e3c1498a-2a48-4ab4-ba16-cb4de3fee73b" /&gt;</description>
      <comments>http://hoser.lander.ca/CommentView,guid,e3c1498a-2a48-4ab4-ba16-cb4de3fee73b.aspx</comments>
      <category>Loader</category>
      <category>Versioning</category>
      <category>Wonders of Whidbey Factoring Features</category>
    </item>
    <item>
      <trackback:ping>http://hoser.lander.ca/Trackback.aspx?guid=83dbcc51-5e75-4ce7-bdce-d43a8085ef6b</trackback:ping>
      <pingback:server>http://hoser.lander.ca/pingback.aspx</pingback:server>
      <pingback:target>http://hoser.lander.ca/PermaLink,guid,83dbcc51-5e75-4ce7-bdce-d43a8085ef6b.aspx</pingback:target>
      <dc:creator>Rich Lander</dc:creator>
      <wfw:comment>http://hoser.lander.ca/CommentView,guid,83dbcc51-5e75-4ce7-bdce-d43a8085ef6b.aspx</wfw:comment>
      <wfw:commentRss>http://hoser.lander.ca/SyndicationService.asmx/GetEntryCommentsRss?guid=83dbcc51-5e75-4ce7-bdce-d43a8085ef6b</wfw:commentRss>
      <slash:comments>2</slash:comments>
      <title>The Wonders of Whidbey Factoring Features – Part II: Type Forwarders in Detail</title>
      <guid isPermaLink="false">http://hoser.lander.ca/PermaLink,guid,83dbcc51-5e75-4ce7-bdce-d43a8085ef6b.aspx</guid>
      <link>http://hoser.lander.ca/2005/10/04/TheWondersOfWhidbeyFactoringFeaturesPartIITypeForwardersInDetail.aspx</link>
      <pubDate>Tue, 04 Oct 2005 03:18:21 GMT</pubDate>
      <description>&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;It’s high time for the next installment
in this series. I was planning on getting to it sooner, but I’ve had a bunch of crazy
things going on to do with getting the .NET Framework integrated into Windows Vista
and planning for the next couple versions of the .NET Framework. None of that is calming
down, but it’s time to get out another installment none the less.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;I took a quick and somewhat vague
look at type forwarders in my previous post (on purpose). Some of you were likely
satisfied by that level of information and others are likely interested in more detail.
As the title of this post suggests, this is the place to get more detail. To best
do this, I’ve created a simple – and not particularly useful – application to demonstrate
how forwarders really work. I’ll include this app in my next post.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;Here is the entire program (it is
only the Main method):&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;using&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt; System;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;using&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt; StringUtilities;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;using&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt; MathUtilities;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 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;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;namespace&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt; TypeForwarderApp&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt;{&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 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;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;class&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: teal"&gt;Program&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 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;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;static&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;void&lt;/span&gt;&lt;font color=#000000&gt;&lt;?xml:namespace prefix = st1 ns = "urn:schemas-microsoft-com:office:smarttags" /&gt; 
&lt;st1:place w:st="on"&gt;Main&lt;/st1:place&gt;
(&lt;/font&gt;&lt;span style="COLOR: blue"&gt;string&lt;/span&gt;&lt;font color=#000000&gt;[] args)&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&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;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 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;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: teal"&gt;Int32&lt;/span&gt;&lt;font color=#000000&gt; int1,
int2, intSum, stringCharacterCount;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 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;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: teal"&gt;String&lt;/span&gt;&lt;font color=#000000&gt; initialString,
reversedString;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 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;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: teal"&gt;String&lt;/span&gt;&lt;font color=#000000&gt; appMessage;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 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;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&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;appMessage
= &lt;/font&gt;&lt;span style="COLOR: maroon"&gt;"This app doesn't really do anything useful"&lt;/span&gt;&lt;font color=#000000&gt;;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 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;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: teal"&gt;Console&lt;/span&gt;&lt;font color=#000000&gt;.WriteLine(appMessage);&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 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;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&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;int1
= 16;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&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;int2
= 14;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 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;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&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;initialString
= &lt;/font&gt;&lt;span style="COLOR: maroon"&gt;"Happy 30th Birthday Microsoft!"&lt;/span&gt;&lt;font color=#000000&gt;;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 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;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&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;intSum
= &lt;/font&gt;&lt;span style="COLOR: teal"&gt;MathUtil&lt;/span&gt;&lt;font color=#000000&gt;.Add(int1, int2);&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 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;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&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;reversedString
= &lt;/font&gt;&lt;span style="COLOR: teal"&gt;StringReverse&lt;/span&gt;&lt;font color=#000000&gt;.GetReversedString(initialString);&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&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;stringCharacterCount
= &lt;/font&gt;&lt;span style="COLOR: teal"&gt;StringCharacterCount&lt;/span&gt;&lt;font color=#000000&gt;.GetCount(initialString);&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 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;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 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;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: teal"&gt;Console&lt;/span&gt;&lt;font color=#000000&gt;.WriteLine();&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 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;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: teal"&gt;Console&lt;/span&gt;&lt;font color=#000000&gt;.WriteLine(&lt;/font&gt;&lt;span style="COLOR: maroon"&gt;"Initial
String : {0}"&lt;/span&gt;&lt;font color=#000000&gt;, initialString);&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 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;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: teal"&gt;Console&lt;/span&gt;&lt;font color=#000000&gt;.WriteLine(&lt;/font&gt;&lt;span style="COLOR: maroon"&gt;"Reversed
String: {0}"&lt;/span&gt;&lt;font color=#000000&gt;, reversedString);&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 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;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: teal"&gt;Console&lt;/span&gt;&lt;font color=#000000&gt;.WriteLine(&lt;/font&gt;&lt;span style="COLOR: maroon"&gt;"String
Length&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;: {0}"&lt;/span&gt;&lt;font color=#000000&gt;,
stringCharacterCount);&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 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;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: teal"&gt;Console&lt;/span&gt;&lt;font color=#000000&gt;.WriteLine();&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 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;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: teal"&gt;Console&lt;/span&gt;&lt;font color=#000000&gt;.WriteLine(&lt;/font&gt;&lt;span style="COLOR: maroon"&gt;"Integers:
{0}, {1}"&lt;/span&gt;&lt;font color=#000000&gt;, int1, int2);&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 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;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: teal"&gt;Console&lt;/span&gt;&lt;font color=#000000&gt;.WriteLine(&lt;/font&gt;&lt;span style="COLOR: maroon"&gt;"Sum&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;:
{0}"&lt;/span&gt;&lt;font color=#000000&gt;, intSum);&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 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;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: teal"&gt;Console&lt;/span&gt;&lt;font color=#000000&gt;.WriteLine();&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 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;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: teal"&gt;Console&lt;/span&gt;&lt;font color=#000000&gt;.WriteLine(&lt;/font&gt;&lt;span style="COLOR: teal"&gt;StringReverse&lt;/span&gt;&lt;font color=#000000&gt;.GetReversedString(appMessage));&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 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;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 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;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&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;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt;}&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;Like, I said, the program doesn’t
do anything useful. I included the birthday message given that two Fridays ago was
the annual Microsoft company meeting at SafeCo Field in 
&lt;st1:City w:st="on"&gt;
&lt;st1:place w:st="on"&gt;Seattle&lt;/st1:place&gt;
&lt;/st1:City&gt;
. The theme was “Beyond 30” celebrating the first 30 years of Microsoft, although
the content was much more about the future than the past (which I imagine most folks
there appreciated). The 25&lt;sup&gt;th&lt;/sup&gt; anniversary meeting was much more of a history
lesson. I think that was the one that Sinbad was at ;)&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;I’m going to concentrate on one
type, the &lt;/font&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: teal; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;StringCharacterCount&lt;/span&gt;&lt;font face="Times New Roman" color=#000000 size=3&gt; type.
At the moment, it is part of the StringUtilties assembly. If we look at the MSIL code
within TypeForwarderApp.exe, we’ll see that clearly.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;This is the MSIL code within the
exe that calls the static method GetString on the &lt;/font&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: teal; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;StringCharacterCount&lt;/span&gt;&lt;font face="Times New Roman" color=#000000 size=3&gt; type:&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10.5pt; FONT-FAMILY: Fixedsys; mso-bidi-font-family: Fixedsys"&gt;&lt;font color=#000000&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;IL_0030:&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;call&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;int32
[StringUtilities]StringUtilities.StringCharacterCount::GetCount(string)&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;As you can see, the fact that &lt;/font&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: teal; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;StringCharacterCount&lt;/span&gt;&lt;font face="Times New Roman" color=#000000 size=3&gt; lives
within the StringUtilities assembly is pretty apparent. Actually, you could go as
far as saying it is hard-coded. Hence the need for forwarders …&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;Well, I’m a typical developer and
I’ve decided in my second version of StringUtilites and MathUtilites – I happen to
own them both – that &lt;/font&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: teal; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;StringCharacterCount&lt;/span&gt;&lt;font face="Times New Roman" color=#000000 size=3&gt; is
really a math utility and less of a string utility. As a result, I’m going to move
this cool type to the MathUtilities assembly.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;I just moved it to the MathUtilties
assembly. You can see that it is indeed part of the MathUtilities assembly via the
MetaInfo (CTRL-M) view in ILDasm. &lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10.5pt; FONT-FAMILY: Fixedsys; mso-bidi-font-family: Fixedsys"&gt;&lt;font color=#000000&gt;TypeDef
#2 (02000003)&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10.5pt; FONT-FAMILY: Fixedsys; mso-bidi-font-family: Fixedsys"&gt;&lt;font color=#000000&gt;-------------------------------------------------------&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10.5pt; FONT-FAMILY: Fixedsys; mso-bidi-font-family: Fixedsys"&gt;&lt;font color=#000000&gt;&lt;span style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;TypDefName: &lt;b style="mso-bidi-font-weight: normal"&gt;StringUtilities.StringCharacterCount&lt;/b&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;(02000003)&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10.5pt; FONT-FAMILY: Fixedsys; mso-bidi-font-family: Fixedsys"&gt;&lt;font color=#000000&gt;&lt;span style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Flags&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;:
[Public] [AutoLayout] [Class] [AnsiClass] [BeforeFieldInit]&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;(00100001)&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10.5pt; FONT-FAMILY: Fixedsys; mso-bidi-font-family: Fixedsys"&gt;&lt;font color=#000000&gt;&lt;span style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Extends&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;:
01000001 [TypeRef] System.Object&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10.5pt; FONT-FAMILY: Fixedsys; mso-bidi-font-family: Fixedsys"&gt;&lt;font color=#000000&gt;&lt;span style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Method
#1 (06000003) 
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10.5pt; FONT-FAMILY: Fixedsys; mso-bidi-font-family: Fixedsys"&gt;&lt;font color=#000000&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;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10.5pt; FONT-FAMILY: Fixedsys; mso-bidi-font-family: Fixedsys"&gt;&lt;font color=#000000&gt;&lt;span style="mso-tab-count: 2"&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;MethodName:
GetCount (06000003)&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;b style="mso-bidi-font-weight: normal"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/b&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;Notice that the &lt;/font&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: teal; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;StringCharacterCount&lt;/span&gt;&lt;font face="Times New Roman" color=#000000 size=3&gt; type
is still part of the StringUtilities namespace and not MathUtilties. This is for two
reasons: the namespace is part of the type name and type forwarders do not change
the type name in any way. Put another way, if I moved &lt;/font&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: teal; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;StringCharacterCount&lt;/span&gt;&lt;font face="Times New Roman" color=#000000 size=3&gt; from
the one assembly to the other *and* changed its namespace, then I would have a breaking
change that even type forwarders could not mitigate.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;This all makes sense, but we have
yet to see the interesting part. What does the metadata within the new version of
StringUtilties look like? Let’s take a look at the manifest (another ILDasm view)
within the StringUtilties assembly. There are actually two additional directives that
we didn’t have before.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10.5pt; FONT-FAMILY: Fixedsys; mso-bidi-font-family: Fixedsys"&gt;&lt;font color=#000000&gt;.assembly
extern MathUtilities&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10.5pt; FONT-FAMILY: Fixedsys; mso-bidi-font-family: Fixedsys"&gt;&lt;font color=#000000&gt;{&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10.5pt; FONT-FAMILY: Fixedsys; mso-bidi-font-family: Fixedsys"&gt;&lt;font color=#000000&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;.ver
1:0:0:0&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10.5pt; FONT-FAMILY: Fixedsys; mso-bidi-font-family: Fixedsys"&gt;&lt;font color=#000000&gt;}&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10.5pt; FONT-FAMILY: Fixedsys; mso-bidi-font-family: Fixedsys"&gt;&lt;font color=#000000&gt;.class
extern forwarder StringUtilities.StringCharacterCount&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10.5pt; FONT-FAMILY: Fixedsys; mso-bidi-font-family: Fixedsys"&gt;&lt;font color=#000000&gt;{&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10.5pt; FONT-FAMILY: Fixedsys; mso-bidi-font-family: Fixedsys"&gt;&lt;font color=#000000&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;.assembly
extern MathUtilities&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10.5pt; FONT-FAMILY: Fixedsys; mso-bidi-font-family: Fixedsys"&gt;&lt;font color=#000000&gt;}&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font color=#000000&gt;&lt;font face="Times New Roman" size=3&gt;StringUtilties now has a dependency
on MathUtilties and there is this “&lt;/font&gt;&lt;span style="FONT-SIZE: 10.5pt; FONT-FAMILY: Fixedsys; mso-bidi-font-family: Fixedsys"&gt;.class
extern forwarder&lt;/span&gt;&lt;font face="Times New Roman" size=3&gt;” line for “&lt;/font&gt;&lt;span style="FONT-SIZE: 10.5pt; FONT-FAMILY: Fixedsys; mso-bidi-font-family: Fixedsys"&gt;StringUtilities.StringCharacterCount&lt;/span&gt;&lt;font face="Times New Roman" size=3&gt;”.
Clearly, we’ve hit our jackpot. The dependency on MathUtilities is clearly required,
given that StringUtilities intends to forward to it. The second directive, the class
directive, is a way to signal to the runtime that the assembly knows about the class,
but that it is located at another location. &lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;If we look further yet, we’ll see
that there is an entry in ExportedType table.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10.5pt; FONT-FAMILY: Fixedsys; mso-bidi-font-family: Fixedsys"&gt;&lt;font color=#000000&gt;ExportedType
#1 (27000001)&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10.5pt; FONT-FAMILY: Fixedsys; mso-bidi-font-family: Fixedsys"&gt;&lt;font color=#000000&gt;-------------------------------------------------------&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10.5pt; FONT-FAMILY: Fixedsys; mso-bidi-font-family: Fixedsys"&gt;&lt;font color=#000000&gt;&lt;span style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Token:
0x27000001&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10.5pt; FONT-FAMILY: Fixedsys; mso-bidi-font-family: Fixedsys"&gt;&lt;font color=#000000&gt;&lt;span style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Name:
StringUtilities.StringCharacterCount&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10.5pt; FONT-FAMILY: Fixedsys; mso-bidi-font-family: Fixedsys"&gt;&lt;font color=#000000&gt;&lt;span style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Implementation
token: 0x23000002&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10.5pt; FONT-FAMILY: Fixedsys; mso-bidi-font-family: Fixedsys"&gt;&lt;font color=#000000&gt;&lt;span style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;TypeDef
token: 0x00000000&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10.5pt; FONT-FAMILY: Fixedsys; mso-bidi-font-family: Fixedsys"&gt;&lt;font color=#000000&gt;&lt;span style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Flags&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;:
[NotPublic] [AutoLayout] [Class] [AnsiClass] [Forwarder]&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;(00200000)&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;We’re now looking at metadata instead
of the MSIL view (the directives) above. The ExportedType table is generally used
to publish all the types in child netmodules of an assembly – build a multi-module
assembly and you’ll notice this first-hand. In the case of multi-module assemblies,
the implementation token would point to the netmodule, not to a separate assembly.
In the case of type forwarders, the implementation token points (naturally) to a separate
assembly. We can easily prove that too. Look at the AssemblyRef entry for the MathUtilities
Assembly below.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10.5pt; FONT-FAMILY: Fixedsys; mso-bidi-font-family: Fixedsys"&gt;&lt;font color=#000000&gt;AssemblyRef
#2 (23000002)&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10.5pt; FONT-FAMILY: Fixedsys; mso-bidi-font-family: Fixedsys"&gt;&lt;font color=#000000&gt;-------------------------------------------------------&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10.5pt; FONT-FAMILY: Fixedsys; mso-bidi-font-family: Fixedsys"&gt;&lt;font color=#000000&gt;&lt;span style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Token:
0x23000002&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10.5pt; FONT-FAMILY: Fixedsys; mso-bidi-font-family: Fixedsys"&gt;&lt;font color=#000000&gt;&lt;span style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Public
Key or Token:&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10.5pt; FONT-FAMILY: Fixedsys; mso-bidi-font-family: Fixedsys"&gt;&lt;font color=#000000&gt;&lt;span style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Name:
MathUtilities&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10.5pt; FONT-FAMILY: Fixedsys; mso-bidi-font-family: Fixedsys"&gt;&lt;font color=#000000&gt;&lt;span style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Version:
1.0.0.0&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10.5pt; FONT-FAMILY: Fixedsys; mso-bidi-font-family: Fixedsys"&gt;&lt;font color=#000000&gt;&lt;span style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Major
Version: 0x00000001&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10.5pt; FONT-FAMILY: Fixedsys; mso-bidi-font-family: Fixedsys"&gt;&lt;font color=#000000&gt;&lt;span style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Minor
Version: 0x00000000&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10.5pt; FONT-FAMILY: Fixedsys; mso-bidi-font-family: Fixedsys"&gt;&lt;font color=#000000&gt;&lt;span style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Build
Number: 0x00000000&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10.5pt; FONT-FAMILY: Fixedsys; mso-bidi-font-family: Fixedsys"&gt;&lt;font color=#000000&gt;&lt;span style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Revision
Number: 0x00000000&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10.5pt; FONT-FAMILY: Fixedsys; mso-bidi-font-family: Fixedsys"&gt;&lt;font color=#000000&gt;&lt;span style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Locale:
&amp;lt;null&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10.5pt; FONT-FAMILY: Fixedsys; mso-bidi-font-family: Fixedsys"&gt;&lt;font color=#000000&gt;&lt;span style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;HashValue
Blob:&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10.5pt; FONT-FAMILY: Fixedsys; mso-bidi-font-family: Fixedsys"&gt;&lt;font color=#000000&gt;&lt;span style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Flags:
[none] (00000000)&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font color=#000000&gt;&lt;font face="Times New Roman" size=3&gt;Notice that its token (&lt;/font&gt;&lt;span style="FONT-SIZE: 10.5pt; FONT-FAMILY: Fixedsys; mso-bidi-font-family: Fixedsys"&gt;0x23000002&lt;/span&gt;&lt;font face="Times New Roman"&gt;&lt;font size=3&gt;) &lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/span&gt;&lt;/font&gt;&lt;font size=3&gt;matches
the implementation token of our forwarded type (&lt;/font&gt;&lt;/font&gt;&lt;span style="FONT-SIZE: 10.5pt; FONT-FAMILY: Fixedsys; mso-bidi-font-family: Fixedsys"&gt;0x23000002&lt;/span&gt;&lt;font face="Times New Roman" size=3&gt;).
There you go. That’s it! Now you know everything I’m going to tell you about type
forwarders.&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://hoser.lander.ca/aggbug.ashx?id=83dbcc51-5e75-4ce7-bdce-d43a8085ef6b" /&gt;</description>
      <comments>http://hoser.lander.ca/CommentView,guid,83dbcc51-5e75-4ce7-bdce-d43a8085ef6b.aspx</comments>
      <category>Loader</category>
      <category>Versioning</category>
      <category>Wonders of Whidbey Factoring Features</category>
    </item>
    <item>
      <trackback:ping>http://hoser.lander.ca/Trackback.aspx?guid=f3d8944e-9c13-4531-b2aa-9784ca5bb916</trackback:ping>
      <pingback:server>http://hoser.lander.ca/pingback.aspx</pingback:server>
      <pingback:target>http://hoser.lander.ca/PermaLink,guid,f3d8944e-9c13-4531-b2aa-9784ca5bb916.aspx</pingback:target>
      <dc:creator>Rich Lander</dc:creator>
      <wfw:comment>http://hoser.lander.ca/CommentView,guid,f3d8944e-9c13-4531-b2aa-9784ca5bb916.aspx</wfw:comment>
      <wfw:commentRss>http://hoser.lander.ca/SyndicationService.asmx/GetEntryCommentsRss?guid=f3d8944e-9c13-4531-b2aa-9784ca5bb916</wfw:commentRss>
      <title>The Wonders of Whidbey Factoring Features – Part I: Type Forwarders</title>
      <guid isPermaLink="false">http://hoser.lander.ca/PermaLink,guid,f3d8944e-9c13-4531-b2aa-9784ca5bb916.aspx</guid>
      <link>http://hoser.lander.ca/2005/09/14/TheWondersOfWhidbeyFactoringFeaturesPartITypeForwarders.aspx</link>
      <pubDate>Wed, 14 Sep 2005 19:30:12 GMT</pubDate>
      <description>&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;&lt;font color=#000000&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;Type
forwarders are an interesting feature. If you’ve never needed them, you’ve probably
never thought about or imagined them. They were designed to allow developers to move
types from one assembly to another without breaking existing code that was dependent
on types living within a particular assembly. There are a bunch of reasons why you
might want to move types around; however existing type references will make that problematic.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;
&lt;o:p&gt;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;&lt;font color=#000000&gt;You may be
thinking “I move types between assemblies all the time and nothing breaks”. That may
be true if you are building &lt;i style="mso-bidi-font-style: normal"&gt;applications&lt;/i&gt; that
happen to have dependent assemblies. At the point that you build &lt;i style="mso-bidi-font-style: normal"&gt;frameworks&lt;/i&gt; that
other developers build apps on *and* you distribute those libraries as pre-compiled
binaries (not as source) *and* you promote apps built against earlier versions of
your framework to newer versions (say with publisher policy or binding re-directs)
without re-compiling apps, then you can easily run into this problem. 
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;
&lt;o:p&gt;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font color=#000000&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;&lt;?xml:namespace prefix = st1 ns = "urn:schemas-microsoft-com:office:smarttags" /&gt;The
.NET Framework hits this scenario dead-on. 
&lt;st1:City w:st="on"&gt;
&lt;st1:place w:st="on"&gt;Everett&lt;/st1:place&gt;
&lt;/st1:City&gt;
apps, when run on Whidbey (i.e. Whidbey-only machines), for example, run against the
Whidbey .NET Framework libraries. That work without issue, but those 
&lt;st1:City w:st="on"&gt;Everett&lt;/st1:City&gt;
apps still expect types to be in the same place as they where in 
&lt;st1:City w:st="on"&gt;
&lt;st1:place w:st="on"&gt;Everett&lt;/st1:place&gt;
&lt;/st1:City&gt;
, which in the case of &lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier; mso-bidi-font-family: 'Courier New'"&gt;System.String&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt; is
mscorlib.dll. If we moved &lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier; mso-bidi-font-family: 'Courier New'"&gt;System.String&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt; to
system.dll, for example, we’d break 100% of 
&lt;st1:place w:st="on"&gt;
&lt;st1:City w:st="on"&gt;Everett&lt;/st1:City&gt;
&lt;/st1:place&gt;
apps run on Whidbey. Why? The CLR loader would no longer be able to resolve the type
reference – &lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier; mso-bidi-font-family: 'Courier New'"&gt;[mscorlib]System.String&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt; --&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana; mso-bidi-font-family: Fixedsys"&gt; &lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;stored
in the app’s metadata, but instead would throw a &lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier; mso-bidi-font-family: 'Courier New'"&gt;System.TypeLoadException&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt; exception.
The app wouldn’t like that and neither would it’s users ;)&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;
&lt;o:p&gt;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font color=#000000&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;Before anyone
gets the wrong idea, we didn’t move &lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;System&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier; mso-bidi-font-family: 'Courier New'"&gt;.String&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt; or
any other existing types in Whidbey. I’m merely using the .NET Framework as an example
of how framework developers could similarly run into this problem, which would be
the precursor for needing type forwarders.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;
&lt;o:p&gt;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;&lt;font color=#000000&gt;Enter type
forwarders. Type forwarders are a new MSIL directive that essentially say “type x
used to be in this assembly, but it is now in this other one. Maybe you should go
look over there”. Let me just show you.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;
&lt;o:p&gt;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;ol style="MARGIN-TOP: 0in" type=1&gt;
&lt;li class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-list: l1 level1 lfo1; tab-stops: list .5in"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;&lt;font color=#000000&gt;Create type
t1 in assembly asm1&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt; 
&lt;li class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-list: l1 level1 lfo1; tab-stops: list .5in"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;&lt;font color=#000000&gt;Create an
app that uses [asm1]t1 (that’s just short-hand for saying type t1 that lives in assembly
asm1)&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt; 
&lt;li class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-list: l1 level1 lfo1; tab-stops: list .5in"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;&lt;font color=#000000&gt;Run app. 
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt; 
&lt;ol style="MARGIN-TOP: 0in" type=a&gt;
&lt;li class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-list: l1 level2 lfo1; tab-stops: list 1.0in"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;&lt;font color=#000000&gt;Loader loads
asm1&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt; 
&lt;li class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-list: l1 level2 lfo1; tab-stops: list 1.0in"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;&lt;font color=#000000&gt;Loader loads
t1&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt; 
&lt;li class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-list: l1 level2 lfo1; tab-stops: list 1.0in"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;&lt;font color=#000000&gt;Everything
works&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;li class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-list: l1 level1 lfo1; tab-stops: list .5in"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;&lt;font color=#000000&gt;Close app
and move back to VS 2005.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt; 
&lt;li class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-list: l1 level1 lfo1; tab-stops: list .5in"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;&lt;font color=#000000&gt;Move type
t1 from asm1 to asm2 (these will be two different projects)&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt; 
&lt;li class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-list: l1 level1 lfo1; tab-stops: list .5in"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;&lt;font color=#000000&gt;Create a forwarder
in asm1 that points to [asm2]t1&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt; 
&lt;li class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-list: l1 level1 lfo1; tab-stops: list .5in"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;&lt;font color=#000000&gt;Recompile
asm1 and asm2. Do not recompile the app.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt; 
&lt;li class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-list: l1 level1 lfo1; tab-stops: list .5in"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;&lt;font color=#000000&gt;Run app&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt; 
&lt;ol style="MARGIN-TOP: 0in" type=a&gt;
&lt;li class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-list: l1 level2 lfo1; tab-stops: list 1.0in"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;&lt;font color=#000000&gt;Loader loads
asm1&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt; 
&lt;li class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-list: l1 level2 lfo1; tab-stops: list 1.0in"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;&lt;font color=#000000&gt;Loader notices
forwarder directive in asm1, pointing to asm2&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt; 
&lt;li class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-list: l1 level2 lfo1; tab-stops: list 1.0in"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;&lt;font color=#000000&gt;Loader loads
asm2&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt; 
&lt;li class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-list: l1 level2 lfo1; tab-stops: list 1.0in"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;&lt;font color=#000000&gt;Loader loads
t1 (this time for asm2)&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt; 
&lt;li class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-list: l1 level2 lfo1; tab-stops: list 1.0in"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;&lt;font color=#000000&gt;Everything
works&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;
&lt;o:p&gt;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;&lt;font color=#000000&gt;You do need
to realize though that forwarders are really just a temporary crutch for older apps.
Notice that we didn’t re-compile the app above. That’s actually the point of the whole
scenario. We’re assuming that we don’t have the option of re-compiling the app, because
we don’t own it – in this scenario, we own the framework, not the app. When the owner
of the app does get the chance, we get the following list of activities:&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;
&lt;o:p&gt;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;ol style="MARGIN-TOP: 0in" type=1&gt;
&lt;li class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-list: l0 level1 lfo2; tab-stops: list .5in"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;&lt;font color=#000000&gt;Re-compile
app against the latest version of asm2&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt; 
&lt;li class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-list: l0 level1 lfo2; tab-stops: list .5in"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;&lt;font color=#000000&gt;Run new version
of app&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt; 
&lt;ol style="MARGIN-TOP: 0in" type=a&gt;
&lt;li class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-list: l0 level2 lfo2; tab-stops: list 1.0in"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;&lt;font color=#000000&gt;Loader loads
asm2&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt; 
&lt;li class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-list: l0 level2 lfo2; tab-stops: list 1.0in"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;&lt;font color=#000000&gt;Loader loads
t1&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt; 
&lt;li class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-list: l0 level2 lfo2; tab-stops: list 1.0in"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;&lt;font color=#000000&gt;Everything
works&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;
&lt;o:p&gt;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;&lt;font color=#000000&gt;Notice that
we no longer visit the forwarder in asm1. When the app owner re-compiled the app,
the compiler found t1 in asm2. As a result, we no longer needed the mis-step in asm1.
Like I said earlier, forwarders are merely a crutch for apps compiled against older
versions of your framework. Once the apps are re-compiled against the new version
of your framework, the forwarder is no longer needed (for that app). Unfortunately,
you’ll need to keep that forwarder in place for some time, as there are likely a whole
host of other apps and add-ins to those apps still reliant on the forwarder to work
properly.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;
&lt;o:p&gt;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;&lt;font color=#000000&gt;My next post
will deal with the details of forwarders and I’ll post some source that uses the feature.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://hoser.lander.ca/aggbug.ashx?id=f3d8944e-9c13-4531-b2aa-9784ca5bb916" /&gt;</description>
      <comments>http://hoser.lander.ca/CommentView,guid,f3d8944e-9c13-4531-b2aa-9784ca5bb916.aspx</comments>
      <category>Loader</category>
      <category>Versioning</category>
      <category>Wonders of Whidbey Factoring Features</category>
    </item>
    <item>
      <trackback:ping>http://hoser.lander.ca/Trackback.aspx?guid=ffd55b88-eab8-4215-a75b-1c01223876f6</trackback:ping>
      <pingback:server>http://hoser.lander.ca/pingback.aspx</pingback:server>
      <pingback:target>http://hoser.lander.ca/PermaLink,guid,ffd55b88-eab8-4215-a75b-1c01223876f6.aspx</pingback:target>
      <dc:creator>Rich Lander</dc:creator>
      <wfw:comment>http://hoser.lander.ca/CommentView,guid,ffd55b88-eab8-4215-a75b-1c01223876f6.aspx</wfw:comment>
      <wfw:commentRss>http://hoser.lander.ca/SyndicationService.asmx/GetEntryCommentsRss?guid=ffd55b88-eab8-4215-a75b-1c01223876f6</wfw:commentRss>
      <title>The Wonders of Whidbey Factoring Features – Part 0: Introduction</title>
      <guid isPermaLink="false">http://hoser.lander.ca/PermaLink,guid,ffd55b88-eab8-4215-a75b-1c01223876f6.aspx</guid>
      <link>http://hoser.lander.ca/2005/09/13/TheWondersOfWhidbeyFactoringFeaturesPart0Introduction.aspx</link>
      <pubDate>Tue, 13 Sep 2005 17:17:13 GMT</pubDate>
      <description>&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font color=#000000&gt;My last &lt;a href="http://hoser.lander.ca/CategoryView,category,Wonders%20of%20the%20Whidbey%20GAC.aspx"&gt;“Wonders
of Whidbey”&lt;/a&gt; series seemed to be quite well received, at least in terms of aggregator
traffic, so I thought that I’d do another one. This time, I’d like to talk about the
new factoring features in Whidbey. This topic has been bouncing around my head now
for quite some time, so it was easy to choose. I also have the next WoW series picked
out, but you’ll have to wait a little longer for that one.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;
&lt;o:p&gt;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font color=#000000&gt;I’d like to give you some insight into these features first. I’m
a little vague on the birth (early 2003?) of these two features, since I was not on
the CLR team yet, but working in another part of Microsoft at that time. I joined
the team in November 2003. In early 2003, a subset of the CLR team (and a bunch of
other folks from across the company) was working on some major improvements to managed
code versioning. They had a particular take on the problematic parts of the current
versioning system and had come up with quite an interesting solution. As part of that,
the team was going to do some serious factoring (moving types between assemblies)
of the .NET Framework, but that approach would have the negative effect of breaking
pretty much 100% of existing applications since type references included the assembly
identity. As a result, the team developed some cool factoring features in the CLR
to mitigate those problems. &lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font color=#000000&gt;We’re no longer going down the same path with versioning as we
thought we were back in 2003, but we’ve kept the factoring features in the product.
We do have some other uses for these features, but they are not quite as far reaching
as the earlier versioning plan. I think that Microsoft platform teams are realizing,
more and more, that many of the engineering problems that they face are not unique
to Microsoft, but are also faced by other software companies. That realization is
actually the basis of the &lt;a href="http://lab.msdn.microsoft.com/teamsystem/"&gt;Visual
Studio Team System&lt;/a&gt; products in a lot of ways. That’s a long way of saying that
we’ve kept these factoring features in the product, believing that they will be useful
to enough managed code developers out there. That being said, I don’t expect a lot
of folks out there to use these features. In fact, I’m hoping that adoption of these
features is left to niche scenarios, as I can imagine some folks painting themselves
into some bad corners if they do not use them judicially.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font color=#000000&gt;The features in question are colloquially called “Friend Assemblies”
and “Type Forwarders”. They have different names within the product, but I recommend
using these names since they are accurate and easier for folks to grasp than &lt;a href="http://winfx.msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/T_System_Runtime_CompilerServices_InternalsVisibleToAttribute.asp"&gt;InternalsVisibleTo&lt;/a&gt; and &lt;a href="http://winfx.msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/T_System_Runtime_CompilerServices_TypeForwardedToAttribute.asp"&gt;TypeForwardedTo&lt;/a&gt;.
Learn more about them in the following posts in this series.&lt;/font&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://hoser.lander.ca/aggbug.ashx?id=ffd55b88-eab8-4215-a75b-1c01223876f6" /&gt;</description>
      <comments>http://hoser.lander.ca/CommentView,guid,ffd55b88-eab8-4215-a75b-1c01223876f6.aspx</comments>
      <category>Loader</category>
      <category>Versioning</category>
      <category>Wonders of Whidbey Factoring Features</category>
    </item>
    <item>
      <trackback:ping>http://hoser.lander.ca/Trackback.aspx?guid=5ebbeab8-ffed-4ea3-82d2-bbfbe0ef7d99</trackback:ping>
      <pingback:server>http://hoser.lander.ca/pingback.aspx</pingback:server>
      <pingback:target>http://hoser.lander.ca/PermaLink,guid,5ebbeab8-ffed-4ea3-82d2-bbfbe0ef7d99.aspx</pingback:target>
      <dc:creator>Rich Lander</dc:creator>
      <wfw:comment>http://hoser.lander.ca/CommentView,guid,5ebbeab8-ffed-4ea3-82d2-bbfbe0ef7d99.aspx</wfw:comment>
      <wfw:commentRss>http://hoser.lander.ca/SyndicationService.asmx/GetEntryCommentsRss?guid=5ebbeab8-ffed-4ea3-82d2-bbfbe0ef7d99</wfw:commentRss>
      <slash:comments>2</slash:comments>
      <title>The Wonders of the Whidbey GAC -- Part IV: Shipping Everett and Whidbey Versions of the Same Code</title>
      <guid isPermaLink="false">http://hoser.lander.ca/PermaLink,guid,5ebbeab8-ffed-4ea3-82d2-bbfbe0ef7d99.aspx</guid>
      <link>http://hoser.lander.ca/2005/08/24/TheWondersOfTheWhidbeyGACPartIVShippingEverettAndWhidbeyVersionsOfTheSameCode.aspx</link>
      <pubDate>Wed, 24 Aug 2005 01:38:10 GMT</pubDate>
      <description>&lt;div class=itemBodyStyle&gt;
&lt;p&gt;
I mentioned &lt;a href="http://hoser.lander.ca/ct.ashx?id=08a81308-c68a-4aff-b1f1-9fc6cf160580&amp;amp;url=http%3a%2f%2fhoser.lander.ca%2fPermaLink%2cguid%2c558caa71-2649-4f01-bd63-75ab2cac35f6.aspx" ?&gt;&lt;strong&gt;&lt;font color=#696969&gt;earlier&lt;/font&gt;&lt;/strong&gt;&lt;/a&gt; that
a customer question&amp;nbsp;started off this thread. This is the post that most closely
aligns with their question. You can likely see why I've waited until now to answer
it, since the &lt;a href="http://hoser.lander.ca/ct.ashx?id=08a81308-c68a-4aff-b1f1-9fc6cf160580&amp;amp;url=http%3a%2f%2fhoser.lander.ca%2fCategoryView%2ccategory%2cWonders%2520of%2520the%2520Whidbey%2520GAC.aspx" ?&gt;&lt;strong&gt;&lt;font color=#696969&gt;earlier
posts&lt;/font&gt;&lt;/strong&gt;&lt;/a&gt;&amp;nbsp;have all provided information on how the GACs work,
either separately or in tandem.
&lt;/p&gt;
&lt;p&gt;
This post isn't exclusive to the GAC, but we'll keep it in the same theme since we're
on a roll here and since it does apply w/o too much of a stretch. 
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;Ship both Everett and Whidbey Versions&lt;br&gt;
&lt;/strong&gt;This is the approach that will make your customers most happy. Everett customers
have a library that they can code against. At this point, there are way more Everett
customers out there than Whidbey ones, so providing an Everett version likely makes
business sense in the short-term. At the same time, you recognize that Whidbey customers
have different requirements. Folks who have been playing (or more than playing with
our Beta 2 "Go Live" license) with Whidbey for a number of months now (or longer)
have gotten used to the Whidbey way of doing things. A bunch of them probably now
say "of T" at the end of all their sentences, even at home. Kinda like how I always&amp;nbsp;say
"eh" ;)&amp;nbsp;In the same way that you want to keep existing customers on Everett happy,
you want to ride the Whidbey adoption curve, picking up&amp;nbsp;sales (if that's the
kind of&amp;nbsp;business you are in) from folks coding exclusively in VS2005&amp;nbsp;with
a Whidbey version of your product.
&lt;/p&gt;
&lt;p&gt;
This&amp;nbsp;post isn't intended to cover exactly how you produce these two separate&amp;nbsp;version.
I should consider a post on this topic at a later time.&amp;nbsp;The two basic approaches
are: (A)&amp;nbsp;have two separate source trees, or (B) a single one with lots of &lt;a href="http://hoser.lander.ca/ct.ashx?id=08a81308-c68a-4aff-b1f1-9fc6cf160580&amp;amp;url=http%3a%2f%2fmsdn.microsoft.com%2flibrary%2fdefault.asp%3furl%3d%2flibrary%2fen-us%2fcsref%2fhtml%2fvclrfPreprocessorDirectives.asp" ?&gt;&lt;strong&gt;&lt;font color=#696969&gt;conditional
code&lt;/font&gt;&lt;/strong&gt;&lt;/a&gt;. There are advantages and disadvantages to both and you need
to decide which path you will go down.
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;Versioning The Everett and Whidbey Versions&lt;br&gt;
&lt;/strong&gt;Finally, we're at the core of the customer question. Now that you've decided
to ship the two versions in tandem, what do you do about version numbers and that
sort of thing. Hmmm.
&lt;/p&gt;
&lt;p&gt;
&lt;em&gt;Scenario 1 - The Whidbey version is the same code as the Everett version, just
compiled with a Whidbey compiler&lt;/em&gt;
&lt;br&gt;
- For starters, this is not a super-high-value proposition for class libraries. You
definitely are doing your due diligence to avoid breaking changes, but that's it.
Also, you can run your Everett code through the Whidbey compilers to do &lt;a href="http://hoser.lander.ca/ct.ashx?id=08a81308-c68a-4aff-b1f1-9fc6cf160580&amp;amp;url=http%3a%2f%2fhoser.lander.ca%2fCategoryView%2ccategory%2cCompatibility.aspx" ?&gt;&lt;strong&gt;&lt;font color=#696969&gt;compatibility
testing&lt;/font&gt;&lt;/strong&gt;&lt;/a&gt;&amp;nbsp;as part of your general testing.&lt;br&gt;
- This is a high-value-proposition for applications (you get an&amp;nbsp;.exe from the
compiler). By compiling an Everett app with a Whidbey compiler, you enable running
natively on a 64-bit machine. Everett apps always run under WoW64 on 64-bit machines.
This post isn't about applications though, but class libraries.&lt;br&gt;
- Anyway, if you decide to go this route, I would keep the version numbers of the
Everett and Whidbey components exactly the same, but give the binaries different names
(i.e. FooWidgetE.dll, FooWidgetW.dll). Since they are compiled against different CLRs,
the code will end up in different GACs, which will further separate them.
&lt;/p&gt;
&lt;p&gt;
&lt;em&gt;Scenario 2 - The Whidbey and Everett versions are mostly the same code, compiled
out of the same codebase with pre-processor directives&lt;br&gt;
&lt;/em&gt;- First, I would only do this if the differences between the Everett and Whidbey
versions -- which will directly affect the number of pre-processor directives you
have in your code -- is not dramatic&lt;br&gt;
- I'm assuming that the Everett and Whidbey versions have the same general object
models, with a&amp;nbsp;few members and types being specific to Whidbey 
&lt;br&gt;
- I would do the same thing as Scenario 1 above with differently named assemblies&lt;br&gt;
- If they are on radically different ship cycles, I might start to lean towards scenario
3
&lt;/p&gt;
&lt;p&gt;
&lt;em&gt;Scenario 3 -- The Whidbey and Everett versions are different code 
&lt;br&gt;
&lt;/em&gt;- This approach will be the best one if you intend to move your object model
in a different direction in the Whidbey codebase&lt;br&gt;
- I would name the assemblies differently, more differently than in scenario 1 above&lt;br&gt;
- I would not make any effort to keep the version numbers in sync. They might stay
in sync, however, if you always ship the two versions on the same schedule&lt;br&gt;
- I would probably change the namespace names too, to make it clear that this is a
new thing. This is debatable though since it makes migration harder. The thing that
this does do though is make it clear when a customer moves to the Whidbey version
that they have more than just a re-compile on their hands
&lt;/p&gt;
&lt;p&gt;
Your code may not fall perfectly into the above buckets, but you'll at least get the
idea of some possible directions to take. As always, you need to come up with a plan
that makes sense for your product, not just blindly follow a plan outlines on some
blog, particularly one that is called "hoser".
&lt;/p&gt;
&lt;/div&gt;
&lt;img width="0" height="0" src="http://hoser.lander.ca/aggbug.ashx?id=5ebbeab8-ffed-4ea3-82d2-bbfbe0ef7d99" /&gt;</description>
      <comments>http://hoser.lander.ca/CommentView,guid,5ebbeab8-ffed-4ea3-82d2-bbfbe0ef7d99.aspx</comments>
      <category>Loader</category>
      <category>Wonders of the Whidbey GAC</category>
    </item>
    <item>
      <trackback:ping>http://hoser.lander.ca/Trackback.aspx?guid=ce46d8f3-32c4-4917-8bb6-4baa20d7e086</trackback:ping>
      <pingback:server>http://hoser.lander.ca/pingback.aspx</pingback:server>
      <pingback:target>http://hoser.lander.ca/PermaLink,guid,ce46d8f3-32c4-4917-8bb6-4baa20d7e086.aspx</pingback:target>
      <dc:creator>Rich Lander</dc:creator>
      <wfw:comment>http://hoser.lander.ca/CommentView,guid,ce46d8f3-32c4-4917-8bb6-4baa20d7e086.aspx</wfw:comment>
      <wfw:commentRss>http://hoser.lander.ca/SyndicationService.asmx/GetEntryCommentsRss?guid=ce46d8f3-32c4-4917-8bb6-4baa20d7e086</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
In my two (<a href="http://hoser.lander.ca/PermaLink,guid,fa860ae2-4ffe-4cbe-b86b-37bce1ceab71.aspx">one </a>and <a href="http://hoser.lander.ca/PermaLink,guid,558caa71-2649-4f01-bd63-75ab2cac35f6.aspx">two</a>)
earlier "<a href="/CategoryView,category,Wonders%20of%20the%20Whidbey%20GAC.aspx">Wonders
of the Whidbey GAC</a>" posts, I talked about processor architecture and interop with
the Everett GAC. I left out one piece of interesting data because it wouldn't make
as much sense until you had read the earlier posts. This data point is the binding
order among the GACs. Naturally, you cannot look at them all at once, so we defined
an order of probing the GACs that we always adhere to and tends to make sense.
</p>
        <p>
Here is is:
</p>
        <ol>
          <li>
Bitness GAC 
<ul><li>
"gac_32" when running on a 32-bit machine or under WoW64 on a 64-bit machine 
</li><li>
"gac_64" when running natively (not WoW64) on a 64-bit machine (this is the normal
case for Whidbey apps on a 64-bit machine)</li></ul></li>
          <li>
Bitness agnostic GAC 
<ul><li>
"gac_msil" on all machines 
</li><li>
assemblies in this GAC run equally well everywhere (X64, X86, IA64)</li></ul></li>
          <li>
Legacy v1.x GAC 
<ul><li>
"gac" on all machines 
</li><li>
this is where v1.0 and everett assemblies go</li></ul></li>
        </ol>
        <p>
You can read this same information on <a href="http://blogs.msdn.com/junfeng/archive/2004/09/12/228635.aspx">Junfeng's
blog too</a>, as he implemented all of this. I just slow him down ;)
</p>
        <p>
Junfeng referes to MSIL assemblies as "portable". I use the term "agnostic". It is
the same thing. 
</p>
        <p>
If you write managed code in your favourite language (i.e. c#, vb) and don't do anything
special, your assemblies will fall into this category. You can do the same thing with
MC++ code too, if you compile it as /clrpure; otherwise, mc++ code is by design "bit-specific".
Oh, there's another term, but I'm sure you can figure that one out.
</p>
        <p>
If you are unsure of which of the three GAC buckets above your assembly will fall
into, and your assembly is strong-name signed, install it into the GAC with gacutil
/i from the Whidbey SDK. Gacutil will install the assembly into the correct GAC and
then you'll know for sure. You can also open up the assembly (not required to be strong-name
signed) in ildasm. That will also tell you the same answer.
</p>
        <img width="0" height="0" src="http://hoser.lander.ca/aggbug.ashx?id=ce46d8f3-32c4-4917-8bb6-4baa20d7e086" />
      </body>
      <title>The Wonders of the Whidbey GAC -- Part III: Binding Order Among the v1.x, v2.0 MSIL and v2.0 Bitness GACs</title>
      <guid isPermaLink="false">http://hoser.lander.ca/PermaLink,guid,ce46d8f3-32c4-4917-8bb6-4baa20d7e086.aspx</guid>
      <link>http://hoser.lander.ca/2005/08/23/TheWondersOfTheWhidbeyGACPartIIIBindingOrderAmongTheV1xV20MSILAndV20BitnessGACs.aspx</link>
      <pubDate>Tue, 23 Aug 2005 02:47:45 GMT</pubDate>
      <description>&lt;p&gt;
In my two (&lt;a href="http://hoser.lander.ca/PermaLink,guid,fa860ae2-4ffe-4cbe-b86b-37bce1ceab71.aspx"&gt;one &lt;/a&gt;and &lt;a href="http://hoser.lander.ca/PermaLink,guid,558caa71-2649-4f01-bd63-75ab2cac35f6.aspx"&gt;two&lt;/a&gt;)
earlier "&lt;a href="/CategoryView,category,Wonders%20of%20the%20Whidbey%20GAC.aspx"&gt;Wonders
of the Whidbey GAC&lt;/a&gt;" posts, I talked about processor architecture and interop with
the Everett GAC. I left out one piece of interesting data because it wouldn't make
as much sense until you had read the earlier posts. This data point is the binding
order among the GACs. Naturally, you cannot look at them all at once, so we defined
an order of probing the GACs that we always adhere to and tends to make sense.
&lt;/p&gt;
&lt;p&gt;
Here is is:
&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
Bitness GAC 
&lt;ul&gt;
&lt;li&gt;
"gac_32" when running on a 32-bit machine or under WoW64 on a 64-bit machine 
&lt;li&gt;
"gac_64" when running natively (not WoW64) on a 64-bit machine (this is the normal
case for Whidbey apps on a 64-bit machine)&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;
Bitness agnostic GAC 
&lt;ul&gt;
&lt;li&gt;
"gac_msil" on all machines 
&lt;li&gt;
assemblies in this GAC run equally well everywhere (X64, X86, IA64)&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;
Legacy v1.x GAC 
&lt;ul&gt;
&lt;li&gt;
"gac" on all machines 
&lt;li&gt;
this is where v1.0 and everett assemblies go&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
You can read this same information on &lt;a href="http://blogs.msdn.com/junfeng/archive/2004/09/12/228635.aspx"&gt;Junfeng's
blog too&lt;/a&gt;, as he implemented all of this. I just slow him down ;)
&lt;/p&gt;
&lt;p&gt;
Junfeng referes to MSIL assemblies as "portable". I use the term "agnostic". It is
the same thing. 
&lt;/p&gt;
&lt;p&gt;
If you write managed code in your favourite language (i.e. c#, vb) and don't do anything
special, your assemblies will fall into this category. You can do the same thing with
MC++ code too, if you compile it as /clrpure; otherwise, mc++ code is by design "bit-specific".
Oh, there's another term, but I'm sure you can figure that one out.
&lt;/p&gt;
&lt;p&gt;
If you are unsure of which of the three GAC buckets above your assembly will fall
into, and your assembly is strong-name signed, install it into the GAC with gacutil
/i from the Whidbey SDK. Gacutil will install the assembly into the correct GAC and
then you'll know for sure. You can also open up the assembly (not required to be strong-name
signed) in ildasm. That will also tell you the same answer.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://hoser.lander.ca/aggbug.ashx?id=ce46d8f3-32c4-4917-8bb6-4baa20d7e086" /&gt;</description>
      <comments>http://hoser.lander.ca/CommentView,guid,ce46d8f3-32c4-4917-8bb6-4baa20d7e086.aspx</comments>
      <category>Loader</category>
      <category>Wonders of the Whidbey GAC</category>
    </item>
    <item>
      <trackback:ping>http://hoser.lander.ca/Trackback.aspx?guid=558caa71-2649-4f01-bd63-75ab2cac35f6</trackback:ping>
      <pingback:server>http://hoser.lander.ca/pingback.aspx</pingback:server>
      <pingback:target>http://hoser.lander.ca/PermaLink,guid,558caa71-2649-4f01-bd63-75ab2cac35f6.aspx</pingback:target>
      <dc:creator>Rich Lander</dc:creator>
      <wfw:comment>http://hoser.lander.ca/CommentView,guid,558caa71-2649-4f01-bd63-75ab2cac35f6.aspx</wfw:comment>
      <wfw:commentRss>http://hoser.lander.ca/SyndicationService.asmx/GetEntryCommentsRss?guid=558caa71-2649-4f01-bd63-75ab2cac35f6</wfw:commentRss>
      <slash:comments>2</slash:comments>
      <title>The Wonders of the Whidbey GAC -- Part II: Interop with the Everett GAC</title>
      <guid isPermaLink="false">http://hoser.lander.ca/PermaLink,guid,558caa71-2649-4f01-bd63-75ab2cac35f6.aspx</guid>
      <link>http://hoser.lander.ca/2005/08/22/TheWondersOfTheWhidbeyGACPartIIInteropWithTheEverettGAC.aspx</link>
      <pubDate>Mon, 22 Aug 2005 04:39:12 GMT</pubDate>
      <description>&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-FAMILY: Arial"&gt;&lt;font color=#000000&gt;&lt;font face=Verdana&gt;I received
a question from a customer a few days ago about assembly versioning. I receive questions
quite often, of which &amp;gt;90% surprisingly enough come via &lt;/font&gt;&lt;a href="http://blogs.msdn.com/brada"&gt;&lt;font face=Verdana&gt;Brad&lt;/font&gt;&lt;/a&gt;&lt;font face=Verdana&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;.
I can only imagine what his inbox looks like every morning! Anyway, the question touched
on the focus for this post which is the relationship between the Everett and Whidbey
GACs. Before I go any further, I’m happy to report that the relationship is sensible
and easy to understand. Too often, things don’t make a lot of sense and that always
bugs me.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-FAMILY: Arial"&gt;
&lt;o:p&gt;
&lt;font face=Verdana color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-FAMILY: Arial"&gt;&lt;font color=#000000&gt;&lt;font face=Verdana&gt;The customer’s
question was actually about assembly versioning in the case that you want to support
Everett and Whidbey, which I hope to cover tomorrow, since that’s when I told them
I’d give them an answer ;)&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-FAMILY: Arial"&gt;
&lt;o:p&gt;
&lt;font face=Verdana color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-FAMILY: Arial"&gt;&lt;font color=#000000&gt;&lt;font face=Verdana&gt;First things
first, on the surface it seems like interop between the GACs is what is wanted. In
actual fact, it is the behaviour of the CLR loader and gacutil.exe that is really
the interesting part. The GACs themselves are passive and don’t do anything other
than act as a quite compelling directory structure for holding code w/o any naming
conflicts.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-FAMILY: Arial"&gt;
&lt;o:p&gt;
&lt;font face=Verdana color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;span style="FONT-FAMILY: Arial"&gt;&lt;font color=#000000&gt;&lt;font face=Verdana&gt;&lt;?xml:namespace prefix = st1 ns = "urn:schemas-microsoft-com:office:smarttags" /&gt;Migrating
the 
&lt;st1:City w:st="on"&gt;
&lt;st1:place w:st="on"&gt;Everett&lt;/st1:place&gt;
&lt;/st1:City&gt;
GAC to the Whidbey GAC&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-FAMILY: Arial"&gt;&lt;font color=#000000&gt;&lt;font face=Verdana&gt;We don’t do
anything like this. This would have been the wrong direction for multiple reasons.
Just thought I’d take care of this one up-front.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-FAMILY: Arial"&gt;
&lt;o:p&gt;
&lt;font face=Verdana color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;span style="FONT-FAMILY: Arial"&gt;&lt;font color=#000000&gt;&lt;font face=Verdana&gt;Hard
linking assemblies between the 
&lt;st1:place w:st="on"&gt;
&lt;st1:City w:st="on"&gt;Everett&lt;/st1:City&gt;
&lt;/st1:place&gt;
and Whidbey GACs as a Perfomance Enhancement&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-FAMILY: Arial"&gt;&lt;font color=#000000&gt;&lt;font face=Verdana&gt;I’m glad that
we didn’t do anything like this either. Ouch. OK, now onto the real answers.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-FAMILY: Arial"&gt;
&lt;o:p&gt;
&lt;font face=Verdana color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;span style="FONT-FAMILY: Arial"&gt;&lt;font color=#000000&gt;&lt;font face=Verdana&gt;Whidbey
CLR Loader GAC Probing&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-FAMILY: Arial"&gt;&lt;font color=#000000&gt;&lt;font face=Verdana&gt;The Whidbey
CLR loader – Fusion in this case – probes for assemblies in the Everett and Whidbey
GACs when an assembly request comes through the system. I’ll skip the exact algorithm
and any optimizations that we might do. The high-order bit here is that we do indeed
look in both GACs, so there is no need to stop using the Everett GAC for 
&lt;st1:City w:st="on"&gt;
&lt;st1:place w:st="on"&gt;Everett&lt;/st1:place&gt;
&lt;/st1:City&gt;
assemblies since we look there. In fact, as you’ll find out below, you cannot stop
using the Everett GAC.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-FAMILY: Arial"&gt;
&lt;o:p&gt;
&lt;font face=Verdana color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;span style="FONT-FAMILY: Arial"&gt;&lt;font color=#000000&gt;&lt;font face=Verdana&gt;Gacutil.exe,
the Fusion APIs and installation via MSI (installers)&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-FAMILY: Arial"&gt;&lt;font color=#000000&gt;&lt;font face=Verdana&gt;There are
several ways that you can get assemblies installed into the GAC, with the last one
being the recommended option. The big thing I wanted to know when I asked the question
is what the expected behaviour was when I added an assembly to the GAC via these different
methods.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-FAMILY: Arial"&gt;
&lt;o:p&gt;
&lt;font face=Verdana color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-FAMILY: Arial"&gt;&lt;font color=#000000&gt;&lt;font face=Verdana&gt;Question: 
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-FAMILY: Arial"&gt;&lt;font color=#000000&gt;&lt;font face=Verdana&gt;Do the Whidbey
tools put 
&lt;st1:City w:st="on"&gt;
&lt;st1:place w:st="on"&gt;Everett&lt;/st1:place&gt;
&lt;/st1:City&gt;
assemblies into the Everett GAC?&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-FAMILY: Arial"&gt;&lt;font color=#000000&gt;&lt;font face=Verdana&gt;&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-FAMILY: Arial"&gt;&lt;font color=#000000&gt;&lt;font face=Verdana&gt;Given:&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-FAMILY: Arial"&gt;&lt;font color=#000000&gt;&lt;font face=Verdana&gt;Everett and
Whidbey .NET Frameworks are installed on the machine&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-FAMILY: Arial"&gt;&lt;font color=#000000&gt;&lt;font face=Verdana&gt;&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-FAMILY: Arial"&gt;&lt;font color=#000000&gt;&lt;font face=Verdana&gt;Assemblies:&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-FAMILY: Arial"&gt;&lt;font color=#000000&gt;&lt;font face=Verdana&gt;1) 1 assembly
compiled against 
&lt;st1:City w:st="on"&gt;
&lt;st1:place w:st="on"&gt;Everett&lt;/st1:place&gt;
&lt;/st1:City&gt;
csc.exe (csharp compiler)&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-FAMILY: Arial"&gt;&lt;font color=#000000&gt;&lt;font face=Verdana&gt;2) 1 assembly
compiled against Whidbey vbc.exe (vb compiler)&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-FAMILY: Arial"&gt;&lt;font color=#000000&gt;&lt;font face=Verdana&gt;Note: the
compilers (vb, csharp) don’t matter for the assemblies above. I’m just trying to mix
it up a little. It is the .Net Framework versions that matter.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-FAMILY: Arial"&gt;&lt;font color=#000000&gt;&lt;font face=Verdana&gt;&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-FAMILY: Arial"&gt;&lt;font color=#000000&gt;&lt;font face=Verdana&gt;Tools:&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-FAMILY: Arial"&gt;&lt;font color=#000000&gt;&lt;font face=Verdana&gt;A) 
&lt;st1:City w:st="on"&gt;
&lt;st1:place w:st="on"&gt;Everett&lt;/st1:place&gt;
&lt;/st1:City&gt;
Gacutil&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-FAMILY: Arial"&gt;&lt;font color=#000000&gt;&lt;font face=Verdana&gt;B) 
&lt;st1:City w:st="on"&gt;
&lt;st1:place w:st="on"&gt;Everett&lt;/st1:place&gt;
&lt;/st1:City&gt;
Fusion APIs&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-FAMILY: Arial"&gt;&lt;font color=#000000&gt;&lt;font face=Verdana&gt;C) Whidbey
Gacutil&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-FAMILY: Arial"&gt;&lt;font color=#000000&gt;&lt;font face=Verdana&gt;D) Whidbey
Fusion APIs&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-FAMILY: Arial"&gt;&lt;font color=#000000&gt;&lt;font face=Verdana&gt;E) MSI installation&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-FAMILY: Arial"&gt;&lt;font color=#000000&gt;&lt;font face=Verdana&gt;&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-FAMILY: Arial"&gt;&lt;font color=#000000&gt;&lt;font face=Verdana&gt;Scenarios
+ expected outcome:&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-FAMILY: Arial"&gt;&lt;font color=#000000&gt;&lt;font face=Verdana&gt;1. (1) + (A)
-- 
&lt;st1:City w:st="on"&gt;
&lt;st1:place w:st="on"&gt;Everett&lt;/st1:place&gt;
&lt;/st1:City&gt;
GAC&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-FAMILY: Arial"&gt;&lt;font color=#000000&gt;&lt;font face=Verdana&gt;2. (1) + (B)
-- 
&lt;st1:City w:st="on"&gt;
&lt;st1:place w:st="on"&gt;Everett&lt;/st1:place&gt;
&lt;/st1:City&gt;
GAC&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-FAMILY: Arial"&gt;&lt;font color=#000000&gt;&lt;font face=Verdana&gt;3. (1) + (C)
-- 
&lt;st1:City w:st="on"&gt;
&lt;st1:place w:st="on"&gt;Everett&lt;/st1:place&gt;
&lt;/st1:City&gt;
GAC&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-FAMILY: Arial"&gt;&lt;font color=#000000&gt;&lt;font face=Verdana&gt;4. (1) + (D)
-- 
&lt;st1:City w:st="on"&gt;
&lt;st1:place w:st="on"&gt;Everett&lt;/st1:place&gt;
&lt;/st1:City&gt;
GAC&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-FAMILY: Arial"&gt;&lt;font color=#000000&gt;&lt;font face=Verdana&gt;5. (1) + (E)
-- 
&lt;st1:City w:st="on"&gt;
&lt;st1:place w:st="on"&gt;Everett&lt;/st1:place&gt;
&lt;/st1:City&gt;
GAC&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-FAMILY: Arial"&gt;&lt;font color=#000000&gt;&lt;font face=Verdana&gt;6. (2) + (A)
-- failure&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-FAMILY: Arial"&gt;&lt;font color=#000000&gt;&lt;font face=Verdana&gt;7. (2) + (B)
-- failure&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-FAMILY: Arial"&gt;&lt;font color=#000000&gt;&lt;font face=Verdana&gt;8. (2) + (C)
--&amp;nbsp;Whidbey GAC&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-FAMILY: Arial"&gt;&lt;font color=#000000&gt;&lt;font face=Verdana&gt;9. (2) + (D)
--&amp;nbsp;Whidbey&amp;nbsp;GAC&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-FAMILY: Arial"&gt;&lt;font color=#000000&gt;&lt;font face=Verdana&gt;10. (2) +
(E) --&amp;nbsp;Whidbey GAC&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-FAMILY: Arial"&gt;
&lt;o:p&gt;
&lt;font face=Verdana color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-FAMILY: Arial"&gt;
&lt;o:p&gt;
&lt;font color=#000000&gt;&lt;font face=Verdana&gt;Scenarions 6 and 7 fail since Whidbey-compiled
assemblies are not loadable via the Everett CLR. Also, since &lt;/font&gt;&lt;a href="/PermaLink,guid,fa860ae2-4ffe-4cbe-b86b-37bce1ceab71.aspx"&gt;&lt;font face=Verdana&gt;processor
architecture&lt;/font&gt;&lt;/a&gt;&lt;font face=Verdana&gt; is a major part of Whidbey, it would be
difficult to store Whidbey assemblies in the Everett GAC in a reasonable manner.&lt;/font&gt;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-FAMILY: Arial"&gt;
&lt;o:p&gt;
&lt;font color=#000000&gt;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;&amp;nbsp;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;span style="FONT-FAMILY: Arial"&gt;&lt;font color=#000000&gt;&lt;font face=Verdana&gt;Why
does Whidbey put 
&lt;st1:City w:st="on"&gt;Everett&lt;/st1:City&gt;
assemblies into the 
&lt;st1:City w:st="on"&gt;
&lt;st1:place w:st="on"&gt;Everett&lt;/st1:place&gt;
&lt;/st1:City&gt;
GAC?&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-FAMILY: Arial"&gt;&lt;font color=#000000&gt;&lt;font face=Verdana&gt;We continue
putting 
&lt;st1:City w:st="on"&gt;
&lt;st1:place w:st="on"&gt;Everett&lt;/st1:place&gt;
&lt;/st1:City&gt;
assemblies into the Everett GAC for two reasons:&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-FAMILY: Arial"&gt;
&lt;o:p&gt;
&lt;font face=Verdana color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo1; tab-stops: list .5in"&gt;
&lt;font color=#000000&gt;&lt;font face=Verdana&gt;&lt;span style="FONT-FAMILY: Arial; mso-fareast-font-family: Arial"&gt;&lt;span style="mso-list: Ignore"&gt;-&lt;span style="FONT: 7pt 'Times New Roman'"&gt;&lt;font size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;st1:City w:st="on"&gt;
&lt;st1:place w:st="on"&gt;
&lt;span style="FONT-FAMILY: Arial"&gt;Everett&lt;/span&gt;
&lt;/st1:place&gt;
&lt;/st1:City&gt;
&lt;span style="FONT-FAMILY: Arial"&gt; apps still require those assemblies and will only
be able to use them if they are in the Everett GAC since the Everett CLR loader knows
nothing about the Whidbey GAC. It is much easier and smarter for the Whidbey loader
to look in the Everett GAC.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo1; tab-stops: list .5in"&gt;
&lt;font color=#000000&gt;&lt;font face=Verdana&gt;&lt;span style="FONT-FAMILY: Arial; mso-fareast-font-family: Arial"&gt;&lt;span style="mso-list: Ignore"&gt;-&lt;span style="FONT: 7pt 'Times New Roman'"&gt;&lt;font size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;st1:City w:st="on"&gt;
&lt;span style="FONT-FAMILY: Arial"&gt;Everett&lt;/span&gt;
&lt;/st1:City&gt;
&lt;span style="FONT-FAMILY: Arial"&gt; assemblies didn’t have the concept of processor
architecture, which the Whidbey GAC is heavily based on, so it doesn’t make sense
to store 
&lt;st1:place w:st="on"&gt;
&lt;st1:City w:st="on"&gt;Everett&lt;/st1:City&gt;
&lt;/st1:place&gt;
assemblies in that new structure.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo1; tab-stops: list .5in"&gt;
&lt;font color=#000000&gt;&lt;font face=Verdana&gt;&lt;span style="FONT-FAMILY: Arial; mso-fareast-font-family: Arial"&gt;&lt;span style="mso-list: Ignore"&gt;-&lt;span style="FONT: 7pt 'Times New Roman'"&gt;&lt;font size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;st1:City w:st="on"&gt;
&lt;st1:place w:st="on"&gt;
&lt;span style="FONT-FAMILY: Arial"&gt;Everett&lt;/span&gt;
&lt;/st1:place&gt;
&lt;/st1:City&gt;
&lt;span style="FONT-FAMILY: Arial"&gt; is going to live for a long time. Let’s not mess
with a good thing ;)&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-FAMILY: Arial"&gt;
&lt;o:p&gt;
&lt;font face=Verdana color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-FAMILY: Arial"&gt;&lt;font color=#000000&gt;&lt;font face=Verdana&gt;That was actually
3 reasons, if you count the last one.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-FAMILY: Arial"&gt;
&lt;o:p&gt;
&lt;font face=Verdana color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font color=#000000&gt;&lt;font face=Verdana&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;span style="FONT-FAMILY: Arial"&gt;Is
there an 
&lt;st1:City w:st="on"&gt;Everett&lt;/st1:City&gt;
GAC if there is no 
&lt;st1:City w:st="on"&gt;
&lt;st1:place w:st="on"&gt;Everett&lt;/st1:place&gt;
&lt;/st1:City&gt;
.NET Framework on the Machine, but only Whidbey?&lt;/span&gt;&lt;/b&gt;&lt;span style="FONT-FAMILY: Arial"&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-FAMILY: Arial"&gt;&lt;font color=#000000&gt;&lt;font face=Verdana&gt;Yes. The Everett
GAC is created as needed when 
&lt;st1:City w:st="on"&gt;
&lt;st1:place w:st="on"&gt;Everett&lt;/st1:place&gt;
&lt;/st1:City&gt;
is not on machine. This means that the Everett GAC structure is auto-created when
the first Everett-era assembly is added to the Whidbey-only machine. If 
&lt;st1:City w:st="on"&gt;Everett&lt;/st1:City&gt;
was also on this machine, the Everett GAC would have been created at the point that
the 
&lt;st1:City w:st="on"&gt;
&lt;st1:place w:st="on"&gt;Everett&lt;/st1:place&gt;
&lt;/st1:City&gt;
.NET Framework was installed.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-FAMILY: Arial"&gt;
&lt;o:p&gt;
&lt;font face=Verdana color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://hoser.lander.ca/aggbug.ashx?id=558caa71-2649-4f01-bd63-75ab2cac35f6" /&gt;</description>
      <comments>http://hoser.lander.ca/CommentView,guid,558caa71-2649-4f01-bd63-75ab2cac35f6.aspx</comments>
      <category>Loader</category>
      <category>Wonders of the Whidbey GAC</category>
    </item>
    <item>
      <trackback:ping>http://hoser.lander.ca/Trackback.aspx?guid=fa860ae2-4ffe-4cbe-b86b-37bce1ceab71</trackback:ping>
      <pingback:server>http://hoser.lander.ca/pingback.aspx</pingback:server>
      <pingback:target>http://hoser.lander.ca/PermaLink,guid,fa860ae2-4ffe-4cbe-b86b-37bce1ceab71.aspx</pingback:target>
      <dc:creator>Rich Lander</dc:creator>
      <wfw:comment>http://hoser.lander.ca/CommentView,guid,fa860ae2-4ffe-4cbe-b86b-37bce1ceab71.aspx</wfw:comment>
      <wfw:commentRss>http://hoser.lander.ca/SyndicationService.asmx/GetEntryCommentsRss?guid=fa860ae2-4ffe-4cbe-b86b-37bce1ceab71</wfw:commentRss>
      <slash:comments>5</slash:comments>
      <title>The Wonders of the Whidbey GAC -- Part I: Processor Architecture</title>
      <guid isPermaLink="false">http://hoser.lander.ca/PermaLink,guid,fa860ae2-4ffe-4cbe-b86b-37bce1ceab71.aspx</guid>
      <link>http://hoser.lander.ca/2005/08/20/TheWondersOfTheWhidbeyGACPartIProcessorArchitecture.aspx</link>
      <pubDate>Sat, 20 Aug 2005 05:02:47 GMT</pubDate>
      <description>&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;&lt;font color=#000000&gt;The GAC --
Global Assembly Cache -- is a popular topic among managed code developers. It serves
two main purposes: (A) as a catalogue of the globally publicly available assemblies
available on the system, indexed by strong name, and (B) the location of those same
files.&amp;nbsp;It is not my intent to describe the GAC, however; look &lt;a href="http://msdn2.microsoft.com/library/yf1d93sz(en-us,vs.80).aspx"&gt;here&lt;/a&gt; &lt;/font&gt;&lt;font color=#000000&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;for
more info. My intent is to describe some interesting changes that have been made to
the GAC for Whidbey and to promote some good practices. This is part I and is dedicated
to processor architecture; we'll see how far we get with the series ;)&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;&lt;font color=#000000&gt;Whidbey is
the first CLR release in which we support 64-bit execution. The CLR team has been
working on porting the CLR to 64-bit for several years now and is now releasing it
to the world with Whidbey. Woohoo!&amp;nbsp;Not surprisingly,&amp;nbsp;64-bit has required&amp;nbsp;a
lot of changes all over the CLR, as it&amp;nbsp;imports a bunch of new concepts onto us.&amp;nbsp;My
favourite is the general concept of processor architecture, of which there are four
that we now support: X86, X64, IA64 and MSIL. We always supported the first and the
last, but there was never a strong reason to differentiate them considerably as we
only ran on a 32-bit system. 
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;&lt;font color=#000000&gt;&lt;?xml:namespace prefix = st1 ns = "urn:schemas-microsoft-com:office:smarttags" /&gt;With
respect to the v1.x GAC (v1.0 and 
&lt;st1:City w:st="on"&gt;
&lt;st1:place w:st="on"&gt;Everett&lt;/st1:place&gt;
&lt;/st1:City&gt;
share the same GAC), you can see pretty clearly that processor architecture was not
a design point.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font color=#000000&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;V1.x
GAC location&lt;br&gt;
&lt;/span&gt;&lt;/b&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;C:\Windows\assembly\GAC&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font color=#000000&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;V1.x
System.dll location&lt;br&gt;
&lt;/span&gt;&lt;/b&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;C:\WINDOWS\assembly\GAC\System\1.0.5000.0__b77a5c561934e089\System.dll&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;&lt;font color=#000000&gt;Where would
you have tagged the processor architecture? Nowhere that I can see. As a result, we
changed the GAC structure in Whidbey to accommodate processor architecture, which
is now an incredible important aspect of the GAC.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;&lt;font color=#000000&gt;V2.0
GAC locations on an x86 machine&lt;br&gt;
&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;&lt;font color=#000000&gt;C:\Windows\assembly\GAC_MSIL&lt;br&gt;
C:\Windows\assembly\GAC_32&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;&lt;font color=#000000&gt;V2.0
System.dll and mscorlib.dll locations on an x86 machine&lt;br&gt;
&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;&lt;font color=#000000&gt;C:\WINDOWS\assembly\GAC_MSIL\System\2.0.0.0__b77a5c561934e089\System.dll&lt;br&gt;
C:\WINDOWS\assembly\GAC_32\mscorlib\2.0.0.0__b77a5c561934e089\mscorlib.dll&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;&lt;font color=#000000&gt;V2.0
GAC locations on an x64 or IA64 machine&lt;br&gt;
&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;&lt;font color=#000000&gt;C:\Windows\assembly\GAC_MSIL&lt;br&gt;
C:\Windows\assembly\GAC_32&lt;br&gt;
C:\Windows\assembly\GAC_64&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;&lt;font color=#000000&gt;V2.0
System.dll and mscorlib.dll locations on an x64 machine&lt;br&gt;
&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;&lt;font color=#000000&gt;C:\WINDOWS\assembly\GAC_MSIL\System\2.0.0.0__b77a5c561934e089\System.dll&lt;br&gt;
C:\WINDOWS\assembly\GAC_32\mscorlib\2.0.0.0__b77a5c561934e089\mscorlib.dll&lt;br&gt;
C:\WINDOWS\assembly\GAC_64\mscorlib\2.0.0.0__b77a5c561934e089\mscorlib.dll&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;&lt;font color=#000000&gt;You can now
see that it is easy to tag assemblies with processor architecture. We’ve created three
GACs to do just that! As you can see, the GAC_64 directory only shows up on 64-bit
machines, which is hopefully quite intuitive.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;&lt;font color=#000000&gt;I’ve run out
of time to get any further in this post, but hopefully it gives you a good idea of
how and why the GAC changed, at least with respect to processor architecture in Whidbey.
I also hope I left you with the opinion that these changes were a good idea ;)&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;&lt;font color=#000000&gt;A question
to ponder: If you call System.Reflection.Assembly.Load(“System, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089”) and there is both a copy in the bit-specific GAC
and another in the bit-agnostic (MSIL) GAC, which do you get?&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://hoser.lander.ca/aggbug.ashx?id=fa860ae2-4ffe-4cbe-b86b-37bce1ceab71" /&gt;</description>
      <comments>http://hoser.lander.ca/CommentView,guid,fa860ae2-4ffe-4cbe-b86b-37bce1ceab71.aspx</comments>
      <category>Loader</category>
      <category>Wonders of the Whidbey GAC</category>
    </item>
    <item>
      <trackback:ping>http://hoser.lander.ca/Trackback.aspx?guid=3259fb4d-c760-4529-baad-93bfa08e12e7</trackback:ping>
      <pingback:server>http://hoser.lander.ca/pingback.aspx</pingback:server>
      <pingback:target>http://hoser.lander.ca/PermaLink,guid,3259fb4d-c760-4529-baad-93bfa08e12e7.aspx</pingback:target>
      <dc:creator>Rich Lander</dc:creator>
      <wfw:comment>http://hoser.lander.ca/CommentView,guid,3259fb4d-c760-4529-baad-93bfa08e12e7.aspx</wfw:comment>
      <wfw:commentRss>http://hoser.lander.ca/SyndicationService.asmx/GetEntryCommentsRss?guid=3259fb4d-c760-4529-baad-93bfa08e12e7</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Some time ago, I moved my blog to a 64-bit X64 server. This server was running <a href="http://www.microsoft.com/windowsserver2003/64bit/x64/default.mspx">Windows
Server 2003 SP1 Beta 1</a> and an early version of <a href="http://lab.msdn.microsoft.com/vs2005/downloads/netframework/default.aspx">Whidbey
Beta 2</a>. I thought that this was an excellent opportunity to dogfood (MS term
for early adoption) the <a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=DE4539CF-5D5C-4981-B27B-8AE747A7EA98&amp;displaylang=en">64-bit
version</a> of the framework, not to mention Server 2003 SP1. Another side aspect
of this exercise was that I was testing out the backwards compatibility of the .NET
Framework, since <a href="http://www.dasblog.net/">DasBlog</a> is built with the v1.1
version of the Framework.
</p>
        <p>
I'm happy to report that I've had zero problems with this new configuration, even
with beta software. The OS has now shipped, so there is no issue there, but the version
of Whidbey is still only Beta 2 and it is chugging day after day without issue. Doesn't
get better than that! It also shows the incredible value of MSIL -- what C#, VB.Net, <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dndotnet/html/pdc_eiffel.asp">Eiffel</a>, <a href="http://www.gotdotnet.com/workspaces/workspace.aspx?id=ad7acff7-ab1e-4bcb-99c0-57ac5a3a9742">IronPython</a>, <a href="http://www.netcobol.com/">Cobol</a> and
any other managed code compiler compiles down to -- given that the Everett DasBlog
code "just works" on 64-bit Whidbey, even though 64-bit was not a supported (or possible)
configuration of Everett.
</p>
        <p>
One of the major features of Whidbey ASP.Net is <a href="http://weblogs.asp.net/scottgu/archive/2003/11/25/39620.aspx">XHTML
compliance</a>. DasBlog was not designed to be 100% XHTML compliant, so would not
work on the first try on Whidbey. We had to use a special <a href="http://weblogs.asp.net/scottgu/archive/2005/05/11/406515.aspx">config
switch</a> to turn off XHTML compliance in Whidbey. After that, everything worked
perfectly, in terms of performance, backwards compatibility and general behaviour
of the app. I'm very happy and can say that Whidbey Beta 2 is ready for prime-time
development. To that end, the .NET Framework is allowing companies to "go live" with
our <a href="http://lab.msdn.microsoft.com/vs2005/golive/">"go live" license</a>.
This means that you can build/migrate a public-facing application with Whidbey
Beta 2.
</p>
        <p>
Back to 64-bit ... I must say that the 64-bit support in Whidbey is very cool. I have
two high-end X64 boxes in my office, one from Intel and the other from AMD. I use
them for various purposes and am quite happy with them. In particular, I really like
building and debugging apps on my 64-bit machines, having them run in native 64-bit,
but then being able to deploy them to both 32- and 64-bit machines. The portability
of managed code assemblies across different CPU architectures (IA64, X64, X86) is
a huge win.
</p>
        <p>
I've also been running early 64-bit versions of Longhorn on these two X64 machines.
I haven't done any tests using &gt;2GB of virtual address space, but I would like
to see a managed app that does that, taking full advantage of the 64-bit address space.
I can imagine that companies running SQL Server will immediately see the benefit of
that removed barrier.
</p>
        <img width="0" height="0" src="http://hoser.lander.ca/aggbug.ashx?id=3259fb4d-c760-4529-baad-93bfa08e12e7" />
      </body>
      <title>Coming to you in 64 bits</title>
      <guid isPermaLink="false">http://hoser.lander.ca/PermaLink,guid,3259fb4d-c760-4529-baad-93bfa08e12e7.aspx</guid>
      <link>http://hoser.lander.ca/2005/05/19/ComingToYouIn64Bits.aspx</link>
      <pubDate>Thu, 19 May 2005 19:35:01 GMT</pubDate>
      <description>&lt;p&gt;
Some time ago, I moved my blog to a 64-bit X64 server. This server was running &lt;a href="http://www.microsoft.com/windowsserver2003/64bit/x64/default.mspx"&gt;Windows
Server 2003 SP1 Beta 1&lt;/a&gt; and an early version of &lt;a href="http://lab.msdn.microsoft.com/vs2005/downloads/netframework/default.aspx"&gt;Whidbey
Beta 2&lt;/a&gt;. I thought that&amp;nbsp;this was an excellent opportunity to dogfood (MS term
for early adoption) the &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=DE4539CF-5D5C-4981-B27B-8AE747A7EA98&amp;amp;displaylang=en"&gt;64-bit
version&lt;/a&gt; of the framework, not to mention Server 2003 SP1. Another side aspect
of this exercise was that I was testing out the backwards compatibility of the .NET
Framework, since &lt;a href="http://www.dasblog.net/"&gt;DasBlog&lt;/a&gt; is built with the v1.1
version of the Framework.
&lt;/p&gt;
&lt;p&gt;
I'm happy to report that I've had zero problems with this new configuration, even
with beta software. The OS has now shipped, so there is no issue there, but the version
of Whidbey is still only Beta 2 and it is chugging day after day without issue. Doesn't
get better than that! It also shows the incredible value of MSIL -- what C#, VB.Net, &lt;a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dndotnet/html/pdc_eiffel.asp"&gt;Eiffel&lt;/a&gt;, &lt;a href="http://www.gotdotnet.com/workspaces/workspace.aspx?id=ad7acff7-ab1e-4bcb-99c0-57ac5a3a9742"&gt;IronPython&lt;/a&gt;, &lt;a href="http://www.netcobol.com/"&gt;Cobol&lt;/a&gt; and
any other managed code compiler compiles down to -- given that the Everett DasBlog
code "just works" on 64-bit Whidbey, even though 64-bit was not a supported (or possible)
configuration of Everett.
&lt;/p&gt;
&lt;p&gt;
One of the major features of Whidbey ASP.Net is &lt;a href="http://weblogs.asp.net/scottgu/archive/2003/11/25/39620.aspx"&gt;XHTML
compliance&lt;/a&gt;. DasBlog was not designed to be 100% XHTML compliant, so would not
work on the first try on Whidbey. We had to use a special &lt;a href="http://weblogs.asp.net/scottgu/archive/2005/05/11/406515.aspx"&gt;config
switch&lt;/a&gt; to turn off XHTML compliance in Whidbey. After that, everything worked
perfectly, in terms of performance, backwards compatibility and general behaviour
of the app. I'm very happy and can say that Whidbey Beta 2 is ready for prime-time
development. To that end, the .NET Framework is allowing companies to "go live" with
our &lt;a href="http://lab.msdn.microsoft.com/vs2005/golive/"&gt;"go live" license&lt;/a&gt;.
This means that you can build/migrate a public-facing&amp;nbsp;application with Whidbey
Beta 2.
&lt;/p&gt;
&lt;p&gt;
Back to 64-bit ... I must say that the 64-bit support in Whidbey is very cool. I have
two high-end X64 boxes in my office, one from Intel and the other from AMD. I use
them for various purposes and am quite happy with them. In particular, I really like
building and debugging apps on my 64-bit machines, having them run in native 64-bit,
but then being able to deploy them to both 32- and 64-bit machines. The portability
of managed code assemblies across different CPU architectures (IA64, X64, X86) is
a huge win.
&lt;/p&gt;
&lt;p&gt;
I've also been running early 64-bit versions of Longhorn on these two X64 machines.
I haven't done any tests using &amp;gt;2GB of virtual address space, but I would like
to see a managed app that does that, taking full advantage of the 64-bit address space.
I can imagine that companies running SQL Server will immediately see the benefit of
that removed barrier.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://hoser.lander.ca/aggbug.ashx?id=3259fb4d-c760-4529-baad-93bfa08e12e7" /&gt;</description>
      <comments>http://hoser.lander.ca/CommentView,guid,3259fb4d-c760-4529-baad-93bfa08e12e7.aspx</comments>
      <category>Compatibility</category>
      <category>Loader</category>
    </item>
    <item>
      <trackback:ping>http://hoser.lander.ca/Trackback.aspx?guid=7fcc7091-e486-4f69-8088-6d04ba217da7</trackback:ping>
      <pingback:server>http://hoser.lander.ca/pingback.aspx</pingback:server>
      <pingback:target>http://hoser.lander.ca/PermaLink,guid,7fcc7091-e486-4f69-8088-6d04ba217da7.aspx</pingback:target>
      <dc:creator>Rich Lander</dc:creator>
      <wfw:comment>http://hoser.lander.ca/CommentView,guid,7fcc7091-e486-4f69-8088-6d04ba217da7.aspx</wfw:comment>
      <wfw:commentRss>http://hoser.lander.ca/SyndicationService.asmx/GetEntryCommentsRss?guid=7fcc7091-e486-4f69-8088-6d04ba217da7</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
          <a href="http://winfx.msdn.microsoft.com/library/en-us/dv_fxdebug/html/76994ee6-9fa9-4059-b813-26578d24427c.asp">Managed
Debugging Assistants</a> are an existing feature (<a href="http://blogs.msdn.com/adam_nathan/archive/2003/5/13.aspx">Customer
Debug Probes</a>) improved on and expanded. They are exposed in a similar manner to
exceptions (don't let that scare you) but occur not because of an error condition,
but because the runtime has noticed a condition that could cause you problems. We've
talked to lots of customers over the years and have received feedback that there are
a set of scenarios that cause developers pain more often than others. As a result,
we've written a bunch of code -- the MDAs themselves -- that can be used while your
code is running to protect you against these pain points ... that's good, right?
</p>
        <p>
The MDA infrastructure is always "on", but only a few MDAs are activated by default.
That's easily changed, by selecting the "Debug" menu and "Exceptions" within it. From
there, you can turn on or off any MDA of your choosing, as you can see in the image
below. There is only one MDA turned on in that part of list in the image below, but
you turn on as many as you want.
</p>
        <p>
          <img alt="VS 2005 exceptions window" hspace="0" src="/CodeDownload/ExceptionsWindow.bmp" align="baseline" border="0" />
        </p>
        <p>
Anyway, I want to introduce you to the LoadFromContext MDA. If you want to know more
about the joys of LoadFrom, check out Suzanne's <a href="http://blogs.msdn.com/suzcook/archive/2003/05/29/57143.aspx">blog</a>.
I'll post more on binding contexts at some point, but want to stay on the subject
of this MDA for the moment. Here is some code that exercises this MDA -- this is just
an exe project attempting to load a built assembly from a class library project
in the same solution (hence the strange pathing) ...
</p>
        <p>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
            <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">using</span> System;<br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">using</span> System.Reflection;<br /><br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">namespace</span> LoadFromMDA<br />
{<br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">class</span> Program<br />
{<br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">static</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">void</span> Main(<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">string</span>[]
args)<br />
{<br />
Assembly asm <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span> Assembly.LoadFrom(<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">@"..\..\..\SomeAssembly\bin\debug\SomeAssembly.dll"</span>);<br />
Console.WriteLine(asm.FullName);<br />
}<br />
}<br />
}<br /></span>
        </p>
        <p>
If the MDA is enabled, I get the following exception-looking popup window as soon
as hit the first line of code.
</p>
        <p>
          <img alt="LoadFromContext MDA window" hspace="0" src="/CodeDownload/LoadFromContext.bmp" align="baseline" border="0" />
        </p>
        <p>
The reason that this MDA is so useful is that it is really quite difficult to determine
for certain which binding context an assembly was loading into, other than following
a certain set of rules and closely watching the way that the binder binds to dependent
assemblies. However, with this MDA, you can know for sure if you are loading assemblies
into the LoadFrom context.
</p>
        <p>
There are several other MDAs to play with. I recommend taking a look through them
and turning on ones that might apply to your program. There is no harm and you may
avoid your program throwing an exception in some edge-case scenarios for reasons that
may not be super clear to you. 
</p>
        <p>
 
</p>
        <img width="0" height="0" src="http://hoser.lander.ca/aggbug.ashx?id=7fcc7091-e486-4f69-8088-6d04ba217da7" />
      </body>
      <title>LoadFromContext MDA in VS 2005</title>
      <guid isPermaLink="false">http://hoser.lander.ca/PermaLink,guid,7fcc7091-e486-4f69-8088-6d04ba217da7.aspx</guid>
      <link>http://hoser.lander.ca/2005/05/12/LoadFromContextMDAInVS2005.aspx</link>
      <pubDate>Thu, 12 May 2005 01:27:53 GMT</pubDate>
      <description>&lt;p&gt;
&lt;a href="http://winfx.msdn.microsoft.com/library/en-us/dv_fxdebug/html/76994ee6-9fa9-4059-b813-26578d24427c.asp"&gt;Managed
Debugging Assistants&lt;/a&gt; are an existing feature (&lt;a href="http://blogs.msdn.com/adam_nathan/archive/2003/5/13.aspx"&gt;Customer
Debug Probes&lt;/a&gt;) improved on and expanded. They are exposed in a similar manner to
exceptions (don't let that scare you) but occur not because of an error condition,
but because the runtime has noticed a condition that could cause you problems. We've
talked to lots of customers over the years and have received feedback that there are
a set of scenarios that cause developers pain more often than others. As a result,
we've written a bunch of code -- the MDAs themselves -- that can be used while your
code is running to protect you against these pain points ... that's good, right?
&lt;/p&gt;
&lt;p&gt;
The MDA infrastructure is always "on", but only a few MDAs are activated by default.
That's easily changed, by selecting the "Debug" menu and "Exceptions" within it. From
there, you can turn on or off any MDA of your choosing, as you can see in the image
below. There is only one MDA turned on in that part of list in the image below, but
you turn on as many as you want.
&lt;/p&gt;
&lt;p&gt;
&lt;img alt="VS 2005 exceptions window" hspace=0 src="/CodeDownload/ExceptionsWindow.bmp" align=baseline border=0&gt;
&lt;/p&gt;
&lt;p&gt;
Anyway, I want to introduce you to the LoadFromContext MDA. If you want to know more
about the joys of LoadFrom, check out Suzanne's &lt;a href="http://blogs.msdn.com/suzcook/archive/2003/05/29/57143.aspx"&gt;blog&lt;/a&gt;.
I'll post more on binding contexts at some point, but want to stay on the subject
of this MDA for the moment. Here is some code that exercises this MDA -- this is just
an exe project attempting to load&amp;nbsp;a built assembly from a class library project
in the same solution (hence the strange pathing)&amp;nbsp;...
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;using&lt;/span&gt; System;&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;using&lt;/span&gt; System.Reflection;&lt;br&gt;
&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;namespace&lt;/span&gt; LoadFromMDA&lt;br&gt;
{&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;class&lt;/span&gt; Program&lt;br&gt;
{&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;static&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;void&lt;/span&gt; Main(&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;string&lt;/span&gt;[]
args)&lt;br&gt;
{&lt;br&gt;
Assembly asm &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; Assembly.LoadFrom(&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;@"..\..\..\SomeAssembly\bin\debug\SomeAssembly.dll"&lt;/span&gt;);&lt;br&gt;
Console.WriteLine(asm.FullName);&lt;br&gt;
}&lt;br&gt;
}&lt;br&gt;
}&lt;br&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
If the MDA is enabled, I get the following exception-looking popup window as soon
as hit the first line of code.
&lt;/p&gt;
&lt;p&gt;
&lt;img alt="LoadFromContext MDA window" hspace=0 src="/CodeDownload/LoadFromContext.bmp" align=baseline border=0&gt;
&lt;/p&gt;
&lt;p&gt;
The reason that this MDA is so useful is that it is really quite difficult to determine
for certain which binding context an assembly was loading into, other than following
a certain set of rules and closely watching the way that the binder binds to dependent
assemblies. However, with this MDA, you can know for sure if you are loading assemblies
into the LoadFrom context.
&lt;/p&gt;
&lt;p&gt;
There are several other MDAs to play with. I recommend taking a look through them
and turning on ones that might apply to your program. There is no harm and you may
avoid your program throwing an exception in some edge-case scenarios for reasons that
may not be super clear to you. 
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://hoser.lander.ca/aggbug.ashx?id=7fcc7091-e486-4f69-8088-6d04ba217da7" /&gt;</description>
      <comments>http://hoser.lander.ca/CommentView,guid,7fcc7091-e486-4f69-8088-6d04ba217da7.aspx</comments>
      <category>Code Samples</category>
      <category>Loader</category>
    </item>
    <item>
      <trackback:ping>http://hoser.lander.ca/Trackback.aspx?guid=25989d32-d6f6-4692-8731-b1498bad8c4d</trackback:ping>
      <pingback:server>http://hoser.lander.ca/pingback.aspx</pingback:server>
      <pingback:target>http://hoser.lander.ca/PermaLink,guid,25989d32-d6f6-4692-8731-b1498bad8c4d.aspx</pingback:target>
      <dc:creator>Rich Lander</dc:creator>
      <wfw:comment>http://hoser.lander.ca/CommentView,guid,25989d32-d6f6-4692-8731-b1498bad8c4d.aspx</wfw:comment>
      <wfw:commentRss>http://hoser.lander.ca/SyndicationService.asmx/GetEntryCommentsRss?guid=25989d32-d6f6-4692-8731-b1498bad8c4d</wfw:commentRss>
      <slash:comments>1</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
          <a href="http://blogs.msdn.com/brada">Brad</a> sent me mail on Friday night asking
about our plans (or non-plans) to change the assembly version number again for Whidbey.
The mail was the result of a developer -- let's call him Marc -- who had pinged Brad
earlier in the week through his blog asking that exact question ...
</p>
        <p>
Here is the basic question from Marc:
</p>
        <font size="2">
          <p>
            <font color="#000080" size="1">I'm using Beta 2 of the .NET Framework SDK 2.0 ...
I'm curious, if I roll this app out, built on a beta ... Would the app continue to
function or would it need to be rebuilt with the 2.0 final SDK? </font>
          </p>
          <p>
            <font color="#000080" size="1">There's too many exciting features to stick with the
1.x version of .NET. :-) Every day I find something new and exciting that can be done.
It makes programming fun again!</font>
          </p>
        </font>
        <p>
I'm glad to hear that Marc likes Whidbey. That's definitely the plan from building
42 (where the CLR team works)! Back to the original question: will Marc's app continue
to work or is a re-compile required? Marc isn't specific about which beta he is using,
so I'm going to have to resort to a multi-part answer, unfortunately ...
</p>
        <p>
1. If Marc is on Whidbey Beta 1 (or earlier), then the answer is "yes ... a recompilation
is in your future".
</p>
        <p>
2. If Marc is on Whidbey Beta 2 (or later), then the answer is "no ... your app should
work just fine".
</p>
        <p>
W/rt (2), I do recommend re-compiling against the final product even though it isn't
strictly required (from a technical perspective). Naturally, there will have been
further changes/fixes in the compilers and the metadata sub-system that will very
likely result in a better built assembly.
</p>
        <p>
Some of you might wonder what this is all about. I'll attempt to explain w/o going
on any tangents. Please email if there are some tangents that you are interested in
;)
</p>
        <p>
We set the assembly version number of each of the assemblies (all the same version
fortunately) in the .NET Framework at major milestones, treating it as an contract
between the .NET Framework and it's consumers. We then break that contract by changing
the assembly version number again when we start a new milestone (i.e. Beta 1 versus
Beta 2; Everett versus Whidbey). Why do we do that? We change the assembly version
number for two reasons: (A) the contract has changed since the code inside the assemblies
is very substantially different, and (B) a strong identifier (i.e. a version number)
needs to be changed to remain a strong identifier.
</p>
        <p>
We changed the assembly version number last early in the Beta 2 milestone, for the
reasons described above. We will not change it again in the Whidbey product since
the rate of changes to the product has slowed down and because we only want to make
changes at this point that are absolutely required to ship the product.
</p>
        <p>
As a result of how we've changed the assembly number and since the assembly
binder binds strictly on the whole version number, apps built with Whidbey Beta
2 will continue to reference Whidbey RTM .NET Framework assemblies since their version
number will be the same as what the Whidbey Beta 2 app is expecting.
</p>
        <p>
Hope that helps Marc!
</p>
        <img width="0" height="0" src="http://hoser.lander.ca/aggbug.ashx?id=25989d32-d6f6-4692-8731-b1498bad8c4d" />
      </body>
      <title>.NET Framework Assembly Version Number for Whidbey</title>
      <guid isPermaLink="false">http://hoser.lander.ca/PermaLink,guid,25989d32-d6f6-4692-8731-b1498bad8c4d.aspx</guid>
      <link>http://hoser.lander.ca/2005/05/09/NETFrameworkAssemblyVersionNumberForWhidbey.aspx</link>
      <pubDate>Mon, 09 May 2005 05:36:31 GMT</pubDate>
      <description>&lt;p&gt;
&lt;a href="http://blogs.msdn.com/brada"&gt;Brad&lt;/a&gt; sent me mail on Friday night asking
about our plans (or non-plans) to change the assembly version number again for Whidbey.
The mail was the result of a developer -- let's call him Marc -- who had pinged Brad
earlier in the week through his blog asking that exact question ...
&lt;/p&gt;
&lt;p&gt;
Here is the basic question from Marc:
&lt;/p&gt;
&lt;font size=2&gt; 
&lt;p&gt;
&lt;font color=#000080 size=1&gt;I'm using Beta 2 of the .NET Framework SDK 2.0 ... I'm
curious, if I roll this app out, built on a beta ... Would the app continue to function
or would it need to be rebuilt with the 2.0 final SDK? &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font color=#000080 size=1&gt;There's too many exciting features to stick with the 1.x
version of .NET. :-) Every day I find something new and exciting that can be done.
It makes programming fun again!&lt;/font&gt;
&lt;/p&gt;
&lt;/font&gt; 
&lt;p&gt;
I'm glad to hear that Marc likes Whidbey. That's definitely the plan from building
42 (where the CLR team works)! Back to the original question: will Marc's app continue
to work or is a re-compile required? Marc isn't specific about which beta he is using,
so I'm going to have to resort to a multi-part answer, unfortunately ...
&lt;/p&gt;
&lt;p&gt;
1. If Marc is on Whidbey Beta 1 (or earlier), then the answer is "yes ... a recompilation
is in your future".
&lt;/p&gt;
&lt;p&gt;
2. If Marc is on Whidbey Beta 2 (or later), then the answer is "no ... your app should
work just fine".
&lt;/p&gt;
&lt;p&gt;
W/rt (2), I do recommend re-compiling against the final product even though it isn't
strictly required (from a technical perspective). Naturally, there will have been
further changes/fixes in the compilers and the metadata sub-system that will very
likely result in a better built assembly.
&lt;/p&gt;
&lt;p&gt;
Some of you might wonder what this is all about. I'll attempt to explain w/o going
on any tangents. Please email if there are some tangents that you are interested in
;)
&lt;/p&gt;
&lt;p&gt;
We set the assembly version number of&amp;nbsp;each of the assemblies (all the same version
fortunately) in the&amp;nbsp;.NET Framework at major milestones, treating it as an contract
between the .NET Framework and it's consumers. We then break that contract by changing
the assembly version number again when we start a new milestone (i.e. Beta 1 versus
Beta 2; Everett versus Whidbey). Why do we do that? We change the assembly version
number for two reasons: (A) the contract has changed since the code inside the assemblies
is very substantially different, and (B) a strong identifier (i.e. a version number)
needs to be changed to remain a strong identifier.
&lt;/p&gt;
&lt;p&gt;
We changed the assembly version number last early in the Beta 2 milestone, for the
reasons described above. We will not change it again in the Whidbey product since
the rate of changes to the product has slowed down and because we only want to make
changes at this point that are absolutely required to ship the product.
&lt;/p&gt;
&lt;p&gt;
As a result of&amp;nbsp;how we've changed the assembly&amp;nbsp;number and since the assembly
binder binds&amp;nbsp;strictly on the whole version number, apps built with Whidbey Beta
2 will continue to reference Whidbey RTM .NET Framework assemblies since their version
number will be the same as what the Whidbey Beta 2 app is expecting.
&lt;/p&gt;
&lt;p&gt;
Hope that helps Marc!
&lt;/p&gt;
&lt;img width="0" height="0" src="http://hoser.lander.ca/aggbug.ashx?id=25989d32-d6f6-4692-8731-b1498bad8c4d" /&gt;</description>
      <comments>http://hoser.lander.ca/CommentView,guid,25989d32-d6f6-4692-8731-b1498bad8c4d.aspx</comments>
      <category>Loader</category>
    </item>
    <item>
      <trackback:ping>http://hoser.lander.ca/Trackback.aspx?guid=80725524-e184-4e06-a61a-3e0c23e7c76f</trackback:ping>
      <pingback:server>http://hoser.lander.ca/pingback.aspx</pingback:server>
      <pingback:target>http://hoser.lander.ca/PermaLink,guid,80725524-e184-4e06-a61a-3e0c23e7c76f.aspx</pingback:target>
      <dc:creator>Rich Lander</dc:creator>
      <wfw:comment>http://hoser.lander.ca/CommentView,guid,80725524-e184-4e06-a61a-3e0c23e7c76f.aspx</wfw:comment>
      <wfw:commentRss>http://hoser.lander.ca/SyndicationService.asmx/GetEntryCommentsRss?guid=80725524-e184-4e06-a61a-3e0c23e7c76f</wfw:commentRss>
      <slash:comments>3</slash:comments>
      <title>Getting Roped Into Reflection</title>
      <guid isPermaLink="false">http://hoser.lander.ca/PermaLink,guid,80725524-e184-4e06-a61a-3e0c23e7c76f.aspx</guid>
      <link>http://hoser.lander.ca/2005/01/15/GettingRopedIntoReflection.aspx</link>
      <pubDate>Sat, 15 Jan 2005 05:10:21 GMT</pubDate>
      <description>&lt;p&gt;
&lt;font color=#000000&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;I decided
to whip up a quick app today to test some behaviour of Assembly.LoadFrom() that I
wasn't 100% certain about. In particular, I was curious about the dependency resolution
behaviour of Assembly.LoadFrom(), as compared to Assembly.Load(). I know that Load()
will find static dependencies for you, provided that the dependencies are in a place
that the loader looks (i.e. GAC, appbase, private bin paths). I also know that Assembly.LoadFile()
doesn't do any dependency resolution for you; you have to pre-load dependencies when
you use LoadFile(). So, the test is to determine which camp -- dependency resolution
or not -- that LoadFrom falls into. I'm pretty sure that it will fall into the dependency
resolution camp, but I've never explicitly tested this case in issolation, so I'm
checking it out. I've also written a bunch of apps that depended on LoadFrom resolving
dependencies for you, so this likely isn't going to end up being a big surprise.&lt;/span&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;b&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"&gt;An Exercise in Reflection&lt;/span&gt;&lt;/b&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&lt;font color=#000000&gt;So,
I have to admit up front that I'm not great at using Reflection -- another bloke&amp;nbsp;works
on that. Anyway, I had to brush up on my reflection skills to get this working and
ask&lt;/font&gt;&lt;span style="COLOR: #003300"&gt; &lt;a href="http://blogs.msdn.com/joelpob" target=_blank&gt;Joel&lt;/a&gt;&amp;nbsp;if
I'd done it properly once I was done, which turned out to be mostly the case.&lt;/span&gt;&lt;/span&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: #003300; FONT-FAMILY: 'Courier New'"&gt;Here's the
main program:&lt;/span&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 8.5pt; COLOR: black; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="FONT-SIZE: 8.5pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;static&lt;/span&gt;&lt;span style="FONT-SIZE: 8.5pt; COLOR: black; FONT-FAMILY: 'Courier New'"&gt; &lt;/span&gt;&lt;span style="FONT-SIZE: 8.5pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;void&lt;/span&gt;&lt;span style="FONT-SIZE: 8.5pt; COLOR: black; FONT-FAMILY: 'Courier New'"&gt;&lt;?xml:namespace prefix = st1 ns = "urn:schemas-microsoft-com:office:smarttags" /&gt; 
&lt;st1:place w:st="on"&gt;Main&lt;/st1:place&gt;
(&lt;/span&gt;&lt;span style="FONT-SIZE: 8.5pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;string&lt;/span&gt;&lt;span style="FONT-SIZE: 8.5pt; COLOR: black; FONT-FAMILY: 'Courier New'"&gt;[]
args)&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br&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;Assembly a;&lt;br&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;Type t;&lt;br&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;MethodInfo
m;&lt;br&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;Object[] myArgs;&lt;br&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;Object myInt;&lt;br&gt;
&lt;br&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;Console.WriteLine(&lt;/span&gt;&lt;span style="FONT-SIZE: 8.5pt; BACKGROUND: #e4e4e4; COLOR: #666666; FONT-FAMILY: 'Courier New'"&gt;"In
main program"&lt;/span&gt;&lt;span style="FONT-SIZE: 8.5pt; COLOR: black; FONT-FAMILY: 'Courier New'"&gt;);&lt;br&gt;
&lt;br&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;&lt;/span&gt;&lt;span style="FONT-SIZE: 8.5pt; COLOR: green; FONT-FAMILY: 'Courier New'"&gt;//Loading
assembly&lt;/span&gt;&lt;span style="FONT-SIZE: 8.5pt; COLOR: black; FONT-FAMILY: 'Courier New'"&gt;
&lt;br&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;&lt;/span&gt;&lt;span style="FONT-SIZE: 8.5pt; COLOR: green; FONT-FAMILY: 'Courier New'"&gt;//a
= Assembly.LoadFile(@"C:\Documents and Settings\rlander\My Documents\Visual Studio
2005\Projects\LoadFromApp\FooLibrary\bin\debug\FooLibrary.dll");&lt;/span&gt;&lt;span style="FONT-SIZE: 8.5pt; COLOR: black; FONT-FAMILY: 'Courier New'"&gt;
&lt;br&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;a &lt;/span&gt;&lt;span style="FONT-SIZE: 8.5pt; COLOR: red; FONT-FAMILY: 'Courier New'"&gt;=&lt;/span&gt;&lt;span style="FONT-SIZE: 8.5pt; COLOR: black; FONT-FAMILY: 'Courier New'"&gt; Assembly.LoadFrom(&lt;/span&gt;&lt;span style="FONT-SIZE: 8.5pt; BACKGROUND: #e4e4e4; COLOR: #666666; FONT-FAMILY: 'Courier New'"&gt;@"../../../FooLibrary/bin/debug/FooLibrary.dll"&lt;/span&gt;&lt;span style="FONT-SIZE: 8.5pt; COLOR: black; FONT-FAMILY: 'Courier New'"&gt;);&lt;br&gt;
&lt;br&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;&lt;/span&gt;&lt;span style="FONT-SIZE: 8.5pt; COLOR: green; FONT-FAMILY: 'Courier New'"&gt;//Getting
type to call into&lt;/span&gt;&lt;span style="FONT-SIZE: 8.5pt; COLOR: black; FONT-FAMILY: 'Courier New'"&gt;
&lt;br&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;t &lt;/span&gt;&lt;span style="FONT-SIZE: 8.5pt; COLOR: red; FONT-FAMILY: 'Courier New'"&gt;=&lt;/span&gt;&lt;span style="FONT-SIZE: 8.5pt; COLOR: black; FONT-FAMILY: 'Courier New'"&gt; a.GetType(&lt;/span&gt;&lt;span style="FONT-SIZE: 8.5pt; BACKGROUND: #e4e4e4; COLOR: #666666; FONT-FAMILY: 'Courier New'"&gt;"FooLibrary.Foo"&lt;/span&gt;&lt;span style="FONT-SIZE: 8.5pt; COLOR: black; FONT-FAMILY: 'Courier New'"&gt;);&lt;br&gt;
&lt;br&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;&lt;/span&gt;&lt;span style="FONT-SIZE: 8.5pt; COLOR: green; FONT-FAMILY: 'Courier New'"&gt;//Getting
the specific method that I'm interested in&lt;/span&gt;&lt;span style="FONT-SIZE: 8.5pt; COLOR: black; FONT-FAMILY: 'Courier New'"&gt;
&lt;br&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;m &lt;/span&gt;&lt;span style="FONT-SIZE: 8.5pt; COLOR: red; FONT-FAMILY: 'Courier New'"&gt;=&lt;/span&gt;&lt;span style="FONT-SIZE: 8.5pt; COLOR: black; FONT-FAMILY: 'Courier New'"&gt; t.GetMethod(&lt;/span&gt;&lt;span style="FONT-SIZE: 8.5pt; BACKGROUND: #e4e4e4; COLOR: #666666; FONT-FAMILY: 'Courier New'"&gt;"GetInt"&lt;/span&gt;&lt;span style="FONT-SIZE: 8.5pt; COLOR: black; FONT-FAMILY: 'Courier New'"&gt;,
BindingFlags.Static &lt;/span&gt;&lt;span style="FONT-SIZE: 8.5pt; COLOR: red; FONT-FAMILY: 'Courier New'"&gt;|&lt;/span&gt;&lt;span style="FONT-SIZE: 8.5pt; COLOR: black; FONT-FAMILY: 'Courier New'"&gt; BindingFlags.Public, &lt;/span&gt;&lt;span style="FONT-SIZE: 8.5pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;null&lt;/span&gt;&lt;span style="FONT-SIZE: 8.5pt; COLOR: black; FONT-FAMILY: 'Courier New'"&gt;, &lt;/span&gt;&lt;span style="FONT-SIZE: 8.5pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;new&lt;/span&gt;&lt;span style="FONT-SIZE: 8.5pt; COLOR: black; FONT-FAMILY: 'Courier New'"&gt; Type[]
{ &lt;/span&gt;&lt;span style="FONT-SIZE: 8.5pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;typeof&lt;/span&gt;&lt;span style="FONT-SIZE: 8.5pt; COLOR: black; FONT-FAMILY: 'Courier New'"&gt;(System.Int32)},&lt;/span&gt;&lt;span style="FONT-SIZE: 8.5pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;null&lt;/span&gt;&lt;span style="FONT-SIZE: 8.5pt; COLOR: black; FONT-FAMILY: 'Courier New'"&gt;);&lt;br&gt;
&lt;br&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;&lt;/span&gt;&lt;span style="FONT-SIZE: 8.5pt; COLOR: green; FONT-FAMILY: 'Courier New'"&gt;//args
to pass to the method&lt;/span&gt;&lt;span style="FONT-SIZE: 8.5pt; COLOR: black; FONT-FAMILY: 'Courier New'"&gt;
&lt;br&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;myArgs &lt;/span&gt;&lt;span style="FONT-SIZE: 8.5pt; COLOR: red; FONT-FAMILY: 'Courier New'"&gt;=&lt;/span&gt;&lt;span style="FONT-SIZE: 8.5pt; COLOR: black; FONT-FAMILY: 'Courier New'"&gt; &lt;/span&gt;&lt;span style="FONT-SIZE: 8.5pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;new&lt;/span&gt;&lt;span style="FONT-SIZE: 8.5pt; COLOR: black; FONT-FAMILY: 'Courier New'"&gt; Object[1]
{5};&lt;br&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;&lt;br&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;&lt;/span&gt;&lt;span style="FONT-SIZE: 8.5pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;try&lt;/span&gt;&lt;span style="FONT-SIZE: 8.5pt; COLOR: black; FONT-FAMILY: 'Courier New'"&gt;
&lt;br&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;{&lt;br&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;&lt;/span&gt;&lt;span style="FONT-SIZE: 8.5pt; COLOR: green; FONT-FAMILY: 'Courier New'"&gt;//Calling
the method and printing the return value&lt;/span&gt;&lt;span style="FONT-SIZE: 8.5pt; COLOR: black; FONT-FAMILY: 'Courier New'"&gt;
&lt;br&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;myInt &lt;/span&gt;&lt;span style="FONT-SIZE: 8.5pt; COLOR: red; FONT-FAMILY: 'Courier New'"&gt;=&lt;/span&gt;&lt;span style="FONT-SIZE: 8.5pt; COLOR: black; FONT-FAMILY: 'Courier New'"&gt; m.Invoke(&lt;/span&gt;&lt;span style="FONT-SIZE: 8.5pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;null&lt;/span&gt;&lt;span style="FONT-SIZE: 8.5pt; COLOR: black; FONT-FAMILY: 'Courier New'"&gt;,
myArgs);&lt;br&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;Console.WriteLine(myInt.ToString());&lt;br&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;}&lt;br&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;&lt;/span&gt;&lt;span style="FONT-SIZE: 8.5pt; COLOR: green; FONT-FAMILY: 'Courier New'"&gt;//in
case something bad happens&lt;/span&gt;&lt;span style="FONT-SIZE: 8.5pt; COLOR: black; FONT-FAMILY: 'Courier New'"&gt;
&lt;br&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;&lt;/span&gt;&lt;span style="FONT-SIZE: 8.5pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;catch&lt;/span&gt;&lt;span style="FONT-SIZE: 8.5pt; COLOR: black; FONT-FAMILY: 'Courier New'"&gt; (TargetInvocationException
e)&lt;br&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;{&lt;br&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;Console.WriteLine(e.InnerException.ToString());&lt;br&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;}&lt;br&gt;
&amp;nbsp;&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;/p&gt;
&lt;p&gt;
&lt;font color=#000000&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;Indeed,
there is more to this program than just the Main method, however, the additional aspects
are not particularly interesting. The code above is the whole of a Console exe project,
called LoadFromApp, in VS 2005. There are two other projects that I wrote too: (1)
a Class Library project called FooLibrary that the exe loads via Assembly.LoadFrom(),
and (2) another Class Library project called BarLibrary to which FooLibrary statically
links. You can see these too/two in the code sample, which is linked at the bottom
of the entry. &lt;/span&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font color=#000000&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;The
expected behaviour, now that you have a mental model of my project, is that BarLibrary
is automatically loaded by the CLR loader when I load FooLibrary from LoadFromApp
via Assembly.LoadFrom(). BarLibrary is necessarily in the same directory as FooLibrary;
otherwise, there would be no way that LoadFrom() could find BarLibrary, unless BarLibrary
was in the GAC or something like that. This is why VS adds referenced assemblies into
your bin/debug (or release) folder when you build an assembly.&lt;/span&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font color=#000000&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;The
interesting thing is that this exercise turned out to be more of a lesson in reflection
than in the loader, but that's how these things end up. I'll tell you what I learned
about LoadFrom and then reiterate what Joel told me about reflection.&lt;/span&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;b&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"&gt;What I Learned&lt;/span&gt;&lt;/b&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font color=#000000&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;First,
the loader part. So, it does indeed turn out to be true that Assembly.LoadFrom() does
resolve dependencies, provided that there are in a findable place, which turns out
to be any place that would be consulted for Assembly.Load() and the path (minus filename.dll)
of the Assembly.LoadFrom(String path). That wasn't too hard, but was worth the exercise.&lt;/span&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font color=#000000&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;You'll
also notice that I commented out Assembly.LoadFile(), just above Assembly.LoadFrom().
I tried this too for kicks, which resulted in an exception of type System.Reflection.TargetInvocationException.
That's the &amp;#8220;something bad happens&amp;#8221; and what the exception handler is for
above. So, this proves that LoadFile() does not resolve depencies, which I already
knew, but was a good test anyway.&lt;/span&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font color=#000000&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;Now,
onto the reflection aspect. The comments in the source above mostly explain what is
going on, I hope. If not, I load an assembly, get a known type from that assembly,
then get a known method from that type and then call through on that method with known
data. Do remember/realize that this isn&amp;#8217;t normally what .net code looks like.
Reflection is one of the mechanisms of handling late bound scenarios for .net coders.
It is probably the most flexible, but not the most approachable.&lt;/span&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font color=#000000&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;Back
to the interesting review of reflection &amp;#8230; The line that I'm most interested
in is the call to t.GetMethod, which is the instance method MethodInfo.GetMethod.
I'll re-print it here:&lt;/span&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'"&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;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'"&gt;//Getting
the specific method that I'm interested in&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #003300; FONT-FAMILY: 'Courier New'"&gt;
&lt;br&gt;
&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'"&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;m &lt;/span&gt;&lt;span style="FONT-SIZE: 8.5pt; COLOR: red; FONT-FAMILY: 'Courier New'"&gt;=&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'"&gt; t.GetMethod(&lt;/span&gt;&lt;span style="FONT-SIZE: 8.5pt; BACKGROUND: #e4e4e4; COLOR: #666666; FONT-FAMILY: 'Courier New'"&gt;"GetInt"&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'"&gt;,
BindingFlags.Static &lt;/span&gt;&lt;span style="FONT-SIZE: 8.5pt; COLOR: red; FONT-FAMILY: 'Courier New'"&gt;|&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'"&gt; BindingFlags.Public, &lt;/span&gt;&lt;span style="FONT-SIZE: 8.5pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;null&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'"&gt;, &lt;/span&gt;&lt;span style="FONT-SIZE: 8.5pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;new&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'"&gt; Type[]
{ &lt;/span&gt;&lt;span style="FONT-SIZE: 8.5pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;typeof&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'"&gt;(System.Int32)},&lt;/span&gt;&lt;span style="FONT-SIZE: 8.5pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;null&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'"&gt;);&lt;/span&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font color=#000000&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;The
GetMethod method allows you to specify enough information for the reflection system
to get a single method for you from a given type. The thing is that you'll get some
type of exception if you haven't specified enough information to single out your desired
method from the set of methods on the type. Put another way, you&amp;#8217;ll get this
exception if the reflection system ends up finding &amp;gt;1 methods that fit your description
since the method only returns MethodInfo, not MethodInfo[]. GetMethods() returns MethodInfo[]
and obviously doesn&amp;#8217;t have this particular problem. So, you need to be pretty
specific about the method that you want. It may not be neccesary this version, but
you may add overloads next version and forget that your GetMethod call was pretty
sloppy and then stuff breaks, which is bad.&lt;/span&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font color=#000000&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;It is
the first two and&amp;nbsp;fourth parameters that are the most interesting to me. The
first one is the method name. So, this differentiates the method from all other methods.
You can make the search case insensitive via the BindingFlags, but I would not recommend
this approach since the CLR doesn&amp;#8217;t work this way and it will slow down the
whole operation. The next parameter is the BindingFlags. I've stated that the method
I'm looking for is static and public. So, the search will not retreive any instance
or internal/protected/private methods that happen to have the same name, which is
quite possible. You&amp;#8217;ll need to pick among these flags carefully to ensure that
you have the correct level of specificity. The fourth parameter specifies the signature
of the method. Rememer, the CLR doesn't consider the return type when determining
which overload of a method to call, so the signature is just the types of the parameters
that the method takes. At this point, you will have provided enough data that the
reflection system can narrow its search of methods on the given time to 1, or 0 if
it is not there.&lt;/span&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font color=#000000&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;The
actual code sample that I wrote is on another machine. I'll post it in a day or two
when I get a chance. The sample is nothing big, but you'll be able to see how LoadFrom()
and LoadFile() work for yourself with my small contrived example.&lt;/span&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://hoser.lander.ca/aggbug.ashx?id=80725524-e184-4e06-a61a-3e0c23e7c76f" /&gt;</description>
      <comments>http://hoser.lander.ca/CommentView,guid,80725524-e184-4e06-a61a-3e0c23e7c76f.aspx</comments>
      <category>Code Samples</category>
      <category>Loader</category>
    </item>
  </channel>
</rss>