VSIX Detect that a solution has been created











up vote
1
down vote

favorite












While Microsoft makes it "reasonably easy" to determine when a solution has been opened or closed in a VSIX extension



  IVsSolution.GetSolutionInfo(
out pbstrSolutionDirectory,
out pbstrSolutionFile,
out pbstrUserOptsFile);


I am puzzling how exactly in a VSIX extension can I get information / event on when a new solution is created. Is such a thing possible?



I'm assuming there must be some way to do this, but as the Microsoft extension documentation is sparse, I cannot find it.










share|improve this question
























  • The doco is terrible. The best thing you can do is browse the Managed Package Framework sourcecode. A great real-world example is the IronPython Language Extension
    – MickyD
    Nov 7 at 6:55

















up vote
1
down vote

favorite












While Microsoft makes it "reasonably easy" to determine when a solution has been opened or closed in a VSIX extension



  IVsSolution.GetSolutionInfo(
out pbstrSolutionDirectory,
out pbstrSolutionFile,
out pbstrUserOptsFile);


I am puzzling how exactly in a VSIX extension can I get information / event on when a new solution is created. Is such a thing possible?



I'm assuming there must be some way to do this, but as the Microsoft extension documentation is sparse, I cannot find it.










share|improve this question
























  • The doco is terrible. The best thing you can do is browse the Managed Package Framework sourcecode. A great real-world example is the IronPython Language Extension
    – MickyD
    Nov 7 at 6:55















up vote
1
down vote

favorite









up vote
1
down vote

favorite











While Microsoft makes it "reasonably easy" to determine when a solution has been opened or closed in a VSIX extension



  IVsSolution.GetSolutionInfo(
out pbstrSolutionDirectory,
out pbstrSolutionFile,
out pbstrUserOptsFile);


I am puzzling how exactly in a VSIX extension can I get information / event on when a new solution is created. Is such a thing possible?



I'm assuming there must be some way to do this, but as the Microsoft extension documentation is sparse, I cannot find it.










share|improve this question















While Microsoft makes it "reasonably easy" to determine when a solution has been opened or closed in a VSIX extension



  IVsSolution.GetSolutionInfo(
out pbstrSolutionDirectory,
out pbstrSolutionFile,
out pbstrUserOptsFile);


I am puzzling how exactly in a VSIX extension can I get information / event on when a new solution is created. Is such a thing possible?



I'm assuming there must be some way to do this, but as the Microsoft extension documentation is sparse, I cannot find it.







c# visual-studio vsix






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 7 at 6:39









MickyD

10.5k63152




10.5k63152










asked Nov 7 at 6:03









coactivechris

133




133












  • The doco is terrible. The best thing you can do is browse the Managed Package Framework sourcecode. A great real-world example is the IronPython Language Extension
    – MickyD
    Nov 7 at 6:55




















  • The doco is terrible. The best thing you can do is browse the Managed Package Framework sourcecode. A great real-world example is the IronPython Language Extension
    – MickyD
    Nov 7 at 6:55


















The doco is terrible. The best thing you can do is browse the Managed Package Framework sourcecode. A great real-world example is the IronPython Language Extension
– MickyD
Nov 7 at 6:55






The doco is terrible. The best thing you can do is browse the Managed Package Framework sourcecode. A great real-world example is the IronPython Language Extension
– MickyD
Nov 7 at 6:55














1 Answer
1






active

oldest

votes

















up vote
1
down vote



accepted










Use the IVsSolutionEvents.OnAfterOpenSolution(Object, Int32) method, whose second parameter, fNewSolution is what you want: true if the solution is being created. false if the solution was created previously or is being loaded.



You get IVsSolutionEvents with the IVsSolution.AdviseSolutionEvents(IVsSolutionEvents, UInt32) / IVsSolution.UnadviseSolutionEvents(UInt32) methods



I created a working VSIX sample some time ago HOWTO: Get solution events from a Visual Studio package






share|improve this answer





















  • Carlos, much appreciated, brother. Your code looks perfect. Cheers!
    – coactivechris
    Nov 7 at 21:34











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














 

draft saved


draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53184300%2fvsix-detect-that-a-solution-has-been-created%23new-answer', 'question_page');
}
);

Post as a guest
































1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
1
down vote



accepted










Use the IVsSolutionEvents.OnAfterOpenSolution(Object, Int32) method, whose second parameter, fNewSolution is what you want: true if the solution is being created. false if the solution was created previously or is being loaded.



You get IVsSolutionEvents with the IVsSolution.AdviseSolutionEvents(IVsSolutionEvents, UInt32) / IVsSolution.UnadviseSolutionEvents(UInt32) methods



I created a working VSIX sample some time ago HOWTO: Get solution events from a Visual Studio package






share|improve this answer





















  • Carlos, much appreciated, brother. Your code looks perfect. Cheers!
    – coactivechris
    Nov 7 at 21:34















up vote
1
down vote



accepted










Use the IVsSolutionEvents.OnAfterOpenSolution(Object, Int32) method, whose second parameter, fNewSolution is what you want: true if the solution is being created. false if the solution was created previously or is being loaded.



You get IVsSolutionEvents with the IVsSolution.AdviseSolutionEvents(IVsSolutionEvents, UInt32) / IVsSolution.UnadviseSolutionEvents(UInt32) methods



I created a working VSIX sample some time ago HOWTO: Get solution events from a Visual Studio package






share|improve this answer





















  • Carlos, much appreciated, brother. Your code looks perfect. Cheers!
    – coactivechris
    Nov 7 at 21:34













up vote
1
down vote



accepted







up vote
1
down vote



accepted






Use the IVsSolutionEvents.OnAfterOpenSolution(Object, Int32) method, whose second parameter, fNewSolution is what you want: true if the solution is being created. false if the solution was created previously or is being loaded.



You get IVsSolutionEvents with the IVsSolution.AdviseSolutionEvents(IVsSolutionEvents, UInt32) / IVsSolution.UnadviseSolutionEvents(UInt32) methods



I created a working VSIX sample some time ago HOWTO: Get solution events from a Visual Studio package






share|improve this answer












Use the IVsSolutionEvents.OnAfterOpenSolution(Object, Int32) method, whose second parameter, fNewSolution is what you want: true if the solution is being created. false if the solution was created previously or is being loaded.



You get IVsSolutionEvents with the IVsSolution.AdviseSolutionEvents(IVsSolutionEvents, UInt32) / IVsSolution.UnadviseSolutionEvents(UInt32) methods



I created a working VSIX sample some time ago HOWTO: Get solution events from a Visual Studio package







share|improve this answer












share|improve this answer



share|improve this answer










answered Nov 7 at 12:19









Carlos Quintero

3,3891515




3,3891515












  • Carlos, much appreciated, brother. Your code looks perfect. Cheers!
    – coactivechris
    Nov 7 at 21:34


















  • Carlos, much appreciated, brother. Your code looks perfect. Cheers!
    – coactivechris
    Nov 7 at 21:34
















Carlos, much appreciated, brother. Your code looks perfect. Cheers!
– coactivechris
Nov 7 at 21:34




Carlos, much appreciated, brother. Your code looks perfect. Cheers!
– coactivechris
Nov 7 at 21:34


















 

draft saved


draft discarded



















































 


draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53184300%2fvsix-detect-that-a-solution-has-been-created%23new-answer', 'question_page');
}
);

Post as a guest




















































































Popular posts from this blog

横浜市

Rostock

Europa