Cross-platform .NET Module/Plugin platform for Garry's Mod powered by .NET Core.
Gmod.NET is Garry's Mod Module/Plugin loader for C# and other .NET languages which runs across all platforms (Windows, Linux, Mac Os). Gmod.NET allows you to develop cross-platform Garry's Mod extensions without need to close or reload your game or server.
GmodNET provides functionality to write Garry's Mod modules in C# or any other CIL-compiled language as .NET Core 3.1 class libraries. For more information on modules and API check out project's wiki. Only
x86_64 version of Garry's Mod is currently supported.
Building and contributing
To build GmodDotNet you need to have following software installed and registered with your PATH environment variable:
Latest version of git
Latest version of CMake
Latest version of dotnet SDK
(On Windows) Latest version of Visual Studio 2019 with C++ package
(On macOS) Latest version of Xcode
(On Linux) Latest versions of make and gcc (or clang)
Clone this git repository (building outside of git repository is not supported)
In the root of the cloned repository run
dotnet build runtime.csproj -c Debugor
dotnet build runtime.csproj -c Releaseinstruction in your command prompt.
runtime.csproj is not a real C# project file but a kind of build script. To work with the managed part of GmodDotNet open
gm_dotnet_managed/gm_dotnet_managed.sln solution file in your IDE instead.
runtime.csproj build script will produce following folders in the root of repository:
buildfolder contains the full build of GmodDotNet runtime (both native and managed). The content of this folder should be copied to
Modulesfolder contains tests suit. To run tests this folder should be copied to
You may also want to copy the content of
lua folder to the corresponding destinations in
Gmod.NET is subdivided into three subprojects.
Garry's Mod binary native module and helper libraries are
gm_dotnet_native folder and organized as CMake project.
Managed part is contained in
gm_dotnet_managed folder and organized with .NET soultion file
Bootstrap Lua scripts are contained in
Installation and usage
Download latest build from the project's releases page.
Unpack archive for your OS to the
Download and copy
Download and copy
Place your .NET module, ...deps.json file, and all dependencies in
If you signed your module with GmodNetModuleSigner, copy
[name_of_your_module].modulesignto the same folder as above (
If you want your module to be serverside (clientside) only then add file
gmod_net_load_all_clfor client-side) console command to load all managed modules and
gmod_net_unload_all_cl) to unload them. Modules can be hot-reloaded, so one doesn't need to quit game to see changes.
Whole project is licensed under MIT License.
Dependencies and code usage
Gmod.NET is making use of or borrows code from the following projects:
See other copyright notices in the NOTICE file.