From b7809346bd91df9e32bcf5a030c38a2e72f8e8de Mon Sep 17 00:00:00 2001 From: Jonathan Pobst Date: Fri, 8 Dec 2023 07:37:07 -1000 Subject: [PATCH] [Mono.Android] Remove `AdditionalProperties` from Java.Interop tools project references. (#8573) Context: https://github.com/xamarin/xamarin-android/commit/e2854ee71961d4a9910944e5b2aa7107cdf2349c Often when compiling XA locally on Windows I get this error: ``` CSC : error CS2012: Cannot open 'c:\code\xamarin-android\external\Java.Interop\tools\generator\obj\Debug-net7.0\generat or.dll' for writing -- 'The process cannot access the file 'c:\code\xamarin-android\external\Java.Interop\tools\generat or\obj\Debug-net7.0\generator.dll' because it is being used by another process.' [c:\code\xamarin-android\external\Java .Interop\tools\generator\generator.csproj] ``` This is caused by our usage of `AdditionalProperties` in our ``. This was needed as a result of trying to reference a `net472;net7.0` `generator` project in a `MonoAndroid1.0;net7.0` `Mono.Android` project. `AdditionalProperties` cause an additional build of the referenced project, setting global properties. Both this additional build and the original build are now `net7.0` causing them to clobber each other. Since we're now in a fully .NET world, we are no longer multi-targeting `generator` or `Mono.Android` so we can remove this hack and avoid the extra builds and potential sharing violation errors. --- src/Mono.Android/Mono.Android.csproj | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/Mono.Android/Mono.Android.csproj b/src/Mono.Android/Mono.Android.csproj index aed5a7bc6de..7e7ad031604 100644 --- a/src/Mono.Android/Mono.Android.csproj +++ b/src/Mono.Android/Mono.Android.csproj @@ -360,10 +360,9 @@ - - - - + + +