Skip to content

Latest commit

 

History

History
49 lines (33 loc) · 1.73 KB

NewProject.md

File metadata and controls

49 lines (33 loc) · 1.73 KB

Step-by-step tutorial: Create a New Project

Let's walk through how to create some dotnet try-powered documentation from scratch.

  1. Go to the terminal and create a folder called MyDocProject.

  2. 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
```
  1. Inside the MyDocProject folder, create a subfolder called MyConsoleApp, 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 and Program.cs.

  2. 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.

NEXT: Show snippets using regions »