Hey folks, I want to share a tip. Sublime Text is my favorite for quick scripts, text editing and doing other scripting things or anything which doesn't require a whole IDE. I love the speed too much and it is super-fast. In the process, I found that you can run C# scripts too, right from inside the Sublime Text, like you can run JavaScript. This is what I will brief you about:
Sometime back, I wrote on configuring Sublime Text for JavaScript too. Here's the link, if you want to learn:
Ok, let's start. The process is simple. You need to have an executable file, which Sublime Text will use to execute the scripts.
For C#, we will use scriptcs. Like NodeJS can run JavaScript, scriptcs runs C#. You can write and execute an Application with only one line of code.
Steps to configure Sublime Text for executing C# codes
Steps to configure Sublime Text for executing C# codes
Step 1: Install scriptcs
In order to install scriptcs, you need to have chocolatey. Chocolatey is a package manager for Windows.
In order to install scriptcs, you need to have chocolatey. Chocolatey is a package manager for Windows.
You can install it in two ways:
- Using the command prompt (cmd.exe): Run the command, given below in the console:
- @powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin
- Using Powershell : Run either of the following commandsThere's a chance you will get an error while running the script due to a Powershell Execution policy. By default, it is set to "Restricted" to prevent the harmful scripts from running. You can check the current execution policy by running "Get-ExecutionPolicy" command in Powershell.
- iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))
- iwr https://chocolatey.org/install.ps1 -UseBasicParsing | iex






NamestakenPosted Aug 11, 2019, 11:50 AM
Thanks, this is great!
Sam BriggsPosted Aug 8, 2018, 5:15 AM
I just get an error when I press CTRL + B "'scriptcs' is not recognized as an internal or external command,"
Shridhar SharmaPosted Jul 21, 2016, 6:36 AM
Worthy.gonna try it :)
Hemant MahajanPosted Jul 21, 2016, 5:11 AM
Useful and interesting!
kalu singh raoPosted Jul 21, 2016, 1:47 AM
Nice Sharing...
Ganesh SattawanPosted Jul 21, 2016, 1:13 AM
Good
Raja TPosted Jul 20, 2016, 8:04 PM
Nice, Thanks for sharing..
Ehsan SajjadPosted Jul 20, 2016, 2:17 PM
That's cool, never knew that before