- Quick Start
- Create a New Project
- Show snippets using regions
- Create Sessions
- Verify your Project
- Passing Arguments
- Using Read-only Snippets
- Reference
Let's walk through how to create some dotnet try
-powered documentation from scratch.
-
Go to the terminal and create a folder called
MyDocProject
. -
Create a file called
doc.md
. Inside that file, add some text and a code fence:
# My code sample:
```cs --source-file ./MyConsoleApp/Program.cs --project ./MyConsoleApp/MyConsoleApp.csproj
```
-
Inside the
MyDocProject
folder, create a subfolder calledMyConsoleApp
, navigate into that folder in your terminal, and run the following command:> dotnet new console
This will create a console app with the files
MyDocProject.csproj
andProgram.cs
. -
Now, navigate back to the
MyDocProject
folder and run the following command:> dotnet try
If you want to run this command from elsewhere, you can also pass the path as an argument, like this:
> dotnet try /path/to/your/project/folder
Congratulations! You have created your first C# interactive developer experience with dotnet try
. You should now be able to click run and see the result in the browser.
As you might have noticed, you see the full Program.cs
file. But suppose you'd like to show your user only Console.WriteLine("Hello World!");
? The next step in the tutorial will show you how to do that.