dotnet try
Runnable .NET code on your site
Getting started with dotnet try
Setup
Before you get can started creating interactive documentation, you will need to install the following:
The dotnet try global tool
Updating to the latest version of the tool is easy. Run the following command:
Installing preview builds from master
master
To install the latest preview build from master, first uninstall the existing version of the tool:
Then, install from the preview package feed:
Getting Started
You can get started using either one of the options below.
Option1: dotnet try demo
dotnet try demo
Create a new folder.
cd
to 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 verify
a compiler for your documentation.Passing Arguments
Using read only snippets
Option 2: Starting from scratch.
Go to the terminal and create a folder called
mydoc
.cd
to themydoc
folder and create a new console app with the following command:
This will create a console app with the files myApp.csproj
and Program.cs
.
Open the
mydoc
folder in Visual Studio Code.Create a file called
doc.md
. Inside that file, add some text and a code fence:
Now, navigate to the
mydoc
folder in your console and run the following command:
You 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
https://www.youtube.com/playlist?list=PLMYKxbaJxSpHvrqzf-GqdCu7o4HaW3qlV Advanced c# LINQ tutorials.
Last updated