Why Your CounterStrikeSharp Plugin Is Not Loading
A successful compile only proves the code is valid. Whether the server actually loads the plugin depends on the server itself: Metamod, the CounterStrikeSharp version, where the files were copied and what the plugin needs to run. Work through the checks below in order, because the first ones are the most common.
Check that CounterStrikeSharp itself is running
Before blaming the plugin, make sure the framework is alive. Type meta list in the server console. You should see CounterStrikeSharp in the list. If it is missing, the problem is the installation of Metamod or CounterStrikeSharp, not your plugin. Our Metamod setup guide covers that part.
meta list
Read the error in the console
When a plugin fails, the console prints which plugin failed and why. An <ERROR> entry in the plugin list means the file was found but could not be loaded. Copy the whole message, not only the first line, because the real reason is usually a few lines lower.
[META] Failed to load plugin addons/counterstrikesharp/bin/linuxsteamrt64/counterstrikesharp
Listing 1 plugin:
[01] <ERROR>
The server was updated and everything stopped working
After a Counter-Strike 2 update, CounterStrikeSharp and Metamod often need an update too, because the game files they hook into changed. If every plugin broke at the same moment, this is the cause. Update CounterStrikeSharp and Metamod to their latest versions and restart the server. Our guide on updating CounterStrikeSharp shows the safe way to do it.
See what the server thinks is installed
Run css_plugins list in the console. It shows every plugin the framework found, with its state. If your plugin is not listed at all, the files are in the wrong place or the folder name does not match the DLL name. If it is listed but shows an error, go back to step two and read the message.
css_plugins list
Check the folder layout
Each plugin needs its own folder inside plugins, and the main DLL must have exactly the same name as that folder. The extra files next to it, such as the deps.json, should stay together with the DLL.
Copy only the plugin folder, not dependencies
Our compiler puts two things in the zip: the plugin folder and a dependencies folder. Copy only the plugin folder to your server. The dependencies folder contains files that CounterStrikeSharp already provides, and copying them over can cause version conflicts.
Plugins that need heavy frameworks or a different API version
A plugin that was written for an older CounterStrikeSharp.API can compile and still fail on a newer server, or the other way around. If the console mentions a missing method or a missing type, the API versions do not match. Our version mismatch guide explains which compile option to choose. Also keep in mind that large frameworks such as ASP.NET are not supported inside a game server plugin.
What to include when you ask for help
If you still cannot solve it, ask the plugin author or the CounterStrikeSharp community, and include: the output of meta list and css_plugins list, the full error from the console, the CounterStrikeSharp version, and the way you compiled the plugin. With that information most problems are answered in one reply.
Was this tutorial useful?
Barlap for the community.