Search

Wednesday, May 4, 2011

Installation Error: mscorlib.tlb problem

When you install Microsoft SQL Server 2005 or Microsoft SQL Server 2008, you receive the following error message:


The file C:\Windows\Microsoft.NET\Framework\version_number\mscorlib.tlb could not be loaded. An attempt to repair this condition failed because the file could not be found. Please reinstall this program.
version_number is a placeholder for the version number of the Microsoft .NET Framework, such as v1.0.3705, v1.1.4870, or v2.0.50727.

This issue occurs because the path of the Mscorlib.tlb file is incorrectly interpreted during the Setup process.

SQL Server 2005

To solve this problem, you had to manually specify the correct path of the Mscorlib.tlb file in the registry. To do this, follow these steps:
  1. Click Start - Run, type regedit, and then click OK.
  2. Locate the following registry subkey:
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\90\Tools\Shell\TlbAutoRepair\mscorlib.tlb
    Notes
    • If you install SQL Server 2005 on 64-bit operating systems, locate the following registry subkey:
      HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Microsoft SQL Server\90\Tools\Shell\TlbAutoRepair\mscorlib.tlb
    • If you install SQL Server 2005 Express Edition with Advanced Services, locate the following registry subkey:
      HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\90\Tools\ShellSEM\TlbAutoRepair\mscorlib.tlb
  3. In the right side, double-click the registry entry TlbPath. The Edit String dialog box appears.
  4. In the Value data box, replace %CLRVERSION% with the following value:
    v2.0.50727
    Note The value v2.0.50727 indicates the version of the .NET Framework that the original release version of SQL Server 2005 uses.
  5. Click OK, and then exit Registry Editor.
SQL Server 2008
To solve this problem, you had to manually specify the correct path of the Mscorlib.tlb file in the registry. To do this, follow these steps:
  1. Click Start - Run, type regedit, and then click OK.
  2. Locate the following registry subkey:
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\100\Tools\Shell\TlbAutoRepair\mscorlib.tlb Notes
    If you install the 32-bit version of SQL Server 2008 on 64-bit operating systems, locate the following registry subkey:
    HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Microsoft SQL Server\100\Tools\Shell\TlbAutoRepair\mscorlib.tlb
    If you install SQL Server 2008 Express Edition with Advanced Services, locate the following registry subkey:
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\100\Tools\ShellSEM\TlbAutoRepair\mscorlib.tlb
  3. In the right pane, double-click TlbPath.
  4. In the Value data box, replace %CLRVERSION% with the following value:
    v2.0.50727
    Note The value v2.0.50727 indicates the version of the .NET Framework that the original release version of SQL Server 2008 uses.
  5. Click OK, and then exit Registry Editor.

6 comments:

  1. its working!, thank you

    ReplyDelete
  2. This comment has been removed by the author.

    ReplyDelete
  3. please help me to attached this database

    ReplyDelete
  4. I am getting error while attaching SQl 2014 DB " illegal characters in path, (mscorlib)

    ReplyDelete
  5. complete error :::

    Illegal characters in path. (mscorlib)

    ------------------------------
    Program Location:

    at System.IO.Path.CheckInvalidPathChars(String path, Boolean checkAdditional)
    at System.IO.Path.GetFileName(String path)
    at Microsoft.SqlServer.Management.SqlManagerUI.AttachDatabaseData.PrimaryFile.PopulateAssociatedFiles(String primaryFilePath)
    at Microsoft.SqlServer.Management.SqlManagerUI.AttachDatabaseData.PrimaryFile.PopulatePrimaryFileData(String primaryFilePath)
    at Microsoft.SqlServer.Management.SqlManagerUI.AttachDatabaseData.PrimaryFile..ctor(SqlManagementUserControl parent, CDataContainer dc, String fullPath, String databaseOwner, ServerConnection connectionInfo)
    at Microsoft.SqlServer.Management.SqlManagerUI.AttachDatabase.AddPrimaryFile(String fullPath, String fileName)
    at Microsoft.SqlServer.Management.SqlManagerUI.AttachDatabase.buttonBrowse_Click(Object sender, EventArgs e)
    at System.Windows.Forms.Control.OnClick(EventArgs e)
    at System.Windows.Forms.Button.OnClick(EventArgs e)
    at System.Windows.Forms.Button.WndProc(Message& m)
    at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
    at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
    at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
    at System.Windows.Forms.UnsafeNativeMethods.SendMessage(HandleRef hWnd, Int32 msg, IntPtr wParam, IntPtr lParam)
    at System.Windows.Forms.Control.SendMessage(Int32 msg, IntPtr wparam, IntPtr lparam)
    at System.Windows.Forms.Control.ReflectMessageInternal(IntPtr hWnd, Message& m)

    ReplyDelete