From 78f88633baf99211a2157efbadf072d4981de1b0 Mon Sep 17 00:00:00 2001 From: Jonathan Peppers Date: Thu, 21 Nov 2024 12:36:09 -0800 Subject: [PATCH] [Xamarin.Android.Build.Tasks] close `XAAssemblyResolvers` (#9531) Fixes: https://github.com/dotnet/android/issues/9133 Context: https://discord.com/channels/732297728826277939/732297916680765551/1308554103206580244 Context: 86260ed36dfe1a90c8ed6a2bb1cd0607d637f403 Various customers have been reporting `UnauthorizedAccessExceptions` in incremental builds, which seems to be a new problem in .NET 9. We were not able to reproduce the issue locally, but with the number of reports it seems to be a real issue. One customer shared a [`MSBuild.dmp`][0] file (while the file was locked), where I could observe the objects in memory: MemoryMappedViewStream 132 Mono.Cecil.PE.Image 100 Mono.Cecil.ModuleDefinition 100 Mono.Cecil.TypeDefinition 100 Mono.Cecil.TypeDefinition[] 100 List 1 Xamarin.Android.Tasks.NativeCodeGenState [Static variable Xamarin.Android.Tasks.NativeCodeGenState.