question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`dotnet script` making C# / f# a script language

See original GitHub issue
dotnet script --lang c# --langversion 7.2
C#>Console.WriteLine("hello world")
"hello world"
C#> import "./myCSharpScript.csx"; // or require("./myCSharpScript.csx")   or import {MyStaticFunctions} from "./myCSharpScript";
C#> MyStaticFuntions.Sayhello("john")
"hello,john"

Making C# a script language and give it a environment

Other feature need in script environment

  1. Definition file (like typescript for example “Cake.csd”) [editor feature]
  2. import/require to import a script
  3. nuget and dll file suport (“#r #nuget better to use an keywork making it more like scripting”)

I really hope that I can easily run C# scripts outside visual studio

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:4
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
dasMullicommented, Jul 15, 2018

fyi https://github.com/filipw/dotnet-script already implements C# scripting and even has a few more features than roslyn’s csi

0reactions
livarcocccommented, Mar 8, 2019

I would say ask on the roslyn issue: dotnet/roslyn#17666.

Actually, I am going to close this issue against that one.

Read more comments on GitHub >

github_iconTop Results From Across the Web

C# and .NET Core scripting with the "dotnet-script" global tool
The 'new' command will create all the supporting code, obj, and bin folders ... C:\Users\scott\Desktop\scriptie>dotnet script helloworld.csx.
Read more >
Writing C# build scripts with FAKE, OmniSharp and VS Code
In this blog post I'd like to show an extremely - in my opinion - productive way of writing build scripts using C#....
Read more >
dotnet-install scripts - .NET CLI
The dotnet-install scripts perform a non-admin installation of the .NET SDK, which includes the .NET CLI and the shared runtime.
Read more >
Use C# as a Scripting language — in VSCode! | by ilias shaikh
Scripting engine​​ C# can be used as a scripting language using the compiler services from Roslyn. This has existed since Visual Studio 2015 ......
Read more >
C# Scripting using dotnet-script - Elliot DeNolf
First, test that your script is functioning by running ./main.csx on your command line. You should see the Hello World! output. Windows machines ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found