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

RequiredMemberAttribute Ambiguous reference #21073

Closed
jamescrosswell opened this issue Aug 20, 2024 · 2 comments · Fixed by #21076
Closed

RequiredMemberAttribute Ambiguous reference #21073

jamescrosswell opened this issue Aug 20, 2024 · 2 comments · Fixed by #21076
Labels
binding-projects Issue or PR that affects binding projects bug If an issue is a bug or a pull request a bug fix
Milestone

Comments

@jamescrosswell
Copy link

jamescrosswell commented Aug 20, 2024

Apple platform

iOS, Mac Catalyst

Framework version

net8.0-*

Affected platform version

.net 9.0.100-preview.7.24407.12

Description

When building the bindings projects for the Sentry SDK targeting net8-ios or net8-maccatalyst using .net 9.0.100-preview.7.24407.12, I'm seeing numerous ambiguous reference exceptions related to the [RequiredMember] attribute that is used to decorate various types in the generated bindings.

The ambiguity is between 'Foundation.RequiredMemberAttribute' and 'System.Runtime.CompilerServices.RequiredMemberAttribute'.

Steps to Reproduce

I've tried to create a minimal reproducible example of the problem at:

That repo includes instructions on how to run the build that generates these ambiguous reference errors.

I don't have a clean machine that I can use to try to test that though so I'm not entirely sure what dependencies you'll need to install before being able to run that:

  • Some of the things that I've installed on my machine are detailed in the Contributing.md file for the Sentry .NET SDK.
  • In addition to that, I've installed .net 9.0.100-preview.7.24407.12
  • Lots of dotnet workloads need to be installed... worth noting that dotnet workload restore does not seem to be sufficient... I also had to run dotnet workload install maui

Hopefully the above is enough to be able to reproduce the problem. If not, I'll see what I can do. The problem itself seems pretty obvious though.

Did you find any workaround?

None

Build logs

See build logs attached:
msbuild-log.zip

@jamescrosswell jamescrosswell added the binding-projects Issue or PR that affects binding projects label Aug 20, 2024
@rolfbjarne
Copy link
Member

  • jamescrosswell/ambiguous-reference

I get a 404, is it a private repository?

rolfbjarne added a commit that referenced this issue Aug 20, 2024
…Fixes #21073.

There's a `System.Runtime.CompilerServices.RequiredMemberAttribute` type,
which may lead to ambiguous type references otherwise.

Fixes #21073.
@rolfbjarne rolfbjarne added this to the Future milestone Aug 20, 2024
@rolfbjarne rolfbjarne added the bug If an issue is a bug or a pull request a bug fix label Aug 20, 2024
@jamescrosswell
Copy link
Author

I get a 404, is it a private repository?

Argh... sorry about that. It's public now.

azure-pipelines bot pushed a commit that referenced this issue Aug 22, 2024
…Fixes #21073.

There's a `System.Runtime.CompilerServices.RequiredMemberAttribute` type,
which may lead to ambiguous type references otherwise.

Fixes #21073.
dalexsoto pushed a commit that referenced this issue Aug 23, 2024
…nd OptionalMember attributes. Fixes #21073. (#21101)

There's a `System.Runtime.CompilerServices.RequiredMemberAttribute`
type,
which may lead to ambiguous type references otherwise.

Fixes #21073.


Backport of #21076

Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
binding-projects Issue or PR that affects binding projects bug If an issue is a bug or a pull request a bug fix
Projects
None yet
2 participants