Open jeffkl opened 1 year ago
Team triage: @baronfel what do you think?
This seems like a good thing to have - it appears we designed the resolver mechanism with relatively short lived clients in mind, but VS (and the MSBuild Server Daemon) are a different use case entirely.
SDK resolvers have caches because they depend on certain things such as files on disk to determine paths to SDKs. In order to make the cache more effective, SDK resolvers can make these caches
static
so they can be re-used by evaluations within the same process, especially Visual Studio. However, a long lived process likedevenv.exe
can cause these caches to potentially grow. It would be good if MSBuild had an API that could tell SDK resolvers to clear their state. For example, in Visual Studio when you close a solution, the SDK resolvers' caches could be cleared.