locked
Cancel solution loading programmatically RRS feed

  • Question

  • Hello,

    I'm trying to cancel a solution loading process within the IVsSolutionLoadEvents.OnBeforeOpenSolution method.

    Any ideas howto accomplish it?

    Returning E_FAIL or throwing exceptions does not impact the loading at all. I also tried to close the root solution element with a IVsSolution.CloseSolutionElement but it didn't work either.

    Best regards,

    Dimitri

    Friday, September 12, 2014 2:14 PM

Answers

  • Hi Dimitri,

    I didn't find any documentation indicating how to cancel loading a solution in the solution load events. Seems that we can only use IVsSolutionLoadManager to manipulate how to load the projects in the solution in the  OnBeforeOpenProject event handler. There're four status we can set for the projects, as the document indicates:

    PLP_DemandLoad: force the immediate load of the project during the Open Solution operation. If this value is set after the solution is opened, then this will force the load of the project on the very next idle point (or synchronously if IVsSolution4::EnsureXXXLoaded is also called). PLP_BackgroundLoad: load in the background on idle.

    PLP_LoadIfNeeded: load only if needed as a dependency of another loaded project, or if the user expands the project in the Solution Explorer. PLP_ExplicitLoadOnly: keep unloaded even if needed as a dependency of another project. Explicit load only projects behave the same as projects unloaded by the user.

    Please refer to this document:

    Managing Project Loading in a Solution


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.



    • Edited by Caillen Monday, September 15, 2014 11:13 AM
    • Marked as answer by Dimitri Dering Tuesday, September 16, 2014 2:49 PM
    Monday, September 15, 2014 11:10 AM

All replies

  • Hi Dimitri,

    I didn't find any documentation indicating how to cancel loading a solution in the solution load events. Seems that we can only use IVsSolutionLoadManager to manipulate how to load the projects in the solution in the  OnBeforeOpenProject event handler. There're four status we can set for the projects, as the document indicates:

    PLP_DemandLoad: force the immediate load of the project during the Open Solution operation. If this value is set after the solution is opened, then this will force the load of the project on the very next idle point (or synchronously if IVsSolution4::EnsureXXXLoaded is also called). PLP_BackgroundLoad: load in the background on idle.

    PLP_LoadIfNeeded: load only if needed as a dependency of another loaded project, or if the user expands the project in the Solution Explorer. PLP_ExplicitLoadOnly: keep unloaded even if needed as a dependency of another project. Explicit load only projects behave the same as projects unloaded by the user.

    Please refer to this document:

    Managing Project Loading in a Solution


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.



    • Edited by Caillen Monday, September 15, 2014 11:13 AM
    • Marked as answer by Dimitri Dering Tuesday, September 16, 2014 2:49 PM
    Monday, September 15, 2014 11:10 AM
  • Thank you for the quick response, although it's not the answer I hoped for. 

    I'll try to do the best of it.

    Best regards,

    Dimitri

    Tuesday, September 16, 2014 2:48 PM