1. Make sure you have installed DotNet 9.

    • Make sure to close VSCode 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.

  2. 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" --name "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. Create your first script project

    • Open another Terminal window (or continue using the one you opened earlier)
    • Type dotnet new mdk2pbscript -n MyFirstScript -o MyFirstScript
      image
  2. Open the project in VSCode

    • Open VSCode
    • Close any welcome dialogs or other stuff VSCode might throw at you

    image

    • Drag your new script folder into VSCode
      VSCode may show you a dialog (you may have to actually select one of the code files, like Program.cs, before it does).

      image

      You want this extension, install it and make sure it's active (it should activate automatically when installed).

    • When you get back to the Explorer now, your project should be loaded and ready for you.