Skip to content

Latest commit

 

History

History
26 lines (17 loc) · 1.91 KB

Verify.md

File metadata and controls

26 lines (17 loc) · 1.91 KB

Step-by-step tutorial: Verify your project

dotnet try verify is a compiler for your documentation. With this command, you can make sure that every code snippet will work and is in sync with the backing project. The goal of dotnet try verify is to enable you to check the correctness of your documentation as you work, and to enable the same checks inside of your build pipeline.

In the doc.md file in your MyDocProject, change the --project option in one of the code fences to a nonexistent file name, like ./nonexistent.csproj. Then refresh your browser.

Where the code editor was, you will now see a warning ("No project or package specified"). This is a clear way to indicate that your Markdown document is incorrectly configured.

You can see this same error in your terminal by running the dotnet try verify command. You can run this command in the MyDocProject folder, or from elsewhere using dotnet try verify <path-to-folder>. It should look similar to this:

dotnet verify -errorproject

Try making other changes to the code fence options. Mistype an option name, specify a nonexistent code region, or make a non-compiling change in your backing project. You'll see different errors pointing out the various problems.

When dotnet try verify detects errors, it will return a non-zero exit code. When everything looks good, it returns 0. You can use this in your continuous integration scripts to prevent code changes from breaking your documentation.

NEXT: Passing Arguments »