Skip to content

@filipw filipw released this Aug 8, 2017 · 935 commits to master since this release

What's new

Big changes in this release - it's the largest so far!

Features

Inline Nuget packages

dotnet-script now supports inline #r directives for Nuget packages. This can be used in the following way:

#r "nuget:Automapper,5.1.1"

It is the recommended way of referencing Nuget packages in the future.

project.json references are still supported but should be avoided. Remember, that when using them, you will need to make sure you use the version of dotnet CLI that is capable of restoring them (that is, non-csproj version of dotnet CLI). You can force a specific version of dotnet CLI in a given location using global.json file.

Stand alone execution support

Instead of having to install from Nuget as .NET CLI tool, you can now download a stand alone instance of dotnet-script as ZIP and use directly. Once the distro is unzipped, you can find the entry point files: dotnet-script.cmd and dotnet-script.sh inside, which can be added to the PATH.

Once the dotnet-script folder is available the PATH, .NET CLI automatically recognizes it, and you can use the elegant dotnet script {filename.csx} command format.

Vastly improved debugging experience

Thanks to the move to Roslyn 2.3.1, debugging is much more dependable.
The debugger configuration is also much simplified. Here is the new launch.json configuration needed to debug:

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": ".NET Script Debug",
            "type": "coreclr",
            "request": "launch",
            "program": "dotnet",
            "args": [
              "exec", 
              "{PATH_TO}\\dotnet-script.dll", // from the ZIP attached to this release
              "${file}"
            ],
            "cwd": "${workspaceRoot}",
            "stopAtEntry": true
        },
        {
            "name": ".NET Script Attach",
            "type": "coreclr",
            "request": "attach",
            "processId": "${command:pickProcess}"
        }
    ]
}

Note that by using ${file} placeholder debugger automatically starts for the current file - no need to hardcode the name of the CSX in the launch.json.

Upgrade to NET Core App 1.1

The scripts now execute (and consume their inline Nuget dependencies) in the context of NET Core App 1.1.

Fixes

  • correctly set the working directory path when resolving #r and #load directives. Additionally, fixed bugs related to #load and #r resolution when running scripts using relative path
  • improved handling of platform-specific dependencies
  • suppress bogus compiler warnings (i.e. CS1701)
  • do not lock file upon running the script
  • use CommandLineScriptGlobals instead of InteractiveScriptGlobals as the globals ("host") type in the script execution context
  • correctly infer encoding for the source files when debugging
  • aligned internal script runner dependency versions and several other small build/development related fixes
Assets 3
You can’t perform that action at this time.