Thanks to visit codestin.com
Credit goes to github.com

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

Merged
merged 8 commits into from
Jun 30, 2025

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.

Copy link
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.

BillWagner and others added 2 commits June 30, 2025 10:19
Co-authored-by: Genevieve Warren <[email protected]>
Co-authored-by: David Pine <[email protected]>
@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