Manual Installation (Advanced)
Warning
This guide is for advanced users who prefer not to use MDK Hub or need to set up MDK2 in special environments. Most users should use MDK Hub instead - it's simpler and handles these steps automatically.
If you're here because you're having issues with the Hub, consider filing an issue so we can improve the experience for everyone.
Prerequisites
.NET 9 SDK - Download from dotnet.microsoft.com
- Verify installation:
dotnet --list-sdks - You should see at least one
9.x.xversion listed
- Verify installation:
Space Engineers - Required for game assembly references
- The game must be installed and findable by MDK
- On Linux: Note your installation path (you'll need to configure it manually)
IDE (optional but recommended):
- Visual Studio 2022 (17.10 or later) with .NET desktop development workload
- Visual Studio Code with C# Dev Kit extension
- JetBrains Rider
Installing Templates
- Open a terminal/command prompt.
- Run:
dotnet new install Mal.Mdk2.ScriptTemplates - Verify installation:
You should seedotnet new list | grep mdk2mdk2pbscriptandmdk2pbmixintemplates listed.
Troubleshooting Template Installation
If you get an error about NuGet sources:
- Check your NuGet sources:
dotnet nuget list source - If
nuget.orgis missing, add it:dotnet nuget add source https://api.nuget.org/v3/index.json -n nuget.org - Try the template installation again.
Note
Some users need to restart their computer after installing .NET 9 before template installation will work.
Creating a Project
Option 1: Command Line
dotnet new mdk2pbscript -n MyScriptName -o MyScriptName
Replace MyScriptName with your desired project name.
Option 2: IDE Template
- Visual Studio: File → New → Project → Search for "MDK"
- Rider: New Solution → Search for "MDK"
- VSCode: Use command line method, then open folder in VSCode
Configuration (Linux Users & Non-Hub Users)
If you're on Linux, Space Engineers isn't auto-detected, or you're not using MDK Hub:
- Create or edit
MyScriptName.mdk.local.iniin your project folder. - Add:
[mdk] binarypath=/path/to/SpaceEngineers/Bin64 output=/path/to/.local/share/SpaceEngineers/IngameScripts/local interactive=DoNothing
Replace paths with your actual Space Engineers installation and desired output location.
Note
The interactive=DoNothing setting prevents MDK from showing Hub notifications. This is recommended if you're not using the Hub or running in CI/CD environments.
Building
From Command Line
cd MyScriptName
dotnet build
From IDE
- Visual Studio: Press
Ctrl+Shift+Bor Build → Build Solution - Rider: Press
Ctrl+Shift+F9or Build → Build Solution - VSCode: Press
Ctrl+Shift+Bor rundotnet buildin terminal
Your compiled script will appear in the configured output path (or the default Space Engineers local scripts folder on Windows).
Updating Templates
To update to the latest template version:
dotnet new update
Or to update a specific template:
dotnet new install Mal.Mdk2.ScriptTemplates --force
Updating NuGet Packages
MDK2 uses NuGet packages for analyzers, packagers, and references. To update:
Command Line
dotnet list package --outdated
dotnet add package Mal.Mdk2.PbPackager
dotnet add package Mal.Mdk2.PbAnalyzers
dotnet add package Mal.Mdk2.References
IDE
- Visual Studio: Right-click project → Manage NuGet Packages → Updates tab
- Rider: Right-click project → Manage NuGet Packages → Updates tab
- VSCode: Use command line method
Why Use Hub Instead?
MDK Hub provides several benefits over manual installation:
- Automatic setup - No manual .NET checks, template installs, or NuGet source troubleshooting
- Centralized management - See all projects in one place, update packages in bulk
- Build notifications - Desktop notifications when builds complete
- Visual configuration - Edit
mdk.inisettings through a GUI - Project detection - Automatically finds and imports existing projects
- Cross-platform - Works on both Windows and Linux
If you're doing manual installation due to a Hub issue, please report it - we want to make the Hub work for everyone!
Next Steps
- Configure your project - Set minification levels, ignore patterns, etc.
- IDE-specific guides - Learn IDE-specific workflows
- Advanced topics - File ordering, minifier preservation, mixin projects