Skip to content

Language reference and fundamentals for file based programs#46900

Merged
BillWagner merged 8 commits intodotnet:mainfrom
BillWagner:projectless-compile
Jun 30, 2025
Merged

Language reference and fundamentals for file based programs#46900
BillWagner merged 8 commits intodotnet:mainfrom
BillWagner:projectless-compile

Conversation

@BillWagner
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Member Author

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

@gewarren this is ready for review.

Comment thread docs/csharp/fundamentals/program-structure/index.md Outdated
Comment thread docs/csharp/fundamentals/program-structure/index.md Outdated
Comment thread docs/csharp/fundamentals/program-structure/main-command-line.md Outdated
Comment thread docs/csharp/language-reference/preprocessor-directives.md Outdated
Comment thread docs/csharp/language-reference/preprocessor-directives.md Outdated
Comment thread docs/csharp/language-reference/preprocessor-directives.md Outdated
Comment thread docs/csharp/tour-of-csharp/overview.md Outdated
Comment thread docs/csharp/tour-of-csharp/overview.md Outdated
Copy link
Copy Markdown
Member

@IEvangelist IEvangelist left a comment

Choose a reason for hiding this comment

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

Approving to unblock. Looks good to me, just a few things to consider.

Comment thread docs/csharp/fundamentals/program-structure/index.md Outdated
Comment thread docs/csharp/fundamentals/program-structure/index.md Outdated
Comment thread docs/csharp/fundamentals/program-structure/index.md Outdated
Comment thread docs/csharp/language-reference/preprocessor-directives.md Outdated
Comment thread docs/csharp/tour-of-csharp/overview.md Outdated
Comment thread docs/csharp/tour-of-csharp/overview.md Outdated
BillWagner and others added 2 commits June 30, 2025 10:19
Co-authored-by: Genevieve Warren <24882762+gewarren@users.noreply.github.com>
Co-authored-by: David Pine <david.pine@microsoft.com>
@BillWagner BillWagner enabled auto-merge (squash) June 30, 2025 14:24
@BillWagner BillWagner merged commit e14cd1c into dotnet:main Jun 30, 2025
8 checks passed
@BillWagner BillWagner deleted the projectless-compile branch June 30, 2025 14:32
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

4 participants