GithubHelp home page GithubHelp logo

csx's Introduction

csx

A super simple C# script runner for .Net Core with debug and NuGet support.

Installing

choco install csx --source https://www.nuget.org/api/v2

Visual Studio Code

Intellisense for C# script files is provided by OmniSharp

There is still an open pull request that enables intellisense for scripts with NuGet references.

Until that PR gets merged, download this prebuilt version of OmniSharp that you can use to enable this functionality.

Note: Any editor can be used to edit script files, but we need VS Code to be able to debug.

Windows

Simply extract the OmniSharp.zip file anywhere on your drive and update VS Code settings.

{
"omnisharp.path": "PATH_TO_OMNISHARP_FOLDER/Omnisharp.exe"
}

Hello World

Create a new folder somewhere and from within that folder issue the following command.

csx init

This command creates 4 files

Name
.vscode/tasks.json Enables the script to be executed within VS Code.
.vscode/launch.json Configures script debugging
omnisharp.json Enables NuGet references in scripts (Intellisense)
helloworld.csx A minimal script that outputs "Hello world!" to the console.

Note: Only the actual script file is needed for script execution. Other files are just for VS Code awesomeness.

Running the script

Command Line

csx helloworld.csx
Hello world!

VS Code

Ctrl+Shift+B or "Debug->Start Without Debugging "

Debugging

Set a breakpoint anywhere in your code and hit F5

NuGet

In addition to referencing other scripts using the #load directive we can also reference NuGet packages.

#r "nuget:AutoMapper,6.0.0"

csx's People

Contributors

seesharper avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.