Skip to content

[Mono.Android] Remove AdditionalProperties from Java.Interop tools project references. - #8573

Merged
jpobst merged 1 commit into
mainfrom
less-generator
Dec 8, 2023
Merged

[Mono.Android] Remove AdditionalProperties from Java.Interop tools project references.#8573
jpobst merged 1 commit into
mainfrom
less-generator

Conversation

@jpobst

@jpobstjpobst commented Dec 7, 2023

Copy link
Copy Markdown
Contributor

Context: e2854ee

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 <ProjectReference>. This was needed as a result of trying to reference a net472;net7.0generator project in a MonoAndroid1.0;net7.0Mono.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.

@jpobst
jpobst marked this pull request as ready for review December 8, 2023 05:03
@jpobst
jpobst requested a review from jonpryor as a code ownerDecember 8, 2023 05:03
@jpobst
jpobst requested a review from pjcollinsDecember 8, 2023 05:03
@jpobst
jpobst merged commit b780934 into mainDec 8, 2023
@jpobst
jpobst deleted the less-generator branch December 8, 2023 17:37
grendello added a commit that referenced this pull request Dec 11, 2023
* main:
[Microsoft.Android.Sdk.ILLink] remove more linker sources (#8572)
[Mono.Android] Remove `AdditionalProperties` from Java.Interop tools project references. (#8573)
LEGO: Merge pull request 8575
@github-actionsgithub-actionsBot locked and limited conversation to collaborators Jan 22, 2024
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@jpobst@pjcollins