locked
vspackage not loaded on opening solution RRS feed

  • Question

  • I have a VsPackage that is loaded in all relevant ui contexts (in particular NoSolution, SolutionBuilding and SolutionExists). The VsPackage implements IVsSolutionEvents and IVsPersistSolutionProps. In method ReadSolutionProps I read value from .sln file and in OnAfterOpenSolution I act upon the value read (want to perform solution upgrade if necessary). It all works just fine when I open VS first and then open the solution from within VS. However when I double click on the solution file then the solution loads but the events are not called. Why is that and what do I do about that? Tested on VS2008SP1.
    Monday, July 19, 2010 3:23 PM

Answers

  • Hi Tomasz,

    Where do you call AdviseSolutionEvents? Can you log/display an error when/if this fails? If you load a different solution after opening that first one with a dblclick, does your SolutionEvents handler get fired? If so, it could be that in this instance, your package is being loaded after the solution is loaded, which would pretty much ensure those events wouldn't fire. If that's the case, you'll probably need to check to see if a solution/project is already present in your package initialize code.

    Sincerely,


    Ed Dore
    Monday, August 23, 2010 9:28 PM

All replies

  • Tomasz,

    Sorry for the delay. Do you still need help with this?


    --Trevor H.
    Send files to Hotmail.com: "MS_TREVORH"
    Check out the Microsoft CTS TFS BLOG: blogs.msdn.com/b/dstfs
    Monday, August 23, 2010 2:10 PM
  • Hi Tomasz,

    Where do you call AdviseSolutionEvents? Can you log/display an error when/if this fails? If you load a different solution after opening that first one with a dblclick, does your SolutionEvents handler get fired? If so, it could be that in this instance, your package is being loaded after the solution is loaded, which would pretty much ensure those events wouldn't fire. If that's the case, you'll probably need to check to see if a solution/project is already present in your package initialize code.

    Sincerely,


    Ed Dore
    Monday, August 23, 2010 9:28 PM