mscorlib.dll is in GAC now in .Net framework 2.0

Mscorlib.dll is in GAC now in .Net framework 2.0, contrast to v1.0/v1.1, where mscorlib is in framework’s directory.

If you rely on mscorlib.dll’s path to get framework’s directory, you have to change your code to use System.Runtime.IneropServices.RuntimeEnvironment.GetRuntimeDirectory, which also exists in v1.1.

C:\>gacutil -l mscorlib
Microsoft (R) .NET Global Assembly Cache Utility.  Version 2.0.40607.16
Copyright (C) Microsoft Corporation. All rights reserved.

The Global Assembly Cache contains the following assemblies:
  mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, ProcessorArchitecture=x86

Number of items = 1

Comments (1)

  1. Actually I was mistaken. Obvious CLR loader team don’t want to break all the people who made the assumption that mscorlib.dll is in framework’s directory, so they actually lie about the location of mscorlib.dll, and returns the location to framework directory.

    C:>more test.cs

    using System;

    public class TestClass


    public static void Main(String[] args)