Skip to content
RustPluginGenerator
Runtime errorOxide + Carbon

Fix "Plugin filename killrewards.cs must match the main class KillRewards" in Oxide

Oxide requires the .cs file name to be the class name with exactly the same spelling and letter case. Rename the file (or the class) so they are identical, then reload.

Server console
Plugin filename killrewards.cs must match the main class KillRewards (should be KillRewards.cs)

Why it happens

Oxide derives the plugin name from the file name, then looks for a class of the same name inside namespace Oxide.Plugins that inherits RustPlugin. When the file is killrewards.cs but the class is KillRewards, the names differ, the lookup fails and the loader refuses to load the plugin. The comparison is case-sensitive, so Killrewards.cs, killRewards.cs and KillRewards.cs.bak.cs all produce this message. The same mismatch appears after a rename inside the plugin itself: you update the class to KillRewards but keep the old file name, or copy a plugin file and rename only one of the two. On Linux hosts the filesystem is also case-sensitive, so a file uploaded as killrewards.cs will not be found under a path that uses capitals. Carbon prints a similar message when loading the same file.

How to fix it

  1. Decide on the final class name; use PascalCase, e.g. KillRewards.
  2. Rename the file so the file name (without .cs) is exactly that string: KillRewards.cs. Do not leave .bak, .old or a second extension in the name — Oxide loads every .cs file in oxide/plugins.
  3. Confirm the class declaration inside the file reads public class KillRewards : RustPlugin and sits in namespace Oxide.Plugins.
  4. Upload the renamed file and delete the old one, so only one copy remains in oxide/plugins.
  5. Run oxide.reload KillRewards (or restart the server). The console must print Loaded plugin KillRewards v1.0.0 by RustPluginGenerator and no loader message. If you want to keep the old file name, rename the class instead — the two must match; there is no setting to override it.

Before and after

BeforeFails
// File on disk: oxide/plugins/killrewards.cs
using Oxide.Core.Plugins;

namespace Oxide.Plugins
{
    [Info("Kill Rewards", "RustPluginGenerator", "1.0.0")]
    [Description("Sends a chat message to a player when they kill another player")]
    public class KillRewards : RustPlugin
    {
        private void OnEntityDeath(BaseCombatEntity entity, HitInfo info)
        {
            if (entity == null || info == null) return;

            BasePlayer victim = entity as BasePlayer;
            if (victim == null) return;

            BasePlayer killer = info.InitiatorPlayer;
            if (killer == null || killer == victim) return;

            killer.ChatMessage("You killed " + victim.displayName);
        }
    }
}
AfterFixed
// File on disk: oxide/plugins/KillRewards.cs
using Oxide.Core.Plugins;
using UnityEngine;

namespace Oxide.Plugins
{
    [Info("Kill Rewards", "RustPluginGenerator", "1.0.0")]
    [Description("Sends a chat message to a player when they kill another player")]
    public class KillRewards : RustPlugin
    {
        private void OnEntityDeath(BaseCombatEntity entity, HitInfo info)
        {
            if (entity == null || info == null) return;

            BasePlayer victim = entity as BasePlayer;
            if (victim == null || victim.IsNpc) return;

            BasePlayer killer = info.InitiatorPlayer;
            if (killer == null || killer == victim || killer.IsNpc) return;

            killer.ChatMessage("You killed " + victim.displayName);
        }
    }
}

FAQ

Does lower case everywhere work?

No. killrewards.cs with class killrewards would satisfy the name check but violates the C# convention Oxide plugins use, and the permission prefix would be killrewards. instead of a readable name. Use PascalCase for both: file KillRewards.cs, class KillRewards.

Why does it work on Windows and fail after upload?

Windows keeps letter case but ignores it when opening files, while Linux treats killrewards.cs and KillRewards.cs as different files. A file saved with the wrong case loads on a local Windows test server but fails the name check or goes missing on a Linux host.

I renamed the file and it still shows the old name.

A second copy is still in oxide/plugins. Oxide loads each .cs separately, so a leftover killrewards.cs.bak or a plugin in a subfolder can keep raising the same message. Run oxide.plugins to list what is loaded and delete the stale file.

Does the class namespace matter?

Yes. The class must be declared inside namespace Oxide.Plugins. A class with the right name in another namespace is not seen by the loader, and you get a different message: unable to find the main plugin class.

Different error?

Paste the full console output and get the cause and a fix in plain English.

Open the error explainer

Skip the debugging

Generated plugins are compiled before you get them, and compiler errors are fixed automatically.

Generate a plugin

2 free plugins a month, no card.

Last updated Oct 26, 2026.

Get plugins that compile first time

Generate