Skip to content

Conversation

@agocke
Copy link
Member

@agocke agocke commented Dec 16, 2025

Clarified opt-in and opt-out mechanisms for memory safety rules in .NET 11 and 12.

Clarified opt-in and opt-out mechanisms for memory safety rules in .NET 11 and 12.
For .NET 11, the new rules are not on by default. Users will be able to opt-in to the preview by adding `#:property MemorySafetyRules=preview` to their `.cs` files.

In .NET 12, we enable the new rules by default for file-based programs. Users that wish to opt-out of the new rules can do so by adding `#:property MemorySafetyRules=1`
In .NET 12, file-based programs will behave differently from projects. We enable the new rules by default for file-based programs. Users that wish to opt-out of the new rules can do so by adding `#:property MemorySafetyRules=1`
Copy link
Member

Choose a reason for hiding this comment

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

I do not think this plan is set in stone. We will learn a ton between now and then. Should this say that this is our current aspiration?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think you nailed it: I really don't think any of our plans are set in stone. Should we just say that we don't know?

Copy link
Member

Choose a reason for hiding this comment

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

Perhaps that would be best; certainly the decisions we made at the sdk meeting were not "let's force every template to change to opt-in all new projects by default".

Copy link
Member Author

Choose a reason for hiding this comment

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

@copilot Please fix

Copy link
Contributor

Copilot AI commented Dec 16, 2025

@agocke I've opened a new pull request, #357, to work on those changes. Once the pull request is ready, I'll request review from you.

…vior (#357)

* Initial plan

* Update .NET 12 file-based programs plan to reflect uncertainty

Co-authored-by: agocke <[email protected]>

* Improve readability by breaking long sentence into shorter ones

Co-authored-by: agocke <[email protected]>

* Further improve readability with shorter sentences

Co-authored-by: agocke <[email protected]>

* Clarify that .NET 12 opt-in/opt-out behavior is undecided

Co-authored-by: agocke <[email protected]>

* Apply suggestion to clarify opt-in first, then aspiration for opt-out

Co-authored-by: agocke <[email protected]>

---------

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: agocke <[email protected]>
@agocke agocke merged commit 75e5982 into main Dec 16, 2025
3 checks passed
@agocke agocke deleted the agocke-patch-1 branch December 16, 2025 23:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants