Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Dec 8, 2023

Conversation

jpobst
Copy link
Contributor

@jpobst jpobst commented Dec 7, 2023

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.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.

@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 owner December 8, 2023 05:03
@jpobst jpobst requested a review from pjcollins December 8, 2023 05:03
@jpobst jpobst merged commit b780934 into main Dec 8, 2023
45 of 47 checks passed
@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-actions github-actions bot locked and limited conversation to collaborators Jan 22, 2024
Sign up for free to 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.

None yet

2 participants