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.

  1. Make sure your Visual Studio is at least version 17.10.

    • Open Visual Studio.
    • Open the Help menu and select About Microsoft Visual Studio.

    Visual Studio help menu highlighting the About item

    Visual Studio About screen showing version highlighted

  2. Make sure you have installed the .NET desktop development workload.

    • Open Visual Studio Installer.
    • Select Modify on your Visual Studio 2022 installation

    image

    • In the Workloads tab, Find .NET desktop development workload and make sure it is checked.

    image

    • If changes are necessary, press the Modify button in the lower right. Once it has done its thing, your copy should be ready for MDK.

    image

  3. 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 (or Command Prompt if you prefer)

    Start menu showing Terminal and Command Prompt highlighted

    • Type dotnet --list-sdks and press enter.

    image

    If you do not have any .NET 9 versions, you need to go to https://dotnet.microsoft.com/en-us/download.

Installing MDK

  1. 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 (or Command Prompt if you prefer)

    Start menu showing Terminal and Command Prompt highlighted

    • Type dotnet new install Mal.Mdk2.ScriptTemplates and press enter

    image

Note

Some people get this message:

image

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:

image

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.

  1. Open Visual Studio again. Press "Create a new project". When you search for MDK now, you will find these two projects.

    image

    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.