# Development environment setup

In order to get started with Puck development, you will need to set up some sort of development environment on your host system. This document will guide you through setting up a mod development environment in Visual Studio Code, though most steps will also apply to other IDEs.

### Prerequisites

<table data-card-size="large" data-view="cards"><thead><tr><th></th><th data-hidden data-card-cover data-type="files"></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>Download &#x26; install .NET SDK</strong></td><td><a href="https://2911841908-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8ZDIsNKdEz0IT73wepog%2Fuploads%2FxQuWR1PZOS21Wjujnf7G%2Fimage.png?alt=media&#x26;token=01713cd9-234c-46eb-b4eb-862a18a5010f">image.png</a></td><td><a href="https://dotnet.microsoft.com/en-us/download">https://dotnet.microsoft.com/en-us/download</a></td></tr><tr><td><strong>Download &#x26; install Visual Studio Code</strong></td><td><a href="https://2911841908-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8ZDIsNKdEz0IT73wepog%2Fuploads%2FiMRuomkdksCJjohBMfMF%2Fimage.png?alt=media&#x26;token=19f10340-ac9d-43bb-9351-fb6cffe80eb9">image.png</a></td><td><a href="https://code.visualstudio.com/">https://code.visualstudio.com/</a></td></tr></tbody></table>

### Environment

1. Create a new folder anywhere on your system which will contain our project files. For the sake of this example, we'll create a folder called `MyPuckMod` on the desktop. The absolute path should look as follows: `C:\Users\user\Desktop\MyPuckMod`.
2.  Launch Visual Studio Code and open the `MyPuckMod` folder within it.\


    <figure><img src="https://2911841908-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8ZDIsNKdEz0IT73wepog%2Fuploads%2FwaA8Z3em5VWPm1VsdcL9%2Fimage.png?alt=media&#x26;token=db6d7c8d-4492-4472-8ff7-3248eedb1f7c" alt=""><figcaption></figcaption></figure>
3.  Launch a new terminal window within Visual Studio Code.\


    <figure><img src="https://2911841908-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8ZDIsNKdEz0IT73wepog%2Fuploads%2FaFgWsfoZXbVmd3D6YOMB%2Fimage.png?alt=media&#x26;token=3fb07be2-cc29-4e00-956d-2e01742e5676" alt=""><figcaption></figcaption></figure>

    <figure><img src="https://2911841908-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8ZDIsNKdEz0IT73wepog%2Fuploads%2FS3zFEW8ErPBmy6wjaagF%2Fimage.png?alt=media&#x26;token=45367e28-32d7-436d-999c-ed872f0a18f6" alt=""><figcaption></figcaption></figure>
4.  Validate your .NET installation by executing a `dotnet` command.\


    <figure><img src="https://2911841908-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8ZDIsNKdEz0IT73wepog%2Fuploads%2FuWoyWjx8rNVZTxfmoGbj%2Fimage.png?alt=media&#x26;token=9891c58e-01b9-41fd-bf91-e436121e8670" alt=""><figcaption></figcaption></figure>
5.  Execute a `dotnet new classlib` command in order to set up a new .NET project. Since we're creating a Class Library (.dll), we use the `classlib` template.\


    <figure><img src="https://2911841908-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8ZDIsNKdEz0IT73wepog%2Fuploads%2FUicmXUU8BD4A6ns34kaf%2Fimage.png?alt=media&#x26;token=b055193e-9de4-4165-9b17-9a7267713d15" alt=""><figcaption></figcaption></figure>
6.  Validate if all project files were generated within your project's directory.\


    <figure><img src="https://2911841908-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8ZDIsNKdEz0IT73wepog%2Fuploads%2FvCrVv0iFdUIKfOBx0O9A%2Fimage.png?alt=media&#x26;token=2e8193ba-9b7e-4afe-b1a4-754ce3fd367e" alt=""><figcaption></figcaption></figure>
7.  Open the `MyPuckMod.csproj` file and remove the `ImplicitUsings` and `Nullable` tags, since those features are not available in .NET 4.8. Speaking of .NET 4.8, replace the contents of `TargetFramework` to `net4.8`, since we'll be targeting that particular .NET Framework version.\
    \
    Your `MyPuckMod.csproj` should looks as follows:

    ```xml
    <Project Sdk="Microsoft.NET.Sdk">

      <PropertyGroup>
        <TargetFramework>net4.8</TargetFramework>
      </PropertyGroup>

    </Project>
    ```

    \
    Since we'll be targeting .NET 4.8, features like file-scoped namespaces will also be unavailable, so let's adjust the `Class1.cs` file to the following:

    ```csharp
    namespace MyPuckMod {
        public class Class1
        {

        }
    }
    ```


8.  Execute the `dotnet build` command in the terminal in order to build our project.\


    <figure><img src="https://2911841908-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8ZDIsNKdEz0IT73wepog%2Fuploads%2FfIhNKPPd4WgVwNdb26zU%2Fimage.png?alt=media&#x26;token=dca63527-ee25-4bbb-ad41-dd4f14491ac7" alt=""><figcaption></figcaption></figure>
9.  Validate the generated .dll of your mod in `bin/Debug/net4.8`\


    <figure><img src="https://2911841908-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8ZDIsNKdEz0IT73wepog%2Fuploads%2FNFhCghKQnmXuwJtida73%2Fimage.png?alt=media&#x26;token=bff62aa4-c74b-4a06-a23e-be961f0593de" alt=""><figcaption></figcaption></figure>

### We're set up!

Awesome! This .dll is essentially our mod, though it does not do anything useful just yet. Not does it interact with the Puck in any way. We'll cover how to do so in the following steps, so stay tuned!

{% hint style="info" %}
In order to get features like code-completion and C# project solution management, install the **C# Dev Kit** extension in Visual Studio Code from the Extensions tab.
{% endhint %}
