Skip to content

Deploy CS Script

Oleg Shilo edited this page Sep 17, 2021 · 8 revisions

Running scripts on .NET 5 and .NET Core

The CS-Script engine is distributed with the Notepad++ plugin itself. Though this embedded script engine targets .NET Framework runtime. The same runtime the plugin is running on.

This creates a problem if the user wants to run C# code targeting .NET 5/Core. Or wants to use C# syntax higher than C# 7.

Starting from version v1.7.25 you can configure the plugin to use external, not the embedded engine. And this external engine can be CS-Script version that targets .NET Core or .NET 5. The configurations steps are easy.

First, you need to install CS-Script. It is recommended to do it from Choco: https://community.chocolatey.org/packages/cs-script

choco install cs-script

After that, you can open Notepad++ and navigate to the CS-Script Settings dialog and select the "Installed CS-Script" option for the engine location:

Alternatively, you can just click "Enable .NET 5/Core integration"

Note, you can update CS-Script either from PowerShell (or command prompt) with the following command:

choco upgrade cs-script

You can also do it from Notepad++ from the "Update" tab in the Settings dialog:

Limitations:

Note, the above steps will allow you to execute C# scripts under .NET 5/Core scripts when you execute them from Notepad++. Though the built-in debugger (comes with the plugin) in this case will be disabled as it is incompatible with the .NET Core runtime.

And if you want to enable the IntelliSense for the latest C# syntax you will need to install/enable an additional CS-Script component Syntaxer