You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In many programming languages like JavaScript, Python, Java, C, C++, and Go, developers can easily run single source files without creating a full project structure. However, in .NET, running a single .cs file requires setting up an entire project with multiple files and configurations.
The Pain Points
Increased friction for quick experiments
Overhead for learning and prototyping
Barrier to entry for newcomers
Time-consuming setup for simple code snippets
Potential Solutions
1. Global Tool for Single File Execution
Develop a dotnet global tool that can directly run a .cs file
Example desired syntax: dotnet run-cs MyScript.cs
2. Language-Level Support
Introduce a compiler flag or runtime option to execute single files
Similar to Python's or JavaScript's direct file execution
3. REPL Improvements
Enhance C# Interactive (csi) to more seamlessly handle standalone files
Make it more intuitive and feature-rich
Existing Partial Workarounds
Using dotnet script (community package)
Mono's C# compiler
Online REPLs
Questions for Discussion
What are the technical challenges preventing single file execution?
Are there architectural reasons for the current project-based approach?
Would a standardized solution benefit the .NET ecosystem?
Community Impact
Lower entry barrier for new developers
Faster prototyping and learning
Improved developer experience
// Current Painful Path
// Requires creating multiple files, project structure, etc.
/ Desired Simple Execution
// Imagine being able to just run: dotnet run-cs SimpleProgram.cs
//filename SimpleProgram.cs
Describe the issue or suggestion
Proposal: Simplified Single File C# Execution
Current Situation
In many programming languages like JavaScript, Python, Java, C, C++, and Go, developers can easily run single source files without creating a full project structure. However, in .NET, running a single .cs file requires setting up an entire project with multiple files and configurations.
The Pain Points
Potential Solutions
1. Global Tool for Single File Execution
dotnet run-cs MyScript.cs
2. Language-Level Support
3. REPL Improvements
Existing Partial Workarounds
dotnet script
(community package)Questions for Discussion
Community Impact
// Current Painful Path
// Requires creating multiple files, project structure, etc.
/ Desired Simple Execution
// Imagine being able to just run: dotnet run-cs SimpleProgram.cs
//filename SimpleProgram.cs
The text was updated successfully, but these errors were encountered: