Microsoft KB Archive/919913

= 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: &quot;Unable to cast object of type&quot; =

Article ID: 919913

Article Last Modified on 8/25/2006

-

APPLIES TO


 * Microsoft Content Management Server 2002
 * Microsoft Visual Studio 2005 Team Foundation

-



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:  Close Visual Studio 2005. In the MCMS template project that you want to modify, open the Vwd.webinfo file.  Set the value of the CmsEnabled property to 0. To do this, use the following syntax:   Start Visual Studio 2005 again. 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.

<div class="status_section">

STATUS
Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the &quot;Applies to&quot; section.

Additional query words: TFS MCMS 2002 TemplateExplorerDocument

Keywords: kbqfe kbfix kbprb KB919913

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.