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

[release/9.0-staging] Fix C++/CLI applications which use __declspec(appdomain) #110495

Merged

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Dec 6, 2024

Backport of #110367 to release/9.0-staging

/cc @davidwrighton

Customer Impact

  • Customer reported
  • Found internally

See issue #110365. Essentially this broke a customer which had C++/CLI existing code which explicitly specified that a particular variable should be given appdomain lifetime. It also requires running a debug build of the C++/CLI code.

Regression

  • Yes
  • No

This was introduced in .NET 9 as part of the statics rewrite.

Testing

A new test covering this specific scenario was added to the test suite. It was not found earlier due to a lack of an extensive C++/CLI test suite being available, and what limited testing that happened did not happen to cover this scenario.

Risk

Low risk. The fix simply defers statics intialization to a somewhat later time. This deferral is what normally happens for static variables, and is only not deferred in cases where we want the static variables visible to the debugger, so adding another case which will defer the static variable will have a very small impact on the view of this data in the debugger.

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.

…bly in use. This avoids possible recursive loading issues found in C++/CLI codebases. Repurpose the NativeCallingManaged test to subsume this particular regression test case.

Fix #110365
Copy link
Contributor

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

@davidwrighton davidwrighton self-assigned this Jan 8, 2025
@jeffschwMSFT jeffschwMSFT added the Servicing-consider Issue for next servicing release review label Jan 8, 2025
@jeffschwMSFT jeffschwMSFT added this to the 9.0.x milestone Jan 8, 2025
Copy link
Member

@jeffschwMSFT jeffschwMSFT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm. we will take for consideration in 9.0.x

@jeffschwMSFT jeffschwMSFT added Servicing-approved Approved for servicing release and removed Servicing-consider Issue for next servicing release review labels Jan 8, 2025
@jeffschwMSFT jeffschwMSFT modified the milestones: 9.0.x, 9.0.2 Jan 8, 2025
@jeffschwMSFT jeffschwMSFT merged commit 5b8b063 into release/9.0-staging Jan 8, 2025
10 checks passed
@jkotas jkotas deleted the backport/pr-110367-to-release/9.0-staging branch January 8, 2025 19:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-Interop-coreclr Servicing-approved Approved for servicing release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants