Skip to content
RustPluginGenerator
Runtime errorOxide + Carbon

Fix "Assembly referenced by <plugin> plugin does not exist: Oxide.Ext.Discord.dll"

Oxide refuses to load the plugin because a `// Reference:` comment in the .cs file names a DLL that is not present in RustDedicated_Data/Managed (usually Oxide.Ext.Discord.dll). Install the matching extension DLL into that folder, or drop the reference comment and the extension API calls, then reload the plugin.

Server console
Assembly referenced by DiscordLogger plugin does not exist: Oxide.Ext.Discord.dll

Why it happens

Oxide scans the top of every plugin file for // Reference: header comments and loads the named assemblies before it compiles your code. The name is resolved against the game's managed folder (RustDedicated_Data/Managed), which is where Oxide extension DLLs such as Oxide.Ext.Discord.dll ship. If the file is missing, renamed, or was never installed, the loader reports this message and the plugin is never compiled or loaded. Common triggers:

  • The plugin was copied from a site that also distributes an extension, but the DLL was not installed on the server.
  • An Oxide update replaced RustDedicated_Data/Managed with vanilla contents, deleting third-party extension DLLs.
  • A typo or wrong casing in the reference, e.g. Oxide.Ext.Discord.DLL or a path instead of the bare file name.
  • The reference is stale: the current extension is bundled differently or the plugin no longer needs it.

Carbon reads the same comments but loads its own extension copies, so a plugin can work on one framework and fail on the other.

How to fix it

  1. Stop the server or work while the plugin stays unloaded; the plugin will not load until the reference resolves.
  2. Open the plugin .cs file and read the top lines. Note every // Reference: entry, e.g. // Reference: Oxide.Ext.Discord.dll.
  3. Check whether that DLL exists in RustDedicated_Data/Managed. If the file is missing, install the version of the extension that matches your server (the Discord extension ships its own download); do not rename it.
  4. If you do not need the extension, delete the // Reference: line and every using that depends on it, plus the API calls (Discord client, message sends).
  5. If the file is present but the name differs in casing, correct the comment to match the file exactly.
  6. Run oxide.reload DiscordLogger and watch the console. Success shows Loaded plugin DiscordLogger v1.0.0 by RustPluginGenerator; the loader message disappears. Any remaining compile errors appear as Error while compiling DiscordLogger:.
  7. Never edit files inside RustDedicated_Data/Managed other than adding extension DLLs; a game update can overwrite the folder.

Before and after

BeforeFails
// Reference: Oxide.Ext.Discord.dll
using Newtonsoft.Json;
using Oxide.Core;
using Oxide.Core.Plugins;
using Oxide.Ext.Discord.Libraries;

namespace Oxide.Plugins
{
    [Info("DiscordLogger", "RustPluginGenerator", "1.0.0")]
    [Description("Logs server events to a Discord channel")]
    public class DiscordLogger : RustPlugin
    {
        private DiscordClient client;

        private void Init()
        {
            client = new DiscordClient();
            client.Initialize("bot token here");
        }

        private void OnServerInitialized()
        {
            SendChannelMessage("Server started");
        }

        private void SendChannelMessage(string text)
        {
            if (client == null) return;
            client.SendMessageToChannel("123456789", text);
        }

        private void Unload()
        {
            client = null;
        }
    }
}
AfterFixed
using System;
using System.Collections.Generic;
using Newtonsoft.Json;

namespace Oxide.Plugins
{
    [Info("DiscordLogger", "RustPluginGenerator", "1.0.0")]
    [Description("Logs server events to a Discord channel through a relay plugin")]
    public class DiscordLogger : RustPlugin
    {
        private const string PermEnable = "discordlogger.enable";

        private PluginConfig config;

        private class PluginConfig
        {
            [JsonProperty("Relay plugin name")]
            public string RelayPlugin = "DiscordMessages";

            [JsonProperty("Channel ID")]
            public string ChannelId = "000000000000000000";
        }

        protected override void LoadDefaultConfig() => config = new PluginConfig();

        protected override void LoadConfig()
        {
            base.LoadConfig();
            try
            {
                config = Config.ReadObject<PluginConfig>();
                if (config == null) throw new System.Exception();
            }
            catch
            {
                PrintWarning("Configuration file is invalid, using defaults");
                LoadDefaultConfig();
            }
            SaveConfig();
        }

        protected override void SaveConfig() => Config.WriteObject(config);

        protected override void LoadDefaultMessages()
        {
            lang.RegisterMessages(new System.Collections.Generic.Dictionary<string, string>
            {
                ["Started"] = "Server started",
                ["NoRelay"] = "Relay plugin is not loaded, message skipped"
            }, this);
        }

        private string Msg(string key, string userId = null, params object[] args) =>
            string.Format(lang.GetMessage(key, this, userId), args);

        private void Init()
        {
            permission.RegisterPermission(PermEnable, this);
        }

        private void OnServerInitialized()
        {
            SendRelay(Msg("Started"));
        }

        private void SendRelay(string text)
        {
            var relay = plugins.Find(config.RelayPlugin);
            if (relay == null)
            {
                PrintWarning(Msg("NoRelay"));
                return;
            }

            relay.Call("SendMessage", config.ChannelId, text);
        }
    }
}

FAQ

I installed Oxide.Ext.Discord.dll but still get the message. Why?

The DLL is probably in the wrong folder or the name does not match the comment exactly. It must sit directly in RustDedicated_Data/Managed, and the file name must equal the string after // Reference: character for character, including .dll. Also check you did not place it in oxide/extensions — that is not where the reference resolves.

Can I just delete the reference comment?

Yes, if nothing in the file uses the extension. Removing the comment alone leaves using directives and types that the compiler cannot find, so you will then see CS0246 errors. Delete the extension API calls and their usings together with the reference line.

Does this error stop other plugins from loading?

No. The loader skips only this file. Other plugins compile and load normally. Fix the reference, save the file, and Oxide reloads it automatically without touching the rest of the server.

The plugin worked before an update. What changed?

Game or Oxide updates can restore the original RustDedicated_Data/Managed contents, removing extension DLLs that were added manually. Reinstall the extension DLL after updates, or keep a copy in a folder outside the game directory and copy it back before starting the server.

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