This page describes how to make your own custom modification using Visual Studio.
You're looking to create a mod for Nitrocid KS! That's great! Make sure that you have Visual Studio installed. Follow the steps to create your first mod.
1
Create a new project
Press Create a new project on Visual Studio homepage
2
Create a class library
Find Class Library and double-click it
3
Name your mod
Write your mod name, like in our example, MyFirstMod.
4
Use the supported framework
Make sure that .NET 10.0 is used. Press Create.
5
Install Nitrocid.Base
Right-click on Dependencies -> Manage NuGet Packages, find Nitrocid.Base, and install it.
6
Open the class file
Once the package is installed, go to the Class1.cs source file
7
Prepare the class
Write next to the class file : IMod and import the required namespace by using Nitrocid.Base.Kernel.Extensions;. You should see errors indicating that you have to implement the methods.
After implementation, you should see:
8
Configure your mod
Remove all calls to NotImplementedException, set the Version property to a SemVer 2.0-compliant version, and set the minimum supported API version.
You can check the API version by executing the Nitrocid executable with --apiversion.
9
Build your mod once done
Now, implement everything as you wish. Once you're done, follow the steps on how to create a strong name signing key and sign your mod. Then, click on the Build menu and select Build Solution.
10
Open the output folder
Once the solution is built, open the file explorer to the solution directory by right-clicking on the solution and selecting Open Folder in File Explorer.
11
Copy the mod
Navigate to the output directory and copy the .dll file to KSMods under the %localappdata%/KS folder.
12
Test your mod
Open Nitrocid KS to test your mod. Ensure that modman list lists your mod.
You will have to turn on kernel modifications from the kernel settings. Navigate to General > Start kernel modifications on boot and turn it on.
You can also make use of the KSTemplates repository, which can be installed to Visual Studio using the dotnet new install path/to/KS.Templates.nupkg command. It installs both C# and Visual Basic templates for your mods.
Bleeding-edge builds
Bleeding-edge NuGet builds are available in our organization's GitHub Package Registry. In order to use such builds, you'll need to consult the Installing canary NuGet packages section of the below page: