Fix CS1002: ; expected in Oxide plugins
CS1002 means the C# compiler reached the end of a statement, declaration or line and found no semicolon where one is required. Open the .cs file at the line:column shown in the console, add the missing `;`, save, and Oxide reloads the plugin automatically.
Error while compiling HelpCommand: [1] ; expected at 29:73
Why it happens
In Oxide, C# plugins are compiled by Roslyn when the file is saved or loaded. A CS1002 is reported as Error while compiling <Name>: followed by [1] ; expected at <line>:<column>, and the plugin stays unloaded until the file is fixed. The usual trigger is a statement that was never terminated: an assignment, a return, a PrintWarning(...) call, or a field declaration in a class body. It also appears when a line break sneaks in between a method call and its arguments, or when someone deletes a semicolon while joining two lines. The reported column points at the token immediately after the missing semicolon, so the actual mistake is often a few characters to the left, frequently on the line above the one quoted. A semicolon inside a string literal or a // comment does not count, and a stray character between two statements can also produce the same message.
How to fix it
- Read the console line
; expected at L:Cand open the plugin file at that line and column. Look at the end of the previous statement as well. - Add the missing
;at the end of the statement or declaration that lacks one. Field declarations inside the class body,returnvalues, and every method call need one. - Check that you did not split a single statement across lines without keeping it valid. A call like
PrintWarning("x")split asPrintWarningthen("x")on the next line is legal C#, but the statement still needs a trailing;. - Save the file. Oxide picks it up and recompiles; watch the console.
- A successful compile prints
Loaded plugin <Title> v<Version> by <Author>. Oxide never prints a success line for compilation itself, so absence of the error plus that load message is your confirmation. - If new errors appear, fix them one by one; Oxide compiles the whole file each save. Alternatively run
oxide.reload HelpCommandand read the log inoxide/logs(Carbon:carbon/logs).
Before and after
using Oxide.Core.Plugins;
namespace Oxide.Plugins
{
[Info("Help Command", "RustPluginGenerator", "1.0.0")]
[Description("Adds a chat command that prints help text")]
public class HelpCommand : RustPlugin
{
private const string PermUse = "helpcommand.use";
private void Init()
{
permission.RegisterPermission(PermUse, this);
}
[ChatCommand("help")]
private void CmdHelp(BasePlayer player, string command, string[] args)
{
if (player == null)
return;
if (!permission.UserHasPermission(player.UserIDString, PermUse))
{
SendReply(player, "You do not have permission to use this command.");
return;
}
SendReply(player, "Commands: /help");
PrintWarning("Player " + player.displayName + " used /help")
}
}
}using Oxide.Core.Plugins;
namespace Oxide.Plugins
{
[Info("Help Command", "RustPluginGenerator", "1.0.0")]
[Description("Adds a chat command that prints help text")]
public class HelpCommand : RustPlugin
{
private const string PermUse = "helpcommand.use";
private void Init()
{
permission.RegisterPermission(PermUse, this);
}
[ChatCommand("help")]
private void CmdHelp(BasePlayer player, string command, string[] args)
{
if (player == null)
return;
if (!permission.UserHasPermission(player.UserIDString, PermUse))
{
SendReply(player, "You do not have permission to use this command.");
return;
}
SendReply(player, "Commands: /help");
PrintWarning("Player " + player.displayName + " used /help");
}
}
}FAQ
The column points past the end of the line. Which semicolon is missing?
Roslyn reports the position where the expected token should have appeared, which is the end of the statement. Look at the last token on that line and the statement that started on the line before. Ninety percent of the time the fix is a single ; at the end of the previous statement.
Why does the plugin stay unloaded after I fix the file?
Oxide only reloads on save if the file watcher is running and the file is inside oxide/plugins. Run oxide.reload HelpCommand manually and check that no new compile errors appear in the console or in oxide/logs. If you saved to a different folder, copy the file back into the plugins directory.
Does Carbon show the same error?
Yes. Carbon compiles the same C# file with Roslyn and reports CS1002 with its own format, including the source line. The fix is identical: add the missing semicolon, save, and reload. Carbon accepts the standard oxide.reload command as well as its c.reload alias.
Can a semicolon error appear without a missing semicolon?
Yes, occasionally. An unbalanced quote, a stray character such as ) before a line break, or text pasted outside the class body can make the compiler expect a ; where you did not plan one. If adding a semicolon does not clear the message, check quotes and parentheses on the line above.
Different error?
Paste the full console output and get the cause and a fix in plain English.
Open the error explainerSkip the debugging
Generated plugins are compiled before you get them, and compiler errors are fixed automatically.
Generate a plugin2 free plugins a month, no card.
Last updated Oct 26, 2026.
Get plugins that compile first time
Generate