Is it possible to use .ctc files in Visual Studio

2019-09-19 05:27发布

问题:

I have a VSPackage that started life off as a Visual Studio 2005 project, was migrated successfully to Visual Studio 2008 and now it is being migrated to Visual Studio 2010.

The problem is that all of the menus are defined in a .ctc file which I understand has now been superseded by the XML-based .vsct file, and they no longer work.

Is there a way to get Visual Studio 2010 to recognise the .ctc file as before or am I going to have to convert all of the menus into the .vsct format? Everything else works as normal.

回答1:

The CTC format was deprecated back at VS2008. Yes, there is a converter available from convert from CTC to VSCT. Covered by this MSDN page. Read the page for instructions, I'll just outline that page here. You need to obtain the Perl runtime. Then you can run the ConvertCTCToVSCT.pl script located in the VisualStudioIntegration\Tools\bin subdirectory from the command line:

 c:\pathto\perl.exe "c:\pathto\ConvertCTCtoVSCT.pl" PkgCmd.ctc PkgCmd.vsct

Where pathto are the paths to the respective files.