Prerequisites
Warning
If you have the original MDK installed, you should uninstall it. MDK² works quite differently, and keeping the original around might interfere or at the very least can throw unrelated and therefore confusing errors.
Make sure your Visual Studio is at least version
17.10.- Open Visual Studio.
- Open the
Helpmenu and selectAbout Microsoft Visual Studio.
Make sure you have installed the .NET desktop development workload.
- Open Visual Studio Installer.
- Select
Modifyon your Visual Studio 2022 installation
- In the
Workloadstab, Find.NET desktop development workloadand make sure it is checked.
- If changes are necessary, press the
Modifybutton in the lower right. Once it has done its thing, your copy should be ready for MDK.
Make sure you have installed DotNet 9.
- Make sure to close Visual Studio before this step.
- Open a Terminal window by pressing the Windows/Start button and typing
Terminal(orCommand Promptif you prefer)
- Type
dotnet --list-sdksand pressenter.
If you do not have any .NET 9 versions, you need to go to https://dotnet.microsoft.com/en-us/download.
Installing MDK
Install the DotNet New template package.
- Make sure to close Visual Studio before this step.
- Open a Terminal window by pressing the Windows/Start button and typing
Terminal(orCommand Promptif you prefer)
- Type
dotnet new install Mal.Mdk2.ScriptTemplatesand pressenter
Note
Some people get this message:
This usually means that for whatever reason, the nuget primary package source has not been added to your nuget package manager. You can
double check this by typing dotnet nuget list source. If everything is as it should, it should at least list an entry with the official
nuget source:
If it doesn't, you can add it by typing in dotnet nuget add source https://api.nuget.org/v3/index.json -n nuget.org.
After this, you can try adding the template package again.
Note
Some people were not able to run the install command before restarting their computer after installing DotNet 9 or Visual Studio.
Open Visual Studio again. Press "Create a new project". When you search for MDK now, you will find these two projects.
PS: The URL you see in the image (https://github.com/malware-dev/MDK-SE) has been superceded by https://github.com/malforge/mdk2.
Note
Make sure you select the Script project and not the Mixin project when starting your new script.