-
Notifications
You must be signed in to change notification settings - Fork 40
Creating the Project
To create a LabAPI plugin, you will need the following:
- .NET 10 SDK (.NET 8 or newer)
- SCP: Secret Laboratory Dedicated Server
- An IDE, code editor or text editor
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?
You'll need to reference the server's assemblies for development.
Install the SCP: Secret Laboratory Dedicated server:
- via SteamCMD
- or directly from Steam:
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

Most projects need to reference the following assemblies from the SCPSL_Data/Managed directory:
Assembly-CSharp.dllAssembly-CSharp-firstpass.dllCommandSystem.Core.dllMirror.dllUnityEngine.CoreModule.dll
1. New Solution
Click the New Solution button on the welcome screen.

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

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)

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).

See also: why these properties?
5. Open the NuGet Tool
Right-click the project, then click Manage NuGet Packages

6. Add LabAPI
Install the Northwood.LabAPI NuGet package.

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.


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.

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.
1. Create a Project
Click Create a new project on the home screen.

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

3. Name the Project
Give a name to your project, and select where to save it.

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

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

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).

See also: why these properties?
7. Open the NuGet Tool
Right-click the project (green), then click Manage NuGet Packages...

8. Search for Northwood.LabAPI
Navigate to the Browse tab.
Type Northwood.LabAPI into the search bar.
Select the package, click Install, then Apply


9. Add SCP:SL References
Right-click the project (green), then click Add Assembly Reference...

10. Select Assemblies
See the dedicated server section to locate assemblies.
Select the references you need, click Add, then OK.


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.
1. Create a Solution
This step is optional.
Create a new solution.
mkdir $PluginName # replace with your plugin's name
cd $PluginName
dotnet new sln2. 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 $PluginName3. 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.LabAPI4. Edit the csproj
Open the csproj in a text editor.
nvim $PluginName.csproj5. 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).

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.

7. Write Your Plugin
Check out this article on writing your first plugin.
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.
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.
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.