Question about .NET Single File applications and CSX #120463
-
dotnet sopports in the new version single file applications, wich means you can run a .cs file directly. It also has support for some directives to include nugets, etc... But I see there is also dotnet-script. It seems to be an extra github repository, but also some support for .csx files seems to be in roslyn (see https://learn.microsoft.com/en-us/dotnet/api/microsoft.codeanalysis.sourcecodekind?view=roslyn-dotnet-4.13.0) I need a replacment for my T4 templates, and wanted to use csx (as single file cs has not yet all the features I need), but I don't get it. Is csx directly supported by microsoft? why is there a dotnet-script repository? Is it needed (if roslyn has direct support for csx)? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 11 replies
-
What features that you need do file-based apps not support?
Csx is a scripting C# format that exists for a long time, it is an official Microsoft product, but it's also a dialect of C#, and hence not very widely used. File-based apps are a modern alternative that are just being introduced in .NET 10.
That is a third party repository.
Roslyn supports csx, but there is no
Depends on what you mean by "supported". Bugs are probably going to be fixed, but new tooling investment seems unlikely to me.
Use-cases are a bit different. Csx supports interactive editing (REPL). File-based apps support converting to full projects later (thanks to not being a different C# dialect) and should be more performant and better integrated into .NET SDK tooling.
In Visual Studio as I described above. Or you can use third-party tools like Visual Studio Code and DevKit support the new file-based apps on the other hand (including debugging). |
Beta Was this translation helpful? Give feedback.
What features that you need do file-based apps not support?
Csx is a scripting C# format that exists for a long time, it is an official Microsoft product, but it's also a dialect of C#, and hence not very widely used. File-based apps are a modern alternative that are just being introduced in .NET 10.
That is a third party repository.
Roslyn supports csx, but there is no
dotnet run
command for it, that's why the third-party tool exists. You can however runcsx
files via C# Interactive window in Vi…