-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Description
I recently looked into the .NET 10 preview, which introduces a feature that allows running a single .cs file. I tried using it by enabling the setting:
"dotnet.projects.enableFileBasedPrograms": true
I didn't see any benefit of enabling this in settings json for vs code stable release. I tried to use the terminal to run a single .cs file. I am able to see the result by running dotnet run program.cs
My question is, is it possible to import other .cs file? for example in python I can do something like from filename import this_is_my_method
As I see some experiment of dotnet team in past, like c# interactive window or xamarin notebook etc. I tried to experiment like
#r using abc.cs
I tried to do it different way. I tried even have a namespace in second .cs file (which doesn't make sense, otherwise someone will create fully-fledged project)
Is there a way, developer is allowed to import other .cs file into current .cs file and call the method. I am thinking to use this feature to write some autoamation script like I have done in python.
In python I write some code, for make it simple I divide into files and import the file in one and run it, for testing I can debug it and it's good to just write and debug. Is this already exist in roadmap or dotnet team has plan to implement it?
Would like to know more about how c# tooling will help to write code similar way I can do in python?