Determine currently loaded version of System.Xml.dll and Mscorlib.dll ?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • MC

    Determine currently loaded version of System.Xml.dll and Mscorlib.dll ?

    Is there an easy way for a .NET application to determine the version of
    Mscorlib.dll and System.Xml.dll that is is actually using?

    Given that System.Xml.dll has been revised several times (within .NET 2.0),
    I'm wanting to find out if my program is running in an up-to-date
    environment.

    Thanks.

  • Ignacio Machin ( .NET/ C# MVP )

    #2
    Re: Determine currently loaded version of System.Xml.dll andMscorlib.dll ?

    On Apr 24, 9:17 am, "MC" <for.address.l. ..@www.ai.uga.e du.slash.mc>
    wrote:
    Is there an easy way for a .NET application to determine the version of
    Mscorlib.dll and System.Xml.dll that is is actually using?
    >
    Given that System.Xml.dll has been revised several times (within .NET 2.0),
    I'm wanting to find out if my program is running in an up-to-date
    environment.
    >
    Thanks.
    Use Assembly.GetAss embly to get a reference to the assembly

    Comment

    • MC

      #3
      Re: Determine currently loaded version of System.Xml.dll and Mscorlib.dll ?

      "Ignacio Machin ( .NET/ C# MVP )" <ignacio.machin @gmail.comwrote in
      message
      news:c6da735e-9dd7-4c9f-b9b7-2edff6e33b60@w7 g2000hsa.google groups.com...
      On Apr 24, 9:17 am, "MC" <for.address.l. ..@www.ai.uga.e du.slash.mc>
      wrote:
      >Given that System.Xml.dll has been revised several times (within .NET
      >2.0),
      >I'm wanting to find out if my program is running in an up-to-date
      >environment.
      Use Assembly.GetAss embly to get a reference to the assembly
      Thanks, Ignacio. Worked like a charm. In detail, here's how I did it, in
      case anyone else wonders:

      Assembly a = Assembly.GetAss embly(typeof(Co nsole));
      Console.WriteLi ne("Mscorlib.dl l information:");
      Console.WriteLi ne(a.ImageRunti meVersion);
      Console.WriteLi ne(a.CodeBase);

      /* Assembly */ a = Assembly.GetAss embly(typeof(Xm lSerializer));
      Console.WriteLi ne("System.Xml. dll information:");
      Console.WriteLi ne(a.ImageRunti meVersion);
      Console.WriteLi ne(a.CodeBase);

      Comment

      Working...