FIX: Error message when you try to use Visual Studio 2005 Team Foundation Server to check in files on a computer that is running Content Management Server 2002: "Unable to cast object of type"

Article translations Article translations
Article ID: 919913 - View products that this article applies to.
Expand all | Collapse all

SYMPTOMS

On a computer that is running Microsoft Content Management Server (MCMS) 2002 Service Pack 2 (SP2), you try to use the source control feature in Microsoft Visual Studio 2005 Team Foundation Server to check in files. However, you receive the following error message:
[Microsoft Visual Studio]
Unable to cast object of type 'Microsoft.ContentManagement.DeveloperTools.VisualStudio.Documents.TemplateExplorerDocument' to type 'Microsoft.VisualStudio.Shell.Interop.IVsHierarchy'.
This problem also occurs if the following conditions are true:
  • An MCMS 2002 project is opened in Microsoft Visual Studio 2005.
  • You perform a unit test in Visual Studio 2005.

CAUSE

This problem occurs because the Microsoft.VisualStudio.Shell.Interop.dll library that MCMS 2002 uses is incompatible with the Microsoft.VisualStudio.Shell.Interop.dll library that is included with other products. These products include Visual Studio Industry Partners (VSIP) 7.1 and VSIP 8.0.

RESOLUTION

To resolve this problem, disable the MCMS Template Explorer when you use the Team Foundation service. When you disable the MCMS Template Explorer, the MCMS development tools are not loaded. To disable the MCMS Template Explorer for a specific MCMS template project, follow these steps for every MCMS template project:
  1. Close Visual Studio 2005.
  2. In the MCMS template project that you want to modify, open the Vwd.webinfo file.
  3. Set the value of the CmsEnabled property to 0. To do this, use the following syntax:
    <UserProperties CmsEnabled="0"/>
  4. Start Visual Studio 2005 again.
  5. Use any other Web form project to check in the templates.
After you set the value of the CmsEnabled property to 0, you can still check in the template files from the MCMS template project. By setting the value of the CmsEnabled property to 0, you only disable the MCMS Template Explorer. If you want to update template gallery items (TGIs) from the MCMS Template Explorer, you must change the value of the CmsEnabled property back to 1.

STATUS

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

Properties

Article ID: 919913 - Last Review: August 25, 2006 - Revision: 1.3
APPLIES TO
  • Microsoft Content Management Server 2002
  • Microsoft Visual Studio 2005 Team System Team Foundation:
Keywords: 
kbqfe kbfix kbprb KB919913

Give Feedback

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com