locked
Export empty settings tree creates a not really empty settings file RRS feed

  • Question

  • Hi forum,

    and again a new question related to the Visual Studio settings :).

    If I export a settings tree (fully disabled!) through this code:

    IVsProfileDataManager profileDataManager = Package.GetGlobalService(typeof(SVsProfileDataManager)) as IVsProfileDataManager;
     
    IVsSettingsErrorInformation settingsErrorInfo;
    IVsProfileSettingsTree exportableSettings;
                
    profileDataManager.GetSettingsForExport(out exportableSettings);
     
    exportableSettings.SetEnabled(0, 1);
     
    int exportResult = profileDataManager.ExportSettings(fileName, exportableSettings, out settingsErrorInfo);
    

    I thought I would get an empty settings file. Of course with the root and version element. That's what I get until now:

    <UserSettings>
        <ApplicationIdentity version="10.0"/>
        <ToolsOptions/>
        <Category name="Database Tools" RegisteredName="Database Tools"/>
    </UserSettings>

    Is there an explanation for the category "Database Tools"? Why this category in particular? Maybe someone can explain this :).

    Thx & bye
    Twainsoft


    The Visual Studio Settings-Switcher! Visit http://visualstudiogallery.msdn.microsoft.com/a79072f7-3109-44a0-95c0-9c50e729d6a3

    Tuesday, February 28, 2012 7:59 AM

Answers

  • I was able to replicate this, and I suspect this is a bug. I understand the AppID and ToolOptions nodes being written, but I cannot account for that category node being persisted. The codebase here isn't well commented, so it's a bit of a slog for me. But from what I can glean from stepping through parts of this, it looks we're merging a couple of different settings trees here, and there is some fixup code that supposed to remove and/or reposition some of the nodes. And I suspect it's this latter operation that's causing the issue.

    I'll log a bug with my repro with the VS IDE team.

    Thanks,


    Ed Dore

    Monday, March 5, 2012 9:59 PM

All replies

  • Hi Twainsoft,

    Thank you for your question.

    I am trying to involve someone familiar with this topic to further look at this issue. There might be some time delay. Appreciate your patience.

    Thank you for your understanding and support.


    Lucy Liu [MSFT]
    MSDN Community Support | Feedback to us

    Friday, March 2, 2012 8:40 AM
  • I was able to replicate this, and I suspect this is a bug. I understand the AppID and ToolOptions nodes being written, but I cannot account for that category node being persisted. The codebase here isn't well commented, so it's a bit of a slog for me. But from what I can glean from stepping through parts of this, it looks we're merging a couple of different settings trees here, and there is some fixup code that supposed to remove and/or reposition some of the nodes. And I suspect it's this latter operation that's causing the issue.

    I'll log a bug with my repro with the VS IDE team.

    Thanks,


    Ed Dore

    Monday, March 5, 2012 9:59 PM
  • Hi Ed Dore, thanks for your support! The issue is currently no problem for my code because I won't allow an empty export. But nice to see you can reproduce the issue and report it to the VS IDE team. Thx & bye Twainsoft

    The Visual Studio Settings-Switcher! Visit http://visualstudiogallery.msdn.microsoft.com/a79072f7-3109-44a0-95c0-9c50e729d6a3

    Wednesday, March 7, 2012 10:43 AM