dn 0.0.4
dotnet tool install --global dn --version 0.0.4
dotnet new tool-manifest
dotnet tool install --local dn --version 0.0.4
#tool dotnet:?package=dn&version=0.0.4
nuke :add-package dn --version 0.0.4
dn
Execute .cs files without a project file.
Usage
dotnet tool install -g dn # install the tool
dotnet tool update -g dn # update the tool if already installed
code file.cs # write some C# code
dn run file.cs
When you need more features, generate a project file:
dn grow file.cs
Advanced
Path to a folder or a .cs file is accepted as the first argument (defaults to the current directory).
In either case, the whole folder is run, as if it contained a default .csproj file.
So running dn run folder/file.cs sees all folder/**/*.cs files.
When the folder already contains a .csproj file, this tool just launches dotnet run directly.
Otherwise, a temporary .csproj file is generated inside obj folder and then dotnet run is launched on that.
Command line arguments can be passed to the target program as the final arguments after dn run <path> like:
dn run file.cs arg0 arg1 arg2 ...
It is expected the folder you execute contains only .cs files.
If there are .csproj files nested somewhere deeper in the tree, an error will be raised.
That's to avoid accidentally trying to run on a solution folder, for example.
E.g., given repo/proj/proj.csproj, command dn run ./repo/ will fail.
Development
code playground/file.cs # write some code
cd src/dn
dotnet build
./bin/Debug/net9.0/dn.exe run ../../playground/file.cs
Release
dotnet pack -p:PackageVersion=<version>
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
This package has no dependencies.