locked
When the value of the sub key is deleted or How to prevent the deleting - vsix RRS feed

  • Question

  • Hi,

    In vsix-package extension for SSMS I have problem -
    after the Initialize function the value of the sub-key is deleted (in the registery edit) and it causes that if I open the SSMS several times in a row, the extension is loaded only to the first instance of the SSMS. I know the deleting happens between the function Initialize and the event DTEEvents_OnStartupComplete
    What can I do in order to prevent the deleting or when is the value deleted?

    Thank you

    Tuesday, February 13, 2018 7:50 PM

All replies

  • Hi RonShell,

    >>I know the deleting happens between the function Initialize and the event TEEvents_OnStartupComplete What can I do in order to prevent the deleting or when is the value deleted?

    It seems that you could write a custom method, and execute it after Initialize , like this:

    DTEEvents _EventsObj;
    
        protected override void Initialize()
        {
            var dte = (EnvDTE.DTE)GetService(typeof(EnvDTE.DTE));
            _EventsObj = dte.Events.DTEEvents;
            _EventsObj.OnStartupComplete += OnStartupComplete;
        }
    
        void OnStartupComplete()
        {
        }

    https://stackoverflow.com/questions/8775111/dteevents-onstartupcomplete-event-not-working-for-vspackage-vssdk2010/14180361

    Best regards,

    Zhanglong


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, February 14, 2018 5:14 AM
  • >>I know the deleting happens between the function Initialize and the event TEEvents_OnStartupComplete

    I meant to the event `OnStartupComplete` It says that the deleting happens before -it happens when the SSMS finished to load itself

    I asked for the event of the deleting or how to prevent the deleting

    Thank you anyway (I will be very happy if you will find the answer :)

    Ron



    • Edited by RonShell Wednesday, February 14, 2018 7:50 AM
    Wednesday, February 14, 2018 7:16 AM
  • Hi RonShell,


    Maybe you could create an event session, which you can see details about the inner operations of the SQL system and your application. For more information, please refer to:

    https://docs.microsoft.com/en-us/sql/relational-databases/extended-events/quick-start-extended-events-in-sql-server

    Best regards,

    Zhanglong


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


    Tuesday, February 27, 2018 6:32 AM