Skip to content

Update CS0433 documentation to prioritize extern alias over csc compiler options #47307

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
Jul 15, 2025

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Jul 14, 2025

Updates the CS0433 compiler error documentation to emphasize modern extern alias solutions over direct csc compiler usage, addressing feedback that the current guidance prioritizes outdated approaches.

Changes Made

  • Updated main guidance to recommend extern alias with project reference aliases as the primary solution
  • Added structured step-by-step instructions with clear "Step 1" and "Step 2" sections for implementing the fix
  • Modernized code examples to show dotnet build as the primary compilation method while keeping csc options as secondary
  • Fixed typo in class name reference (AggPubImpAddPubImpAggPubImpAggPubImp)
  • Improved code comments to accurately identify which assembly provides each type instance

Before

The documentation led with compiler option approaches and buried the extern alias solution without clear implementation steps.

After

The documentation now:

  1. Presents extern alias as the recommended approach for modern .NET projects
  2. Provides clear, actionable steps for implementing the solution
  3. Maintains backward compatibility by keeping compiler option information available
  4. Uses modern tooling (dotnet build) in examples while preserving legacy csc information

This makes the documentation more relevant for current .NET development practices while ensuring developers can still find information about direct compiler usage when needed.

Fixes #26528.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.


Internal previews

📄 File 🔗 Preview link
docs/csharp/language-reference/compiler-messages/cs0433.md docs/csharp/language-reference/compiler-messages/cs0433

@dotnet-policy-service dotnet-policy-service bot added the okr-quality Content-quality KR: Concerns article defects (bugs), freshness, or build warnings. label Jul 14, 2025
@Copilot Copilot AI changed the title [WIP] Update "how to fix CS0433" to use extern alias (and add any extra needed steps) Update CS0433 documentation to prioritize extern alias over csc compiler options Jul 14, 2025
@Copilot Copilot AI requested a review from BillWagner July 14, 2025 19:20
Copilot finished work on behalf of BillWagner July 14, 2025 19:20
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 LGTM. It's ready for final review

@BillWagner BillWagner marked this pull request as ready for review July 15, 2025 14:52
@BillWagner BillWagner requested a review from a team as a code owner July 15, 2025 14:52
@BillWagner BillWagner requested a review from IEvangelist July 15, 2025 14:52
@IEvangelist IEvangelist merged commit 38ac9aa into main Jul 15, 2025
21 checks passed
@IEvangelist IEvangelist deleted the copilot/fix-26528 branch July 15, 2025 17:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
csharp-diagnostics/subsvc 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.

Update "how to fix CS0433" to use extern alias (and add any extra needed steps)
3 participants