VSPackage : Package "Initialize" method isn't call until command is invoked RRS feed

  • Question

  • Hello all,

    I wrote a VSPackage extension a while back that helped me automate some functionality via added command to the Tools menu. This has been working great.

    Now I want to invoke an external tool whenever a document is saved. I have my extension listening to dte.Events.DocumentEvents.DocumentSaved, and I get the callback just fine. However, I set up the event listening in my Package.Initialize method, and that method is not invoked until one of the existing menu commands is invoked. So I don't receive any DocumentSaved events until I run one of my other commands.

    How can I register with the DocumentSaved event when Visual Studio starts up?


    I'm now using VS2017.

    Friday, March 10, 2017 6:35 PM