Skip to content

Creating the Project

davidsebesta edited this page Jul 27, 2026 · 8 revisions

❔ Creating the Project

To create a LabAPI plugin, you will need the following:

Choose the section below for your IDE or tool:

Once the project is ready, you can begin writing your plugin.

Tip

See also: why this SDK?

Dedicated Server

You'll need to reference the server's assemblies for development.

Install the SCP: Secret Laboratory Dedicated server:

Navigate to the server's directory. You will need the path later.

If you've installed the server through Steam, right-click the tool, select Manage, then Browse local files

Files.png

Most projects need to reference the following assemblies from the SCPSL_Data/Managed directory:

  • Assembly-CSharp.dll
  • Assembly-CSharp-firstpass.dll
  • CommandSystem.Core.dll
  • Mirror.dll
  • UnityEngine.CoreModule.dll

JetBrains Rider

1. New Solution

Click the New Solution button on the welcome screen.

Create Solution

2. Create a Class Library Project

Choose the Class Library project type, with Target Framework set to net10.0 (net8.0 or newer).

Give a name to your solution (and project), then click Create

Project Setup

3. Edit the csproj

We'll have to configure some project settings.

Right-click the csproj (green), go to Edit -> Edit LabApiPlugin.csproj (you'll see your project's name)

Edit Project

4. Change Target Framework to net48

Set the TargetFramework property to net48 (no period there).

Add a LangVersion property with value latest (or a specific one like 14).

Properties

See also: why these properties?

5. Open the NuGet Tool

Right-click the project, then click Manage NuGet Packages

Open NuGet Tool

6. Add LabAPI

Install the Northwood.LabAPI NuGet package.

Add LabAPI

7. Add SCP:SL References

To interact with the game, you'll need to reference the game's assemblies.

Open the project dropdown (green), right-click Dependencies, then click Reference..., then Add From..., and select the assemblies.

Add Reference

Add From

8. Select Assemblies

See the dedicated server section to locate assemblies.

Select the references you need, and click OK. If you're missing something, Rider will let you know.

Select References

See the 5th step of this section to clean up your csproj a bit (e.g. for collaboration).

9. Write Your Plugin

Check out this article on writing your first plugin.

Visual Studio

1. Create a Project

Click Create a new project on the home screen.

Create

2. Class Library Template

Choose the Class Library template (.NET), then click Next

Class Library

3. Name the Project

Give a name to your project, and select where to save it.

Name

4. Select Framework

For now, choose the .NET 10.0 (.NET 8.0 or later) option. Click Create

Framework

5. Edit the csproj

Double-click the csproj (green) to edit it.

Edit Project

6. Change Target Framework to net48

Set the TargetFramework property to net48 (no period there).

Add a LangVersion property with value latest (or a specific one like 14).

Properties

See also: why these properties?

7. Open the NuGet Tool

Right-click the project (green), then click Manage NuGet Packages...

Open NuGet

8. Search for Northwood.LabAPI

Navigate to the Browse tab.

Type Northwood.LabAPI into the search bar.

Select the package, click Install, then Apply

Search NuGet

Install NuGet

9. Add SCP:SL References

Right-click the project (green), then click Add Assembly Reference...

Add Reference

10. Select Assemblies

See the dedicated server section to locate assemblies.

Select the references you need, click Add, then OK.

Select References

Pick-References.png

See the 5th step of this section to clean up your csproj a bit (e.g. for collaboration).

11. Write Your Plugin

Check out this article on writing your first plugin.

.NET CLI

1. Create a Solution

This step is optional.

Create a new solution.

mkdir $PluginName # replace with your plugin's name
cd $PluginName
dotnet new sln
2. Create a Project

Create a project with the classlib template. If you've created a solution, add the project to it. cd into the plugin's directory.

dotnet new classlib -o $PluginName # replace with your plugin's name
dotnet sln add $PluginName # if you've created a solution file
cd $PluginName
3. Add LabAPI

Install the Northwood.LabAPI package from NuGet.

.NET SDK 10 or later:

dotnet package add Northwood.LabAPI

.NET SDK 9 or earlier:

dotnet add package Northwood.LabAPI
4. Edit the csproj

Open the csproj in a text editor.

nvim $PluginName.csproj
5. Change Target Framework to net48

Set the TargetFramework property to net48 (no period there).

Add a LangVersion property with value latest (or a specific one, e.g. 14).

Properties

See also: why these properties?

6. Add References

See the dedicated server section to locate assemblies.

Create an <ItemGroup> and add <Reference> items to it.

You can copy-paste the following:

<ItemGroup>
    <Reference Include="Assembly-CSharp" HintPath="$(SL_REFERENCES)/Assembly-CSharp.dll" />
</ItemGroup>

Here, we used an environment variable to point to the server's SCPSL_Data/Managed directory. This makes the project file a bit cleaner, and helps collaboration if you're working with others.

References-Diff.png

7. Write Your Plugin

Check out this article on writing your first plugin.

FAQ

Project Properties

Currently, the Unity version (that SCP:SL uses) supports .NET Framework 4.8 (with a bunch of quirks).

Most new language features (e.g. file-scoped namespaces, extension members) can be used since many of them are just syntactic sugar.

SDK

Building for .NET Framework 4.8 is supported by the .NET SDK 8 and above, even on Linux.

Unity (currently) uses Mono, which is an open-source implementation of .NET Framework. .NET Framework is not cross-platform, and is only available on Windows. .NET 8 and newer SDKs include build (but not runtime) support for .NET Framework.

Note

Arch Linux distributions (and derivatives) may require extra setup. Try dotnet-install-scripts if the installation doesn't work.

To NuGet or Not To NuGet?

The LabApi.dll file can be found in the server's assemblies. However, we encourage you to use the version from NuGet as it includes XML documentation. Use your IDE to show details about LabAPI classes, properties etc.

Clone this wiki locally