Listing 1

using System;
using System.Reflection;

namespace SimpleSharedComponent
{
   /// <summary>
   /// This is a simple component which returns a string
   /// letting us know who it is
   /// </summary>
   public class SimpleSharedComponent
   {
      public SimpleSharedComponent()
      {
         Console.WriteLine("SimpleSharedComponent constructor code running...");
      }

      public string GetAssemblyFullName()
      {
         return "Hello from " + Assembly.GetExecutingAssembly().FullName;
      }
   }
}


Listing 2

[assembly: AssemblyKeyFile("..\\..\\SimpleKey.snk")]
[assembly: AssemblyVersion("1.0.0.0")]

Listing 3

using System;

namespace SimpleClient
{
   /// <summary>
   /// Summary description for SimpleClient.
   /// </summary>
   class SimpleClient
   {
      /// <summary>
      /// The main entry point for the application.
      /// </summary>
      [STAThread]
      static void Main(string[] args)
      {
         try
         {
            Console.WriteLine("Creating a SimpleSharedComponent object...");
            SimpleSharedComponent.SimpleSharedComponent c = new
			 SimpleSharedComponent.SimpleSharedComponent();
            Console.WriteLine(c.GetAssemblyFullName());

         }
         catch (Exception ex)
         {
            Console.WriteLine("An exception occurred: " + ex.Message);
         }
         finally
         {
            Console.WriteLine("Press Enter to Exit");
            Console.ReadLine();
         }
      }
   }
}

Listing 4

[assembly: AssemblyVersion("2.0.0.0")]


Listing 5

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
   <runtime>
      <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
         <dependentAssembly>
            <assemblyIdentity name="SimpleSharedComponent" 
               publicKeyToken="d6d8a86285a18a32" culture="neutral" />
            <bindingRedirect oldVersion="1.0.0.0" newVersion="2.0.0.0" />
         </dependentAssembly>
      </assemblyBinding>
   </runtime>
</configuration>

Listing 6

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
   <runtime>
      <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
         <dependentAssembly>
            <assemblyIdentity name="SimpleSharedComponent" 
               publicKeyToken="d6d8a86285a18a32" culture="neutral" />
            <bindingRedirect oldVersion="1.0.0.0-1.5.0.0" newVersion="2.0.0.0" />
         </dependentAssembly>
      </assemblyBinding>
   </runtime>
</configuration>

Listing 7

using System;
using System.Reflection;

namespace SimpleSharedComponent
{
   /// <summary>
   /// This is a simple component which returns a string
   /// letting us know who it is
   /// </summary>
   public class SimpleSharedComponent
   {
      public SimpleSharedComponent()
      {
         Console.WriteLine("SimpleSharedComponent constructor code running...");
      }

      public string GetAssemblyFullName()
      {
         return "Hello! I see you found Version 3.0.0.0";
      }
   }
}

Listing 8

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
   <runtime>
      <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
         <dependentAssembly>
            <assemblyIdentity name="SimpleSharedComponent" 
               publicKeyToken="d6d8a86285a18a32" culture="neutral" />
            <bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="3.0.0.0" />
         </dependentAssembly>
      </assemblyBinding>
   </runtime>
</configuration>