csharplang
csharplang copied to clipboard
[Proposal]: Ignored Directives Support (VS 18.0, .NET 10)
Ignored Directives Support
- Specification: https://github.com/dotnet/csharplang/blob/main/proposals/csharp-14.0/ignored-directives.md
- Discussion: https://github.com/dotnet/csharplang/discussions/8616
Summary
As we move to allow C# statements in the top level of a file, it's reasonable to assume that we might someday get support for dotnet runing a .cs file. For further use of C# as a scripting language in this vein, I propose that we introduce a new preprocessor directive who's purpose is to exist solely to be ignored by the language: the hashbang directive. Linux and Unix scripts will often use #!
Design meetings
- https://github.com/dotnet/csharplang/blob/main/meetings/2021/LDM-2021-05-12.md#simple-c-programs
- https://github.com/dotnet/csharplang/blob/main/meetings/2022/LDM-2022-08-31.md#ignored-directives-support
- https://github.com/dotnet/csharplang/blob/main/meetings/2022/LDM-2022-09-26.md#ungrouped
- https://github.com/dotnet/csharplang/blob/main/meetings/2025/LDM-2025-03-12.md#ignored-directives