Visual Studio 2022 17.5 Preview 3, released on January 18, introduces the new build acceleration feature in Visual Studio. Build times have been improved for all SDK-style projects. In particular, larger projects will see greater build time improvements. The build acceleration works by avoiding redundant calls to MSBuild when building a dependent project.
The behavior of Visual Studio in versions prior to Preview 3 would in some cases trigger a call to MSBuild, even if no code was changed. When Visual Studio needed to copy the artifacts of a linked project that had already been built to a source directory, it would call MSBuild to rebuild the project and copy the necessary files to the source directory. Additional builds were triggered even when no build was required, Infoq wrote on the topic.
In this pre-release, Visual Studio will avoid calling MSBuild when only copying the artifacts to the source directory is needed, and will instead copy them to the correct locations independently.
Accelerating builds can be enabled by adding the AccelerateBuildsInVisualStudio property to true in the Directory.Build.props file, or alternatively it can be enabled per project by adding the same key to the project file.
In a Reddit thread, some users discussed that adding additional proprietary features in Visual Studio instead of the .NET SDK is undesirable as it implies vendor lock-in. Reddit user Atulin voiced his concerns:
So one more thing is being added to the non-free VS instead of being added to the SDK? First the debugger, then the hot reload, and now performance improvements are being pushed into VS?
What’s next? Algebraic data types supported only by a dedicated VS compiler?
Adding this feature to Visual Studio for Mac is not out of the question, but it doesn’t seem to be planned at this time.
The latest preview version of Visual Studio can be downloaded from the official Microsoft site. Currently the latest preview version is Preview 6 was released on February 7.