When you have a large solution comprising of multiple projects, you must have experienced a delay while loading the solution for the first time. One of the coolest feature in Visual Studio 2017 is the ‘Lightweight Solution Load’ which greatly reduces the Visual Studio startup time and the overall memory consumption. In this article, we will understand all the details around this new feature.
What is Lightweight Solution Load?
We might have all encountered the initial delay in loading big solutions with Visual Studio 2015. The ‘Lightweight Solution Load‘ feature minimizes this delay by skipping to load all the projects, when the solution is loaded. In simple words, the projects are not loaded until the time it is actually required. And this makes complete sense, since most of the real world scenarios like Navigating your code/ Editing your code/ Building your code, won’t require all projects to be loaded right at the beginning.
When do the Individual Projects inside the Solution load?
When you open/expand a project, you will notice a small delay and that’s when the project actually loads. So, the loading of the project is delayed until the user needs it.
At this point if you close the solution and open it again, you will find that the project which you had earlier opened, will be loaded by default. This is pretty nice, because Visual Studio recognizes/remembers users actions and loads the project at startup.
How to enable/disable this feature?
You can enable lightweight solution load for the entire IDE by navigating to
Tools -> Options -> Projects and Solutions
You can also enable this feature for an individual solution, by doing a Right Click and selecting the option ‘Enable Lightweight Solution Load’.
Couple of things to keep in mind here are —
- Enabling/disabling this feature at the Individual Solution level overrides the IDE-wide setting.
- Once you Enable/Disable this feature, it will take effect the next time you load your solution.
Automatic enabling of Lightweight load solution feature
Another cool thing I noticed was that when I opened my large solution for the first time using Visual Studio 2017, it gave me an automatic pop-up message asking me to enable lightweight solution load. Once you click on the ‘Enable’ link, this feature is activated for that individual Solution only.
Currently there are some limitations to this feature, where in few of the IDE features and third party extensions might not be fully compatible. This is the primary reason, why the ‘Lightweight Solution Load’ feature is turned off by default in Visual Studio 2017.
To summarize, if you are working with large C# solutions, I would highly recommend you to enable this feature and leverage the productivity improvement with faster solution load time.
Related Posts –