Skip to content

Fix incorrect C# compiler option names and broken links in documentation #47734

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Aug 5, 2025

This PR addresses several inaccuracies in the C# compiler options documentation that were causing confusion for developers:

Issues Fixed

1. TargetType → OutputType
The documentation incorrectly referenced TargetType as an MSBuild property, but the actual property used in .csproj files is OutputType. Updated all references throughout the documentation to use the correct property name that matches real-world usage:

<!-- Before (incorrect) -->
<TargetType>library</TargetType>

<!-- After (correct) -->
<OutputType>library</OutputType>

2. OutputAssembly Description Clarification
The OutputAssembly section was unclear about which MSBuild properties it actually corresponds to. Updated the description to clarify that it relates to the combination of OutputPath and AssemblyName properties, with corrected examples:

<OutputPath>bin\Debug\</OutputPath>
<AssemblyName>MyApplication</AssemblyName>

3. MainEntryPoint Property Removal
Removed references to the non-existent MainEntryPoint property from the advanced compiler options documentation. This property doesn't exist in MSBuild or Visual Studio, causing confusion when developers tried to use it.

4. StartupObject Flexibility
Fixed the documentation for StartupObject to clarify that fully qualified class names are not always required - simple class names work when unambiguous, making the documentation more accurate and developer-friendly.

5. Broken Link Fixes
Fixed broken anchor links that were created when updating property names. Multiple files had links pointing to the old #targettype anchor that needed to be updated to #outputtype:

  • Updated link references in inputs.md and security.md
  • Fixed XML property examples to use consistent naming

Cross-Reference Updates

Updated all cross-references across multiple documentation files to ensure consistency, including:

  • Error message documentation (CS0734, CS1542, CS1555, etc.)
  • F# compiler options documentation
  • Framework tools documentation
  • Internal cross-references between compiler option pages

These changes ensure the documentation accurately reflects the actual MSBuild property names and behavior that developers encounter when building .NET projects, while also maintaining working internal links.

Fixes #35950.


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


Internal previews

Toggle expand/collapse
📄 File 🔗 Preview link
docs/csharp/fundamentals/program-structure/main-command-line.md Main() and command-line arguments
docs/csharp/fundamentals/program-structure/top-level-statements.md "Top-level statements - programs without Main methods"
docs/csharp/language-reference/compiler-options/advanced.md Advanced C# compiler options
docs/csharp/language-reference/compiler-options/inputs.md "Compiler Options - input file options"
docs/csharp/language-reference/compiler-options/output.md C# Compiler Options that control compiler output
docs/csharp/language-reference/compiler-options/security.md docs/csharp/language-reference/compiler-options/security
docs/csharp/misc/cs0017.md Compiler Error CS0017
docs/csharp/misc/cs0734.md "Compiler Error CS0734"
docs/csharp/misc/cs1507.md Compiler Error CS1507
docs/csharp/misc/cs1509.md docs/csharp/misc/cs1509
docs/csharp/misc/cs1542.md Compiler Error CS1542
docs/csharp/misc/cs1555.md "Compiler Error CS1555"
docs/csharp/misc/cs1556.md Compiler Error CS1556
docs/csharp/misc/cs1557.md docs/csharp/misc/cs1557
docs/csharp/misc/cs1558.md Compiler Error CS1558
docs/csharp/misc/cs1559.md "Compiler Error CS1559"
docs/csharp/misc/cs1927.md Compiler Warning (Level 2) CS1927
docs/csharp/misc/cs2017.md docs/csharp/misc/cs2017
docs/csharp/misc/cs2019.md Compiler Error CS2019
docs/csharp/misc/cs2022.md "Compiler Error CS2022"
docs/csharp/misc/cs3012.md Compiler Warning (level 1) CS3012
docs/csharp/misc/cs3013.md docs/csharp/misc/cs3013
docs/csharp/misc/cs5001.md Compiler Error CS5001
docs/framework/tools/winmdexp-exe-windows-runtime-metadata-export-tool.md Winmdexp.exe (Windows Runtime Metadata Export Tool)
docs/fsharp/language-reference/compiler-options.md Compiler Options

Co-authored-by: BillWagner <493969+BillWagner@users.noreply.github.com>
@Copilot Copilot AI changed the title [WIP] Possibly Incorrect Names for C# Compiler Options Fix incorrect C# compiler option names in documentation Aug 5, 2025
@Copilot Copilot AI requested a review from BillWagner August 5, 2025 17:35
Copilot finished work on behalf of BillWagner August 5, 2025 17:35
@dotnet-policy-service dotnet-policy-service bot added the okr-quality Content-quality KR: Concerns article defects (bugs), freshness, or build warnings. label Aug 6, 2025
@BillWagner
Copy link
Member

@copilot address the review comments

Co-authored-by: BillWagner <493969+BillWagner@users.noreply.github.com>
@Copilot Copilot AI changed the title Fix incorrect C# compiler option names in documentation Fix incorrect C# compiler option names and broken links in documentation Aug 6, 2025
@Copilot Copilot AI requested a review from BillWagner August 6, 2025 18:19
Copilot finished work on behalf of BillWagner August 6, 2025 18:19
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.

@copilot There are several more warnings. Change the following anchors in multiple files:

  • "advanced.md#mainentrypoint-or-startupobject" should now be "advanced.md#startupobject"
  • "output.md#targettype" should now be "output.md#outputtype"

Co-authored-by: BillWagner <493969+BillWagner@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Aug 6, 2025

@copilot There are several more warnings. Change the following anchors in multiple files:

  • "advanced.md#mainentrypoint-or-startupobject" should now be "advanced.md#startupobject"
    ...

Fixed all the broken anchor links as requested. Updated all references from advanced.md#mainentrypoint-or-startupobject to advanced.md#startupobject and from output.md#targettype to output.md#outputtype across 13 files. See commit 41fcab0.

@copilot address the review comments

Addressed the review comments by fixing all broken link warnings. Updated anchor references throughout the documentation to match the corrected property names. See commit 41fcab0.

@Copilot Copilot AI requested a review from BillWagner August 6, 2025 18:59
Copilot finished work on behalf of BillWagner August 6, 2025 18:59
@BillWagner
Copy link
Member

closing and reopening for a fresh build

@BillWagner BillWagner closed this Aug 6, 2025
@BillWagner BillWagner reopened this Aug 6, 2025
@BillWagner BillWagner marked this pull request as ready for review August 6, 2025 20:24
@BillWagner BillWagner requested review from gewarren and a team as code owners August 6, 2025 20:24
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Possibly Incorrect Names for C# Compiler Options
2 participants