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(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.
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" --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.
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
Open the project in VSCode
- Open VSCode
- Close any welcome dialogs or other stuff VSCode might throw at you
Drag your new script folder into VSCode
VSCode may show you a dialog (you may have to actually select one of the code files, likeProgram.cs, before it does).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.