Skip to content

.NET 9 Unsafe Study #94941

Closed
Closed

Description

@AndyAyersMS

In .NET 9 we plan to study the use of unsafe constructs within the BCL, to better assess the risks they incur and benefits they provide. The aim of this study is to ensure we are making responsible use of unsafe.

The scope and outcome of this study is not yet determined, but may include things like:

  • Modernizing the definition of “unsafe” (or unsafe-equivalent) code
  • Guidelines for introduction of new unsafe code in the BCL, and possibly guidelines for general .NET development
  • Identification of existing unsafe code that can be replaced with safe equivalents
  • API changes or additions to avoid the need to rely on unsafe constructs
  • Recommendations for new or improved JIT optimizations to widen the set of unsafe code that can be replaced
  • Tooling to track the aggregate amount of unsafe code
  • The possibility of using source generators to “safely” generate unsafe code

Initially we will be gathering data about overall usage (and how it has changed over time) and doing case studies of code that uses unsafe constructs. As the study progresses, we will update this issue to keep track of interim findings, examples, discussions, proposals, and eventually, plans and work items.

.NET 10 Work

Misc:

Activity

  1. added
    User StoryA single user-facing feature. Can be grouped under an epic.
    on Nov 17, 2023
  2. added this to the 9.0.0 milestone on Nov 17, 2023
  3. jeffhandley commented on Jul 28, 2024

    @jeffhandley
    Member

    @AndyAyersMS I know we made some progress on this in 9.0.0. I'm going to move this to 10.0.0 to keep the effort going.

  4. modified the milestones: 9.0.0, 10.0.0 on Jul 28, 2024
  5. self-assigned this
    on Jan 13, 2025
  6. EgorBo commented on Jul 16, 2025

    @EgorBo
    Member

    Moving to 11 milestone where the main work will happen.

  7. modified the milestones: 10.0.0, 11.0.0 on Jul 16, 2025
  8. moved this to Team User Stories in .NET Core CodeGenon Jan 12, 2026
  9. EgorBo commented on Jul 9, 2026

    @EgorBo
    Member

    Let's close it as we no longer track anything with this issue

  10. moved this from Team User Stories to Done in .NET Core CodeGenon Jul 9, 2026
  11. locked and limited conversation to collaborators on Aug 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions