Before you get can started creating interactive documentation, you will need to install the following:
- The .NET Core 3.0 SDK
- The .NET Core 2.1 SDK
- The dotnet try global tool
Updating to the latest version of the tool is easy. Run the following command:
> dotnet tool update -g Microsoft.dotnet-tryTo install the latest preview build from master, first uninstall the existing version of the tool:
> dotnet tool uninstall -g Microsoft.dotnet-tryThen, install from the preview package feed:
> dotnet tool install -g --add-source "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json" Microsoft.dotnet-tryYou can get started using either one of the options below.
- Create a new folder.
cdto your new folder.- Run command
dotnet try demo: This will load our interactive dotnet try getting started tutorial.
The tutorials below work you through the following:
- Creating a new Try .NET project.
- Display interactive snippets using C# regions.
- Creating Sessions
- Verifying your projects:
dotnet try verifya compiler for your documentation. - Passing Arguments
- Using read only snippets
- Go to the terminal and create a folder called
mydoc. cdto themydocfolder and create a new console app with the following command:
> dotnet new console -o myAppThis will create a console app with the files myApp.csproj and Program.cs.
-
Open the
mydocfolder in Visual Studio Code. -
Create a file called
doc.md. Inside that file, add some text and a code fence:
# My Interactive Document:
```cs --source-file ./myApp/Program.cs --project ./myApp/myApp.csproj
```- Now, navigate to the
mydocfolder in your console and run the following command:
> dotnet tryYou have created your first C# interactive developer experience. You should now be able to run your console app and see the result in the browser.
Option 3: Explore our samples repo.
- Clone the dotnet/try-samples repo.
- Follow the quick steps listed here to get started.
Return to README.md