Skip to content

Language reference and fundamentals for file based programs #46900

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 6 commits into
base: main
Choose a base branch
from

Conversation

BillWagner
Copy link
Member

@BillWagner BillWagner commented Jun 19, 2025

Fixes #46498

  • Publish the C# speclet for ignored preprocessor directives, and make the updates for the ignored directives used for file based programs.
  • Update the articles in the fundamentals and get started sections so they describe file-based programs.

Note: The snippets5000 failure is because our CI build system looks for a csproj file. Without one, the CI build fails. However, these programs don't need a csproj file. However, they must be contained in one single .cs file.


Internal previews

📄 File 🔗 Preview link
docs/csharp/fundamentals/program-structure/index.md General Structure of a C# Program
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/preprocessor-directives.md C# preprocessor directives
docs/csharp/specification/toc.yml docs/csharp/specification/toc
docs/csharp/tour-of-csharp/overview.md A tour of the C# language

First commit: Publish the C# speclet for ignored preprocessor directives, and make the updates for the ignored directives used for file based programs.
And, set +x permissions on hello-world.cs
Include a description and small example of a file based program in the overview of the general structure of a C# program.
Add a brief description of file based programs in the command line section.
@BillWagner BillWagner marked this pull request as ready for review June 23, 2025 17:13
@BillWagner BillWagner requested a review from a team as a code owner June 23, 2025 17:13
@BillWagner BillWagner requested a review from gewarren June 23, 2025 17:13
@BillWagner
Copy link
Member Author

@adegeo This is the first PR that will use file-based-programs, those that are built without a .csproj file.

@BillWagner BillWagner closed this Jun 25, 2025
@BillWagner BillWagner reopened this Jun 25, 2025
@BillWagner
Copy link
Member Author

Closed and reopened to verify @adegeo 's fix for single file programs.

@gewarren this is ready for 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.

[C# 14-Fundamentals and reference]: New Feature - Projectless compile
2 participants