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.
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.
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.
Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.