CounterStrikeSharp Compiler Online
Compile CounterStrikeSharp plugins online for free. Single .cs file or a full .csproj - cloud build, download a ZIP for your CS2 server.
Frequently asked questions
What is the CounterStrikeSharp compiler and what does it build?
CounterStrikeSharp (often shortened to CS#) is the C# plugin API for Counter-Strike 2 dedicated servers. This page runs "dotnet publish" in the cloud so you can build a plugin without installing the .NET SDK, NuGet, or a local CounterStrikeSharp workspace. Single mode compiles one .cs file. Project mode accepts a ZIP with a .csproj and multiple sources. The output is a ZIP you extract into addons/counterstrikesharp/plugins. It does not compile AMXX .sma or SourceMod .sp files.
Do I need the .NET SDK or Visual Studio on my PC?
No. XCSTRIKE restores NuGet packages and publishes the plugin on the server. You need a browser and your source. On the CS2 machine you still need CounterStrikeSharp itself installed (Metamod + the CounterStrikeSharp runtime). After a successful build, extract the ZIP into the plugins folder and change the map so the plugin loads. If the API version in the dropdown is newer than the CounterStrikeSharp build on the game server, the plugin may fail to load - match the API your server already uses.
How should I choose the CounterStrikeSharp API version?
Pick the CounterStrikeSharp.API version that matches the runtime in addons/counterstrikesharp on your CS2 server (the same number you would put in a local .csproj PackageReference). Newer API packages can require a newer shared runtime. If a build succeeds here but the dedicated server refuses the DLL, lower the API version to the one shipped with your CounterStrikeSharp install, or update CounterStrikeSharp on the game server first.
When do I use Single mode versus Project mode?
Single mode is for one plugin class in a single .cs file. Project mode is for solutions with several files, your own .csproj, or extra assets. Upload a ZIP that contains the .csproj at a reasonable depth; huge archives are rejected (size and file-count limits apply). Project builds count as two toward the hourly rate limit (20 builds per hour). Downloads expire after one hour, so save the ZIP locally.
Where do I install the ZIP on a CS2 server?
Extract it under addons/counterstrikesharp/plugins so the plugin folder contains the DLL and any configs the build produced. Restart the map or the server. The compiler is free. If you are writing GoldSrc AMXX or CS:GO SourceMod plugins, use those compilers instead - CounterStrikeSharp is CS2 only.
Common CounterStrikeSharp build errors and how to fix them
CounterStrikeSharp plugins are normal .NET projects, so build errors use the standard C# and NuGet codes. These are the ones that come up most when building CS2 plugins.
CS0246: The type or namespace name "BasePlugin" could not be found
A using directive or a package reference is missing. Add using CounterStrikeSharp.API.Core; (and the other CounterStrikeSharp namespaces you use), and if the type comes from another NuGet package, add a PackageReference for it to the .csproj.
CS1061: "CCSPlayerController" does not contain a definition for "Health"
The member does not exist on that type (health, for example, lives on the player pawn, not on the controller), or it is not in the CounterStrikeSharp version you are building against. The API changes between releases, so code copied from an older plugin may use renamed members. Match the CounterStrikeSharp.API package version to the one installed on your server.
CS0103: The name "playerCount" does not exist in the current context
A variable or method is used outside its scope, or misspelled. C# is case-sensitive: OnPlayerConnect and onPlayerConnect are different names.
NU1101: Unable to find package "CSSharp.API"
The package name in the .csproj is wrong or the version does not exist on NuGet. Check the exact package ID and version on nuget.org.
CS8618: Non-nullable property must contain a non-null value
A warning from nullable reference types, not an error. Initialise the property, mark it nullable with ?, or disable <Nullable> in the .csproj. The plugin still builds.
Plugin builds but does not load on the server
The .dll must sit in addons/counterstrikesharp/plugins/<PluginName>/<PluginName>.dll, with the folder and file names matching. Also check that the plugin class inherits BasePlugin and that the server runs a CounterStrikeSharp version compatible with the one you built against.
No error in this list matches. Check the compile log for the exact code (for example error 017) and search for that.
CounterStrikeSharp Online Compiler
Welcome to the CounterStrikeSharp Web Compiler, the easiest way to build CS2 plugins without installing the .NET SDK on your computer. With this tool, you can compile everything from a single .cs file to complex, multi-file projects using a .csproj archive right in your browser. Just upload your code, select the target CounterStrikeSharp API version, and start the build process.
Our cloud infrastructure runs dotnet publish pulling the correct dependencies directly from NuGet. Within seconds, it packages your compiled binaries, configuration files, and assets into a clean ZIP archive. All you have to do is download the ZIP, extract it directly into your addons/counterstrikesharp/plugins/ directory on your Counter-Strike 2 server, and restart the map.
Supported versions
- CounterStrikeSharp API 1.0.367
- CounterStrikeSharp API 1.0.364
- CounterStrikeSharp API 1.0.355
- CounterStrikeSharp API 1.0.340
Limits
- Max source size: 512 KB (single) / 12 MB ZIP (project)
- Downloads expire after 1 hour
- Rate limit: 20 builds per hour (project builds count as 2)
