Skip to content

Conversation

@github-actions
Copy link
Contributor

@github-actions github-actions bot commented Sep 5, 2025

Backport of #119375 to release/9.0-staging

/cc @jkoritzinsky

Customer Impact

  • Customer reported
  • Found internally

If the user defines an interface with [ComImport] that defines an event or property, they will receive an AD0001 warning/error in their build. Found internally by the Guardian team.

Regression

  • Yes
  • No

[If yes, specify when the regression was introduced. Provide the PR or commit if known.]

Testing

[How was the fix verified? How was the issue missed previously? What tests were added?]

Added tests to verify that no diagnostic is reported for interfaces with the offending members. Previously we didn't have tests for this case.

Risk

[High/Medium/Low. Justify the indication by mentioning how risks were measured and addressed.]

Low. This is a build-time analyzer and the added tests validate the scenario.

IMPORTANT: If this backport is for a servicing release, please verify that:

  • The PR target branch is release/X.0-staging, not release/X.0.

Package authoring no longer needed in .NET 9

IMPORTANT: Starting with .NET 9, you no longer need to edit a NuGet package's csproj to enable building and bump the version.
Keep in mind that we still need package authoring in .NET 8 and older versions.

Properties aren't supported and the analyzer was crashing on the cast to MethodDeclarationSyntax later due to this.
@dotnet-policy-service
Copy link
Contributor

Tagging subscribers to this area: @dotnet/interop-contrib
See info in area-owners.md if you want to be subscribed.

@JulieLeeMSFT JulieLeeMSFT added the Servicing-consider Issue for next servicing release review label Sep 19, 2025
@JulieLeeMSFT JulieLeeMSFT added this to the 9.0.x milestone Sep 19, 2025
@PranavSenthilnathan
Copy link
Member

Reminder that PRs into release/9.0-staging need to be completed by 4pm Redmond time on October 13 to make it into the November servicing release. After that point you'll need to target release/9.0 if you want to make the November release.

@jkoritzinsky jkoritzinsky enabled auto-merge (squash) October 13, 2025 15:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-System.Runtime.InteropServices code-analyzer Marks an issue that suggests a Roslyn analyzer Servicing-consider Issue for next servicing release review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants