locked
Default editor for specific extension ? RRS feed

  • Question

  • Hi,

    I create package editor for specific extension let say *.abcdef that targeting VS2005 - VS 2013. I create deployment project for them and register them to registry manually. I try to install them and all works fine except that for VS2010 when I open the *.abcdef using Open with... context menu, I see the Automatic Editor Selector (XML) is default for *.abcdef and I need to set to let say AbcDefEditor as default manually. Meanwhile in both VS2005 and VS2008 it already set to AbcDefEditor.

    I already check all registration step for all VS versions and they are same step but why different ?

    Is this because those version does not have Automatic Editor Selector (XML) so it set to AbcDefEditor automatically or is there any additional registration needed ?

    FYI : for VS2010 and above, after I set the .abcdef to using AbcDefEditor as default, whenever I create new project with that item, it already set to AbcDefEditor by default.


    It's hard to be advanced programmer

    Tuesday, December 24, 2013 11:58 AM

Answers

  • You can check the $RootKey$\Editors\{your editor GUID} and find the extension key, the value of the key should be the pority for VS to find the default editor.

    For example, in your pkgdef, find something like

    [$RootKey$\Editors\{guid}\Extensions]
    "abcdef"=dword:00000032

    play around the dward value either higher or lower to see if it make difference.

    I feel that XML become the default just because the default value has higher prority than yours.

    You may also define the default editor for your file directly, using the way metioned here:

    http://www.codeproject.com/Articles/100117/How-To-Change-Visual-Studio-Default-Editor

    Regards,

    Yi


    MSC on Computer Science (Parallel algorithm)


    • Edited by Li Yifeng Friday, December 27, 2013 5:24 AM typo
    • Marked as answer by IRW7 Saturday, January 4, 2014 10:41 AM
    Friday, December 27, 2013 5:23 AM

All replies

  • Hi IRW7,

    I'm sorry that I'm not clear about your issue. Could you please provide us with details about your package editor?

    Could you please clarify your sentence "VS2010 when I open the *.abcdef using Open with... context menu, I see the Automatic Editor Selector (XML) is default for *.abcdef and I need to set to let say AbcDefEditor as default manually."?

    Best regards,

    Sunny

    Wednesday, December 25, 2013 7:35 AM
  • Sorry, I try to explain more detail. Let say I create editor for .abcdef extension for all version of Visual Studio from 2005 to 2013. And let say the editor named is AbcDefEditor.

    I using deployment project to register packages into windows registry for all versions based on .pkgdef files created by Visual Studio itself when build the project.

    Normally when you register an extension to be used for specific editor, when you open the file it will open associated editor atuomatically. In the case .abcdef file it will open AbcDefEditor. You can check by right-click on the file in solution explorer and select 'Open with...'. The editor list will open and you will see item AbcDefEditor (Default).

    In my case it works for visual studio 2005 and 2008, but started from 2010 it using XML Editor for .abcdef file. When I check the by 'Open with...' to show all possible editor, it seem that my editor is not default. The default is 'Automatic Editor Selector (XML) (Default)' and my AbcDefEditor is not default and also placed in the 2nd order.


    It's hard to be advanced programmer

    Thursday, December 26, 2013 3:43 AM
  • You can check the $RootKey$\Editors\{your editor GUID} and find the extension key, the value of the key should be the pority for VS to find the default editor.

    For example, in your pkgdef, find something like

    [$RootKey$\Editors\{guid}\Extensions]
    "abcdef"=dword:00000032

    play around the dward value either higher or lower to see if it make difference.

    I feel that XML become the default just because the default value has higher prority than yours.

    You may also define the default editor for your file directly, using the way metioned here:

    http://www.codeproject.com/Articles/100117/How-To-Change-Visual-Studio-Default-Editor

    Regards,

    Yi


    MSC on Computer Science (Parallel algorithm)


    • Edited by Li Yifeng Friday, December 27, 2013 5:24 AM typo
    • Marked as answer by IRW7 Saturday, January 4, 2014 10:41 AM
    Friday, December 27, 2013 5:23 AM
  • I already tried what u said and it doesn't work. And I think the way of change default editor in user registry does not make sense, because that is user preference which one default editor for specific extension.

    Btw I want to ask about the UntrustedLogicalViews key in Microsoft XML Editor which is my logical view GUID registered under it ?


    It's hard to be advanced programmer


    • Edited by IRW7 Saturday, December 28, 2013 9:31 AM
    Saturday, December 28, 2013 8:45 AM
  • Hi IRW7,

    I think I have got you. In visual studio 2010, you can not open the .abcdef file using AbcDefEditor by default.

    >>"I already tried what u said and it doesn't work."

    Could you please tell us that how you change the key value?

    From MSDN, we know XML Editor in VS2010 is a little different from VS2008 and VS2005. Please check this page. I suggest you change the default editor that you want.

    Best regards,

    Sunny


    • Edited by Anna Cc Friday, January 3, 2014 2:38 AM
    Friday, January 3, 2014 2:05 AM