# Building your Mod

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. Press `Create a new project` on Visual Studio homepage

   <figure><img src="https://content.gitbook.com/content/iT2DBrNZjRgvA3UQ0pzl/blobs/lylC5XhvMZDlykqLOhea/077-modbuild.png" alt=""><figcaption></figcaption></figure>
2. Find `Class Library` and double-click it

   <figure><img src="https://content.gitbook.com/content/iT2DBrNZjRgvA3UQ0pzl/blobs/gBG5WexodsfpgqejoU04/078-modbuild.png" alt=""><figcaption></figcaption></figure>
3. Write your mod name, like in our example, `MyFirstMod`.

   <figure><img src="https://content.gitbook.com/content/iT2DBrNZjRgvA3UQ0pzl/blobs/JDTZm0x81HchnNxd591B/079-modbuild.png" alt=""><figcaption></figcaption></figure>
4. Make sure that `.NET 8.0` is used. Press `Create`.

   <figure><img src="https://content.gitbook.com/content/iT2DBrNZjRgvA3UQ0pzl/blobs/RWDhLFnLYHaWIQM48BkC/080-modbuild.png" alt=""><figcaption></figcaption></figure>
5. Right-click on `Dependencies` -> `Manage NuGet Packages`, find `KS`, and install it.

   <figure><img src="https://content.gitbook.com/content/iT2DBrNZjRgvA3UQ0pzl/blobs/ew5syD3SbSaQoEPLIjNB/081-modbuild.png" alt=""><figcaption></figcaption></figure>
6. Once the package is installed, go to the `Class1.cs` source file

   <figure><img src="https://content.gitbook.com/content/iT2DBrNZjRgvA3UQ0pzl/blobs/NnoDX7bNtb3lsSaMLqMm/082-modbuild.png" alt=""><figcaption></figcaption></figure>
7. Write next to the class file `: IMod` and import the required namespace `by using Nitrocid.Modifications;`. You should see errors indicating that you have to implement the methods.

   <figure><img src="https://content.gitbook.com/content/iT2DBrNZjRgvA3UQ0pzl/blobs/hVZ9C5NZWKHlYHI7mlFu/083-modbuild.png" alt=""><figcaption></figcaption></figure>
8. After implementation, you should see:

   <figure><img src="https://content.gitbook.com/content/iT2DBrNZjRgvA3UQ0pzl/blobs/iUsJE7xXxrpFqTjcjalN/084-modbuild.png" alt=""><figcaption></figcaption></figure>
9. Remove all calls to `NotImplementedException` and set the minimum supported API version. Currently, we're at `v3.0.25.437`.

   <figure><img src="https://content.gitbook.com/content/iT2DBrNZjRgvA3UQ0pzl/blobs/6xhvyNAThkQlWCsTtTNo/085-modbuild.png" alt=""><figcaption></figcaption></figure>
10. 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](https://learn.microsoft.com/en-us/dotnet/standard/assembly/sign-strong-name). Then, click on the `Build` menu and select `Build Solution`.

    <div align="left"><figure><img src="https://content.gitbook.com/content/iT2DBrNZjRgvA3UQ0pzl/blobs/m9agAsECB4XMgE8v4zTn/086-modbuild.png" alt=""><figcaption></figcaption></figure></div>
11. 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`.

    <div align="left"><figure><img src="https://content.gitbook.com/content/iT2DBrNZjRgvA3UQ0pzl/blobs/Bi2ESilG7M0fljJ2S1JG/087-modbuild.png" alt=""><figcaption></figcaption></figure></div>
12. Navigate to the output directory and copy the `.dll` file to `KSMods` under the `%localappdata%/KS` folder.

    <figure><img src="https://content.gitbook.com/content/iT2DBrNZjRgvA3UQ0pzl/blobs/FYtcauKG4cieqDcfFLYZ/088-modbuild.png" alt=""><figcaption></figcaption></figure>
13. Open Nitrocid KS to test your mod. Ensure that `modman list` lists your mod.

    <figure><img src="https://content.gitbook.com/content/iT2DBrNZjRgvA3UQ0pzl/blobs/JT2gFyzWQW53OXxKUlLL/089-modbuild.png" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
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`](https://github.com/Aptivi/KSTemplates) repository, which can be installed to Visual Studio using the `dotnet new install path/to/KS.Templates.nupkg` command.
{% endhint %}

### Bleeding-edge builds <a href="#bleeding-edge-builds" id="bleeding-edge-builds"></a>

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 <mark style="color:green;">**Installing canary NuGet packages**</mark> section of the below page:

{% content-ref url="<https://app.gitbook.com/s/Id4bob6wnHvpX4zbVVtI/csharp-libraries/installation-and-upgrade/installation>" %}
[Installation](https://app.gitbook.com/s/Id4bob6wnHvpX4zbVVtI/csharp-libraries/installation-and-upgrade/installation)
{% endcontent-ref %}
