|
|
|
|
|
by janjones
366 days ago
|
|
> You can't do much of anything in .NET without referencing Nuget assemblies. And referencing NuGet assemblies is of course supported via the #:package directive. It's just that referencing DLLs directly is not a common scenario, hence it's not supported for now (but can be added later). > Agreeing with others, '#r "nuget:' should at least be an option. Thanks, we hear you and plan to add support for it, see https://github.com/dotnet/sdk/issues/49199 > And otherwise (but I guess regarless if you stick with this syntax) you will have to add another tab to Nuget called "dotnet run". "Script & Interactive" is already present in Nuget and shows the #r syntax for a reference. Agree but also note that the ".NET CLI" tab which tells you to run "dotnet add package" should also work in near future, see https://github.com/dotnet/sdk/issues/49200. |
|
This statement is a bit confusing. From a user perspective, "dotnet run" does add a new scripting dialect. I would like to rewrite all my csx utilities to use this.
I've been using dotnet-script for several years for both unit testing code and for creating small utilities. Being able to load scripts (with "#load - see below) from other scripts is a core feature for keeping my code DRY. It would be a knock against "dotnet run" if a comparable syntax was not available. It's just a preprocessor - not a change to the C# syntax. Just like the other '#:' preprocessors being added.
I propose "#:load file.cs"
https://github.com/dotnet-script/dotnet-script#consuming-a-s...