# Getting Started
## Including the Package
There are several ways to use the KSPBuildTools package in your mod. If you are using
an [SDK-style csproj file](https://learn.microsoft.com/en-us/dotnet/core/project-sdk/overview), it is recommended to use NuGet
### Install with NuGet
either run the following command:
````{jinja}
```console
dotnet add package KSPBuildTools{% if nuget_version %} --version {{nuget_version}}{% endif %}
```
````
or add the following to your csproj:
````{jinja}
```xml
```
````
### Including the Targets File Directly
If you aren't able to use the NuGet option, you can include the targets file directly using a git submodule.
First, run the following command in your git project root:
````{jinja}
```console
git submodule add{% if git_ref %} --branch {{git_ref}} {% endif %}https://github.com/KSPModdingLibs/KSPBuildTools.git
```
````
Then include the targets file in your csproj. Make sure you use the correct path relative to your project file.
```xml
```
Or you can copy the files you want into your own repository and use them however you like - though that will make it harder to get updates
## Locating your KSP Install
KSPBuildTools needs to know where you have KSP installed in order to reference the game dlls. These are all specific to your own computer, and should not be included in your git repo.
There are several options for this. KSPBuildTools will choose in the following order. Either [autodiscovery in the solution directory](#solution-directory) or [setting a reference path in a .user file](#environment-variable) are the recommended methods for most users.
### KSPRoot MSBuild Property
If the {confval}`KSPRoot` MSBuild property is already set, KSPBuildTools will use it as-is. This can be set in your .csproj.user file.
### Environment Variable
Set the {envvar}`KSP_ROOT` environment variable to the root of a KSP install. This is useful for CI workflows such as those using the {gh-actions:action}`compile` action.
### Solution Directory
KSPBuildTools will look for a "KSP" directory in your solution directory and use it if it is a valid install. It identifies valid installs by looking for `assembly-csharp.dll` in the appropriate subdirectory for your operating system.
### Reference Path
KSPBuildTools will use the `ReferencePath` MSBuild property if it is a valid KSP install. This can be set in a user file located at `{csproj path}.user`. If you use Visual Studio, it can generate this file and property for you.
### From Steam
KSPBuildTools will use the default Steam install location if it is a valid install