-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
dotnet-run #4326
Comments
To make this work well with the IL scenario we're going to need to be able to load dlls in place because publishing will be wayyy too slow. |
run should be default and implied. I realize this is a go compete and go syntax copy, but why not
is the same as
If you see watever.xx then run is implied. This is more like Node or Java. |
I don't really like it... Since we will be supporting all sorts of things like a folder full of source files and compiled binaries, you could get in to conflicts. What if there was a folder named I'd much rather have a consistent UI where |
+1. It also keeps the mental model very clean, dotnet itself is a wrapper around sub commands which can slice and dice as you please. |
You're not thinking about the beginners and the competition. Python, Ruby,
And @anurse, you just have rules for those few exceptions. Commands are On Tue, Oct 20, 2015 at 9:55 AM, Matt Ellis notifications@github.com
Scott Hanselman |
Having exceptions won't really be tenable when we're talking about arbitrary extensibility of the |
And matching against Python/Ruby/Java doesn't quite work here because they don't have the same kind of single unified command. Python and Ruby are interpreters, and packaging/"compilation"/etc. is all handled by other tools ( If we're OK splitting the executor from the SDK, then we can investigate that, but if we want them to be unified, they really should be well-defined and isolated. |
So if I make a little public static void main() and put it in program.cs, On Tue, Oct 20, 2015 at 3:01 PM, Andrew Stanton-Nurse <
Scott Hanselman |
Current proposal is: |
I thought the beginning of this thread said dotnet run helloworld.cs full stop. Are these equivalent? On Wed, Oct 21, 2015 at 11:42 PM, Peter Marcu notifications@github.com
Scott Hanselman |
Yeah, I think this issue is proposing a |
Again, if run is the default then I feel you're making my point for me. dotnet foo.cs The run is optional. On Thu, Oct 22, 2015 at 12:06 PM, Andrew Stanton-Nurse <
Scott Hanselman |
This needs to dump the output to a temp folder similar to go: on OSX:
It cleans up on exit as well. This preserves the magic |
We have an implementation of this and no @shanselman it doesn't take a file name. The input is a folder 😄 |
With a .csx file, you should be able to just say "dotnet run HelloWorld.csx". This needs no scaffolding of main or project.json |
Thats why overloading this command to run csx is a mistake. |
I think we need to treat C# script files as first class citizen in dotnet driver. If one wants to run a C# script file, the most intuitive way is to type run. If we force users to type "dotnet tools csi myscript.csx" then we are just making it too hard for them and .csx files won't look like first class citizens. Also running a csx files does exactly the same thing as regular run. It builds the file and then runs it. So why should it be different? |
FWIW we went through this evolution with the dnx. It was:
Run in the current folder. This required that build script cd into the target project folder to run and that was a fail.
The path was mandatory so you ended up with
Eventually we settled on an optional parameter instead of an argument. We still supported |
@davidfowl @shanselman so I'm clear. |
It would certainly work similarly. Moving forward, you'll have three main options
|
We've moved the documentation for this into the proper MD file in the repo. Will close this, reopen if needed. |
I found the below after landing on this page. Sharing in case if that helps someone:
|
dotnet-run
NAME
dotnet-run -- Runs source code 'in-place' without any explicit compile or launch commands.
SYNOPSIS
dotnet run [options]
DESCRIPTION
The run command provides a convenient option to run source code with one command. It compiles source code, generates an output program and then runs that program. This command is useful for fast iterative development and can also be used to run a source-distributed program (e.g. website).
This command relies on the compile command to compile source inputs to a .NET assembly, before launching the program. The requirements for and handling of source inputs for this command are all inhereted from the compile command. The documentation for the compile command provides more information on those requirements.
The native command uses compile in the following way:
Output files, including temporary files, are written to the child
bin
folder, which will be created if it doesn't exist. Files will be overwritten as needed.Options
-v, --verbose
Prints verbose logging information, to follow the flow of execution of the command.
The text was updated successfully, but these errors were encountered: