This tutorial provides a general step-by-step guide on setting up Visual Studio Code (VS Code) for writing C# code for Streamer.bot.
By following these instructions, you'll be able to write code with linting, which will help you catch errors early and ensure your code compiles before copying into Streamer.bot
File > Open Folder from the menu bar
Select an existing empty folder, or create a new project folder, and then select it to open:

.csproj FileExplorer view by selecting View > Explorer from the menu bar, or use the shortcut  ⇧EExplorer pane and selecting New File from the context menu:
.csproj
.csproj file:<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <TargetFramework>net481</TargetFramework>
    <LangVersion>13.0</LangVersion>
    <Nullable>enable</Nullable>
    <UseWPF>true</UseWPF>
    <DefineConstants>EXTERNAL_EDITOR</DefineConstants>
    <NoWarn>CS0114</NoWarn>
    <!-- Set the following directory with your Streamer.bot install location -->
    <StreamerBotPath>C:/path/to/streamer.bot-directory</StreamerBotPath>
  </PropertyGroup>
  <ItemGroup>
    <!-- Automatically include in every CS file -->
    <Using Include="Streamer.bot.Plugin.Interface" />
    <Using Include="Streamer.bot.Plugin.Interface.Model" />
    <Using Include="Streamer.bot.Plugin.Interface.Enums" />
    <Using Include="Streamer.bot.Common.Events" />
    <!-- Use forward slashes for cross-platform compatibility -->
    <Reference Include="$(StreamerBotPath)/Streamer.bot.Plugin.Interface.dll" />
    <Reference Include="$(StreamerBotPath)/Streamer.bot.Common.dll" />
    <Reference Include="$(StreamerBotPath)/Twitch.Common.dll" />
    <Reference Include="$(StreamerBotPath)/NAudio*.dll" />
    <Reference Include="$(StreamerBotPath)/Wpf*.dll" />
    <Reference Include="$(StreamerBotPath)/Newtonsoft.Json.dll" />
    <Reference Include="$(StreamerBotPath)/System.*.dll" />
    <Reference Include="System.Web" />
    <Reference Include="System.Net.Http" />
    <!-- Uncomment the following line to reference all dlls in the streamerbot directory -->
    <!-- <Reference Include="$(StreamerBotPath)/**/*.dll" /> -->
  </ItemGroup>
</Project>
<StreamerBotPath> xml tag to point to your Streamer.bot directory and save the file.StreamerBot.csproj.cs file automatically.NET Framework 4.8.1 project<StreamerBotPath> with the path to your own Streamer.bot directory (containing Streamer.bot.exe and .dll files)Explorer view by selecting View > Explorer from the menu bar, or use the shortcut  ⇧ECreate a new file ending with the .cs extension. This is the file we will use for our C# Code action:

Paste the C# Code Example below into your .cs file, replacing UniqueClassName with your filename
using System;
/*----- Class name should match <filename>.cs -----*/
#if EXTERNAL_EDITOR
public class UniqueClassName : CPHInlineBase
#else
public class CPHInline
#endif
/*--------------------------------------------*/
{
    public bool Execute()
    {
        // Add your code here
        return true;
    }
}
.cs NotesExecute C# Code subaction#if EXTERNAL_EDITOR preprocessor directive is set to true by the .csproj we just created, but is not active in Streamer.bot's editor.
UniqueClassName to the FileName avoids conflicts, while explicitly inheriting from CPHInlineBase, the class which provides the CPH instance all of our Streamer.bot methods belong to.CPHInline, which automatically inherits from CPHInlineBase.CPH. and it will automatically give you the available CPH methods
Streamer.bot.Plugin.Interface.dll in your Streamer.bot folder
While writing your code, you can check for compilation errors in the Problems view.
Problems panel by navigating to View > Problems or use the shortcut  ⇧MCompilation errors will be shown in red, and will prevent your code from compiling:

Warnings will be shown in yellow, but will not prevent your code from compiling:

When you code is ready to run in Streamer.bot, you can copy it into an Execute C# Code sub-action.
Actions panelExecute C# Code sub-action.cs file into Streamer.bot's C# code editor.CompileSave and Compile(are you missing an assembly reference?), click Find RefsExecute C# Code Sub-Action and is ready to run in your Action!These steps are optional, but can help speed up your workflow.
To make creating new .cs files easier, you can create a workplace snippet that will fill in the Streamer.bot C# sub-action template code for you.
Command Palette with  ⇧P and select Snippets: Configure Snippets
Select the option to create a new snippets file for the current workspace, and enter a filename like sbSnippets:

Replace the contents of your new .code-snippets file with the code below:
{
    "Execute C# Sub-Action Template" : {
    "scope": "csharp",
        "isFileTemplate": true,
        "prefix": "streamer.bot-file-template",
        "description": "New Execute C# Sub-Action for Streamer.bot",
        "body": [
            "using System;",
            "",
            "/*----- Class name should match FileName -----*/",
            "#if EXTERNAL_EDITOR",
            "public class ${TM_FILENAME_BASE} : CPHInlineBase",
            "#else",
            "public class CPHInline",
            "#endif",
            "/*--------------------------------------------*/",
            "{",
            "    public bool Execute()",
            "    {",
            "        ${0:// Add your code here}",
            "        return true;",
            "    }",
            "}"
        ]
    }
}
sbfile, and selecting the streamer.bot-file-template from the dropdown, or by running Snippets: Fill File with Snippet from the Command Palette