question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

In VS2022, the interfaces `IVsSolutionLoadManager` and `IVsSolutionLoadManagerSupport` have been removed. What is the recommended way now to handle solution load?

See original GitHub issue

I have a custom project solution which does some cleanup tasks before the solutions are opened. With Visual Studio 2022, in the list of removed APIs, https://docs.microsoft.com/en-us/visualstudio/extensibility/migration/removed-api-list?view=vs-2022#asynchronous-solution-load-and-lightweight-solution-load one of the items are the interfaces IVsSolutionLoadManager and IVsSolutionLoadManagerSupport. After this removal, what is the recommended way to handle solution load.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
zivkancommented, Dec 30, 2021

There are APIs like IVsSolutionEvents.OnAfterOpenSolution, IVsSolutionEvents.OnBeforeCloseSolution, IVsSolutionEvents.OnAfterCloseSolution, and KnownUIContexts.SolutionOpeningContext. Note that IVsSolution.GetSolutionInfo will return nulls (no solution loaded) when SolutionOpeningContext’s callback triggers. This one caught me out and I didn’t find a good solution except to re-check IVsSolution.GetSolutionInfo in every place that needs to know the solution path until the first time it’s not null. In practice, it was always not null the very next callback I received, but that might be IVsSolutionEvents.OnAfterLoadProject or IVsSolutionEvents.OnAfterLoadSolution, depending on whether or not the solution has any projects. When a solution does contain one or more projects, there wasn’t any event I could find that would allow me to get the solution directory before per-project events started coming in.

It’s not always easy, and sometimes can take significant time, but if you go the dotnet api browser, and select VS SDK 2022, or search scoped to the VS SDK, then you can start searching for keywords like solution and slowly hunt through the results until you find something worth testing. In fact, doing this in order to get the links for this comment, I discovered that there exists a SolutionEvents class, which claims to be a “Managed-friendly wrapper for IVsSolutionEvents”.

0reactions
kaveeshdcommented, Apr 5, 2022

@zivkan Thank you, your comments helped. It took me sometime to figure this out, and put everything in order.

I will close this issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Visual Studio 2022 SDK removed APIs
Support for opening a solution from source safe is being removed, as such the following methods, events, and, constants are being removed.
Read more >
Visual Studio cannot load a small set of projects in a large ...
As of VS 15.2, I cannot find any solution load manager extension that ... IVsSolutionLoadManager interface has apparently been deprecated.
Read more >
Visual Studio 2022 not loading Android project
For now, the easiest fix is to delete your hidden .vs folder for the solution. You then should be able to open the...
Read more >
Still forced to delete ".vs" folder to fix build errors or ...
When I deleted the ".vs" folder and reopened the solution, everything was fixed and fully functional again. Please note that I strongly suspect ......
Read more >
1. Solutions and Projects - Mastering Visual Studio .NET ...
To build anything with Visual Studio .NET, you need to use a solution, and that solution must contain at least one project. Solutions...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found