Error message when you run a query in SQL Server Management Studio in SQL Server 2008 after you upgrade to Windows Vista: "The type initializer for 'Microsoft.SqlServer.Management.UI.Grid.ColumnInfo' threw an exception"


Beta Information


This article discusses a beta release of a Microsoft product. The information in this article is provided as-is and is subject to change without notice.

No formal product support is available from Microsoft for this beta product. For information about how to obtain support for a beta release, see the documentation that is included with the beta product files, or check the Web location where you downloaded the release.

Symptoms


You install Microsoft SQL Server 2008 on a computer that is running Windows XP. Then, you upgrade Windows XP to Windows Vista. When you run a query in SQL Server Management Studio, you receive the following error message:
The type initializer for 'Microsoft.SqlServer.Management.UI.Grid.ColumnInfo' threw an exception.
However, you can successfully run the query in Windows XP.

Cause


This problem occurs because the Windows Vista Setup program incorrectly replaces the Mscorlib.dll file of the Microsoft .NET Framework 2.0 Service Pack 1 (SP1). The Mscorlib.dll file of the later version of the file contains the DateTimeOffset data type. This data type does not exist in the earlier version of the Mscorlib.dll file.

When you install SQL Server 2008, SQL Server 2008 installs the .NET Framework 3.5 Service Pack (SP1). The .NET Framework 3.5 SP1 also installs the .NET Framework 2.0 SP1, and this service pack contains the later version of the Mscorlib.dll file. However, the Windows Vista Setup program replaces this version of the Mscorlib.dll file with the earlier version of the Mscorlib.dll file.

Workaround


To work around this problem, you must reinstall the .NET Framework 3.5 SP1.

Important You cannot work around this problem by repairing the installation of the .NET Framework 3.5 SP1.

To reinstall the .NET Framework 3.5 SP1, follow these steps:
  1. Uninstall the .NET Framework 3.5 SP1.
    1. In Control Panel, open the Programs and Features item.
    2. Click Microsoft .NET Framework 3.5 SP1, and then click
      Uninstall.
  2. Reinstall the .NET Framework 3.5 SP1.

    Note The .NET Framework 3.5 SP1 Setup program is in the following folder of the SQL Server 2008 installation media:
    InstallationMedia\Redist\DotNetFrameworks\

Status


Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.

More Information


After you upgrade a computer that is running SQL Server 2008 to Windows Vista, you may experience other issues that did not exist before the upgrade. If these issues are .NET Framework issues, these issues are very likely to be caused by the cause that is described in the "CAUSE" section.