Setting up Visual Studio for Rust UMod/Oxide Development

thethingtracks
3 min readDec 24, 2021

--

Prerequisites:

Installing .NET 3.5

As far as I’m aware (and this could be wrong) we need to use the .NET 3.5 framework to develop plugins.

On Windows, open the Visual Studio Installer program. You should see your installation of Visual Studio Community 20xx listed under the Installed tab:

Click Modify, then change tab to ‘Individual Components’. In the search box, type “3.5":

Tick .NET Framework 3.5 development tools and then install them.

Referencing The .DLL files in Visual Studio

Create your new Visual Studio project:

  • Class Library (.NET Framework)
  • Framework: .NET Framework 3.5

Once loaded in, right click on ‘References’ in the Solution Explorer and ‘Add Reference’:

Navigate to the ‘Browse’ section on the right bar, then select the Browse button at the bottom. Navigate to your serverfolder/RustDedicated_Data/Managed/ folder.

Here’s a cheat sheet of which .dll files are great to start with:

Assemply-CSsharp
Facepunch.Console
Facepunch.Network
Facepunch.Rcon
Facepunch.System
Facepunch.UnityEngine
Mono.Data.Tds
MySql.Data
NewAssembly
Oxide.Core
Oxide.CSharp
Oxide.MySql
Oxide.References
Oxide.Rust
Oxide.SQLite
Oxide.Unity
Rust.Global
Rust.Localization
UnityEngine.CoreModule
UnityEngine.PhysicsModule
UnityEngine.TextRenderingModule

Finally, in the Reference Manager window, select all of the new .DLL files and select their checkboxes. Click OK:

You may get an error message saying that a reference already exists. If you do, deselect that .dll file and click OK again.

From Visual Studio To Your Server

When you have written a mod, how do you install it on your server?

Oxide/UMod features runtime compiling, which means we don’t need to build or compile our code inside Visual Studio. All we need to do is copy the .cs file across to the Oxide/UMod plugin location.

You can find the location of the .cs file by right clicking it in the Solution Explorer and selecting ‘Copy Full Path’. Paste this path into the Windows File Explorer to locate the file.

Copy this file to your server as you would for any other plugin and you’re done.

--

--