DialogPage/IProfileManager: When ResetSettings is called?

Answered DialogPage/IProfileManager: When ResetSettings is called?

  • Tuesday, February 28, 2012 10:49 PM
     
     

    Hi forum,

    can someone tell me when the ResetSettings method of a DialogPage or IProfileManager class gets called? I've tried various things. For example reset all settings through the "Import and Export Settings..." wizard. But the method is not called.

    Maybe someone can help me :).

    Thx & bye
    Twainsoft


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

All Replies

  • Thursday, March 01, 2012 10:08 AM
    Moderator
     
     

    Hi Twainsoft,

    I also can reproduce this issue.

    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


  • Wednesday, August 08, 2012 5:18 AM
    Moderator
     
     Answered

    Realize this is a somewhat ancient post, but I recently ran into this myself. Turns out the ResetSettings is never invoked. If you want to reset various options via that Import / Export Settings dialog, your package needs to implement IVsUserSettings.

    What was entirely puzzling what the fact that I could see various settings being reset here, even though my own ResetSettings was never invoked. So I wound up debugging through how the debugger persists that "Load Dll Export" setting on it's Native options page.

    After a bit of debugging I found that the setting was being reset on the following callstack, which was the clue I needed to puzzle this out.

    > vsdebug.dll!CDebugger::OnLoadDllExportsSettingChanged()  Line 16402 C++
      vsdebug.dll!CDebuggerOptions::SetOption(CDebuggerOptions::Options iOption, unsigned long dwValue)  Line 100 + 0xe bytes C++
      vsdebug.dll!CDebuggerOptions::Import(const wchar_t * pszCategoryGuid, IVsSettingsReader * pSettingsReader, unsigned long Flags, int * pRestartRequired)  Line 405 C++
      vsdebug.dll!CDebugger::ImportSettings(const wchar_t * pszCategoryGuid, IVsSettingsReader * pSettingsReader, unsigned long Flags, int * pfRestartRequired)  Line 14906 C++
      vsdebug.dll!CVSDebugPackage::ImportSettings(const wchar_t * pszCategoryGuid, IVsSettingsReader * pSettingsReader, unsigned long Flags, int * pfRestartRequired)  Line 4364 C++
      msenv.dll!CVsProfileSettingsTree::LogCategoryOperation<`anonymous namespace'::<lambda0> >(const wchar_t * szOperation, Microsoft::Internal::Performance::CodeMarkerEvent startID, Microsoft::Internal::Performance::CodeMarkerEvent endID, `anonymous-namespace'::<lambda0> f)  Line 3601 C++
      msenv.dll!CVsProfileImportSettingsTree::DoUserSettingsCategoryImport(CVsProfileImportSettingsTree::ImportDataHolder * pImportDataHolder)  Line 5103 + 0x2f bytes C++
      msenv.dll!CVsProfileImportSettingsTree::DoLeafNodeImport(CVsProfileImportSettingsTree::ImportDataHolder * pImportDataHolder)  Line 4847 + 0x8 bytes C++
      msenv.dll!CVsProfileImportSettingsTree::DoImport(IVsProfileXmlWriter * pXmlWriterAutoSave, IXMLDOMNode * pCurrentNodeAutoSave, IVsSettingsErrorReporter * pErrorReporter, unsigned long dwFlags)  Line 3835 + 0xf bytes C++
      msenv.dll!CVsProfileImportSettingsTree::DoImportChildTrees(CVsProfileImportSettingsTree::ImportDataHolder * pImportDataHolder)  Line 4774 C++
      msenv.dll!CVsProfileImportSettingsTree::DoImport(IVsProfileXmlWriter * pXmlWriterAutoSave, IXMLDOMNode * pCurrentNodeAutoSave, IVsSettingsErrorReporter * pErrorReporter, unsigned long dwFlags)  Line 3823 + 0xf bytes C++
      msenv.dll!CVsProfileDataManager::InternalImportSettings(IVsProfileSettingsTree * pSettingsTree, unsigned long dwFlags, IVsSettingsErrorInformation * * ppSettingsErrorInformation)  Line 1780 + 0x11 bytes C++
      msenv.dll!CVsProfileDataManager::ResetSettings(IVsProfileSettingsFileInfo * pFileInfo, IVsSettingsErrorInformation * * ppSettingsErrorInformation)  Line 742 + 0xf bytes C++
      [Managed to Native Transition]
      Microsoft.VisualStudio.CommonIDE.dll!Microsoft.VisualStudio.CommonIDE.VsSettings.SettingsAction.DoResetOperation() Line 399 + 0x1b bytes C#
      Microsoft.VisualStudio.CommonIDE.dll!Microsoft.VisualStudio.CommonIDE.VsSettings.SettingsAction.DoAction() Line 145 + 0x8 bytes C#
      Microsoft.VisualStudio.CommonIDE.dll!Microsoft.VisualStudio.CommonIDE.VsSettings.SettingsProgressPage.DoWizardAction() Line 65 C#

    Sincerely,


    Ed Dore