Skip to content

Fix Deterministic compiler option default value documentation #47725

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

Merged
merged 2 commits into from
Aug 6, 2025

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Aug 4, 2025

The documentation for the Deterministic C# compiler option was misleading about the default behavior. The previous text stated "By default, compiler output from a given set of inputs is unique, since the compiler adds a timestamp and an MVID..." which implied that deterministic compilation was disabled by default.

However, for modern .NET projects (including MAUI projects as mentioned in the issue), the .NET SDK actually sets Deterministic=true by default. This was causing confusion for developers who expected the default to be false based on the documentation.

Changes Made

  • Explicitly state the default value: Added clear language that deterministic compilation is enabled by default for modern .NET projects (Deterministic property defaults to true)
  • Clarify when deterministic vs non-deterministic compilation occurs: Separated the explanation to clearly distinguish between the default behavior (deterministic) and what happens when explicitly disabled
  • Maintain technical accuracy: Preserved all the detailed information about what inputs affect determinism while restructuring for clarity

Validation

Tested with actual .NET projects to confirm:

  • Default behavior: Deterministic = true (confirmed in build output)
  • Explicit override: <Deterministic>false</Deterministic> works as expected
  • Multi-target projects (MAUI-style): Also default to true

This ensures the documentation accurately reflects the actual SDK behavior that developers experience.

Fixes #33380.


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.


Internal previews

📄 File 🔗 Preview link
docs/csharp/language-reference/compiler-options/code-generation.md docs/csharp/language-reference/compiler-options/code-generation

@dotnet-policy-service dotnet-policy-service bot added the okr-quality Content-quality KR: Concerns article defects (bugs), freshness, or build warnings. label Aug 4, 2025
Co-authored-by: BillWagner <493969+BillWagner@users.noreply.github.com>
@Copilot Copilot AI changed the title [WIP] Deterministic default is not false for MAUI projects Fix Deterministic compiler option default value documentation Aug 4, 2025
@Copilot Copilot AI requested a review from BillWagner August 4, 2025 20:09
Copilot finished work on behalf of BillWagner August 4, 2025 20:09
Copy link
Member

@BillWagner BillWagner left a comment

Choose a reason for hiding this comment

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

This is ready for final review.

@BillWagner BillWagner marked this pull request as ready for review August 5, 2025 14:30
@BillWagner BillWagner requested a review from a team as a code owner August 5, 2025 14:30
@BillWagner BillWagner requested a review from tdykstra August 5, 2025 14:30
@BillWagner
Copy link
Member

@baronfel Do you want to give this one a look?

Copy link
Member

@baronfel baronfel left a comment

Choose a reason for hiding this comment

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

This LGTM!

@BillWagner BillWagner merged commit 07934ac into main Aug 6, 2025
14 checks passed
@BillWagner BillWagner deleted the copilot/fix-33380 branch August 6, 2025 14:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dotnet-csharp/svc lang-reference/subsvc okr-quality Content-quality KR: Concerns article defects (bugs), freshness, or build warnings.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Deterministic default is not false for MAUI projects
3 participants