Technical Documentation: dotnet/sdk
ℹ️ Provenance: Multi-Tier Ingestion · CodeWiki Reference
Overview (README.md)
Welcome to dotnet sdk
This repository contains core functionality needed to create .NET projects that are shared between Visual Studio and the .NET CLI.
- MSBuild tasks are under /src/Tasks/Microsoft.NET.Build.Tasks/.
See dotnet/project-system for the project system work that is specific to Visual Studio.
See the dotnetup documentation
for work on the .NET toolchain manager. Dotnetup changes should target therelease/dnup branch rather than main.
Common project and item templates are found in template_feed.
Build status
| Visibility | All jobs |
|---|---|
| Public | |
| Microsoft Internal |
Installing the SDK
You can download the .NET SDK as either an installer (MSI, PKG) or a zip (zip, tar.gz). The .NET SDK contains both the .NET runtime and CLI tools.
Looking for dotnet-install sources?
Sources for dotnet-install.sh and dotnet-install.ps1 are in the install-scripts repo.
How do I engage and contribute?
We welcome you to try things out, file issues, make feature requests and join us in design conversations. Be sure to check out our project documentation
This project has adopted the .NET Foundation Code of Conduct to clarify expected behavior in our community.
How do I build the SDK?
Start with the Developer Guide.
How do I test an SDK I have built?
To test your locally built SDK, run eng\dogfood.cmd after building. That script starts a new Powershell with the environment configured to redirect SDK resolution to your build.
From that shell your SDK is available in:
- any Visual Studio instance launched via
& devenv.exe dotnet buildmsbuild
How do I determine the timeline I must follow to get my changes in for a specific version of .NET?
Please see the Pull Request Timeline Guide.
How we triage and review PRs
With the SDK repository being the home for many different areas, we've started trying to label incoming issues for the area they are related to using Area- labels. Then we rely on the codeowners to manage and triages issues in their areas. Feel free to contact the owners listed in that file if you're not getting a response on a particular issue or PR. Please try to label new issues as that'll help us route them faster.
For issues related to the central SDK team, typically they are assigned out to a team member in the first half of each week. Then each member is asked to review and mark those needing further discussion as "needs team triage" and otherwise setting a milestone for the issue. Backlog means we will consider it in the future if there is more feedback. Discussion means we have asked for more information from the filer. All other milestones indicate our best estimate for when a fix will be targeted for noting that not all issues will get fixed. If you are not getting a quick response on an issue assigned to a team member, please ping them.
The example query used for triage of .NET SDK issues can be viewed here
For PRs, we assign a reviewer once a week on Wednesday, looking only at PRs that are green in the build. If you are contributing:
- Get the PR green.
- Include a test if possible.
- Mention
@dotnet-cliif you want to raise visibility of the PR.
License
The .NET SDK project uses the MIT license.
The LICENSE.txt and ThirdPartyNotices.txt in any downloaded archives are authoritative.
Documentation README (`documentation/README.md`)
Documents Index
Overview and general information
- Intro to .NET Core CLI
- Publishing a solution and its pitfalls
- CLI UX Guidelines
- .NET Core native pre-requisities document
- Roadmap and OS support
- Comprehensive CLI documentation
- ASP.NET Core Command Line Tools
- Guidelines for how to introduce a new diagnostic or breaking change
Working with the CLI repo
Troubleshooting and issues reporting
Specifications
Documentation TemplateEngine README (`documentation/TemplateEngine/README.md`)
.NET Template Engine
Overview
The .NET Template Engine provides the libraries for template instantiation and template package management used in dotnet new, the New Project Dialog, and the New Item Dialog in Visual Studio. The source code is located in this repository under src/TemplateEngine/Microsoft.TemplateEngine.* and the libraries are distributed as NuGet packages on nuget.org.
Note: The template engine was previously maintained in the dotnet/templating repository and has been merged into this repository (dotnet/sdk).
Key Packages
| Package | Description |
|---|---|
Microsoft.TemplateEngine.Edge |
The template engine infrastructure: managing template packages, templates, components, and executing templates. Main API surface for products aiming to use the template engine. See the Inside the Template Engine article for more information. |
Microsoft.TemplateEngine.Abstractions |
Contains the main contracts between Edge and components. |
Microsoft.TemplateEngine.Orchestrator.RunnableProjects |
The template generator based on template.json configuration. |
Microsoft.TemplateSearch.Common |
Facilitates template package search on nuget.org. |
Microsoft.TemplateEngine.IDE |
Lightweight API overlay over Microsoft.TemplateEngine.Edge. |
Microsoft.TemplateEngine.Authoring.Tasks |
Authoring tools: MSBuild tasks for template authoring. |
Microsoft.TemplateEngine.Authoring.CLI |
Authoring tools: dotnet CLI tool with utilities for template authoring. |
Microsoft.TemplateEngine.Authoring.TemplateVerifier |
Authoring tools: snapshot testing framework for templates. |
`dotnet new`
The dotnet new CLI command is located in src/Cli/Microsoft.TemplateEngine.Cli.
Issues for dotnet new CLI UX should be opened in this repository (dotnet/sdk).
Template Content Repositories
.NET default templates are located across several repositories:
| Templates | Repository |
|---|---|
| Common project and item templates | dotnet/sdk |
| ASP.NET and Blazor templates | dotnet/aspnetcore |
| ASP.NET Single Page Application templates | dotnet/spa-templates |
| Aspire templates | dotnet/aspire |
| WPF templates | dotnet/wpf |
| Windows Forms templates | dotnet/winforms |
| Test templates | dotnet/test-templates |
| MAUI templates | dotnet/maui |
Issues for template content should be opened in the corresponding repository. Suggestions for new templates should be opened in the closest repository from the list above. For example, if you have a suggestion for a new web template, please create an issue in dotnet/aspnetcore.
How to Author Templates
The starting point tutorial on how to create new templates is available on Microsoft Learn.
More advanced information can be found in the documentation in this folder:
- Reference for template.json
- Conditional processing and comment syntax
- Available symbols generators
- Post-action registry
- Constraints
- Conditions
- Binding and project context evaluation
- Value forms
- Using group identity
- Template samples
Authoring Tools
In addition to the template engine implementation, there are various tools to help author templates. They are not shipped with the .NET SDK but are available on NuGet.org. More information can be found in the Authoring Tools documentation.
Contributing
We welcome contributions! You can contribute by:
- Creating an issue in the dotnet/sdk repository
- Contributing a PR that fixes an issue or implements a new feature
See the SDK developer guide for details on how to build, run, and debug.
For template engine specific documentation on contributing, see the contributing guide.
Documentation Issue Mappings README (`documentation/issue-mappings/README.md`)
Many of the issues in this repo were originally created in the dotnet/toolset and dotnet/cli repos, then migrated here to the dotnet/sdk repo.
In this process their ID numbers inevitably changed. If you have the old ID number, you can find the new ID number by simply navigating to the old URL: your browser will be redirected to the new URL.
For example, https://github.com/dotnet/cli/issues/10 redirects to https://github.com/dotnet/sdk/issues/4288.
In some circumstances you may have the new URL and want the old one. For example, if you are looking at a migrated issue and wish to search your email or chat logs for a discussion that referred to the old URL. In that case, you can use these mapping files to look up the old ID and find the old URL.
Documentation TemplateEngine Samples README (`documentation/TemplateEngine/Samples/README.md`)
.NET Template Samples
This folder contains samples of templates done for template engine.
These templates are supported by dotnet new and Visual Studio.
For details, on how to configure the templates to be used in Visual Studio, refer to this article.
The other examples of complex templates can be found in Microsoft.TemplateEngine.TestTemplates and SDK.TestTemplates repositories.
For more general info on the authoring, see:
Contributing
We would love community contributions here. Please feel free to open the PRs to add more examples or create an issue requesting a new example.
See the SDK developer guide for information on contributing to this project.
Template Content Repositories
.NET default templates are located in several repositories. You can use them as examples of more complicated templates.
The templates are located in the following repositories:
| Templates | Repository |
|---|---|
| Common project and item templates | dotnet/sdk |
| ASP.NET and Blazor templates | dotnet/aspnetcore |
| ASP.NET Single Page Application templates | dotnet/spa-templates |
| WPF templates | dotnet/wpf |
| Windows Forms templates | dotnet/winforms |
| Test templates | dotnet/test-templates |
| MAUI templates | dotnet/maui |
Documentation Format Docs README (`documentation/format/docs/README.md`)
Welcome to the dotnet-format docs!
.editorconfig options
CLI options
Specify a workspace (Required)
A workspace path is needed when running dotnet-format. By default, the current folder will be used as the workspace path. The workspace path and type of workspace determines which code files are considered for formatting.
- Solutions and Projects - By default dotnet-format will open the workspace path as a MSBuild solution or project.
--no-restore- When formatting a solution or project the no restore option will stop dotnet-format from performing an implicit package restore.--folder- When the folder options is specified the workspace path will be treated as a folder of code files.
Example:
Format the code files used in the format solution.
dotnet format ./format.slnFormat the code files used in the dotnet-format project.
dotnet format ./src/dotnet-format.csprojFormat the code files from the ./src folder.
dotnet format whitespace ./src --folderWhitespace formatting
Whitespace formatting includes the core .editorconfig settings along with the placement of spaces and newlines. The whitespace formatter is run by default when not running analysis. When only performing whitespace formatting, an implicit restore is not perfomed. When you want to run analysis and fix formatting issues you must specify both.
Whitespace formatting run by default along with code-style and 3rd party analysis.
dotnet format ./format.slnRunning the whitespace formatter alone.
dotnet format whitespace ./format.slnRunning analysis
CodeStyle analysis
Running codestyle analysis requires the use of a MSBuild solution or project file as the workspace. By default an implicit restore on the solution or project is performed. Enforces the .NET Language conventions and Naming conventions.
dotnet format style --severity <severity>- Runs analysis and attempts to fix issues with severity equal or greater than specified. If severity is not specified then severity defaults to warning.
Example:
Code-style analysis is run by default along with whitespace formatting and 3rd party analysis.
dotnet format ./format.slnRun code-style analysis alone against the dotnet-format project.
dotnet format style ./src/dotnet-format.csproj --severity errorErrors when used with the --folder option. Analysis requires a MSBuild solution or project.
dotnet format style ./src --folder3rd party analysis
Running 3rd party analysis requires the use of a MSBuild solution or project file as the workspace. By default an implicit restore on the solution or project is performed. 3rd party analyzers are discovered from the `` specified in the workspace project files.
dotnet format analyzers --severity <severity>- Runs analysis and attempts to fix issues with severity equal or greater than specified. If no severity is specified then this defaults to warning.
Filter diagnostics to fix
Typically when running codestyle or 3rd party analysis, all diagnostics of sufficient severity are reported and fixed. The --diagnostics option allows you to target a particular diagnostic or set of diagnostics of sufficient severity.
--diagnostics <diagnostic ids>- When used in conjunction withstyleoranalyzersubcommands, allows you to apply targeted fixes for particular analyzers.
Example:
Run code-style analysis and fix unused using directive errors.
dotnet format style ./format.sln --diagnostics IDE0005Filter files to format
You can further narrow the list of files to be formatted by specifying a list of paths to include or exclude. When specifying folder paths the path must end with a directory separator. File globbing is supported.
--include- A list of relative file or folder paths to include in formatting.--exclude- A list of relative file or folder paths to exclude from formatting.
Example:
Other repos built as part of your project can be included using git submodules. These submodules likely contain their own .editorconfig files that are set as root = true. This makes it difficult to validate formatting for your project as formatting mistakes in submodules are treated as errors.
The following command sets the repo folder as the workspace. It then includes the src and tests folders for formatting. The submodule-a folder is excluded from the formatting validation.
dotnet format whitespace --folder --include ./src/ ./tests/ --exclude ./src/submodule-a/ --verify-no-changesLogging and Reports
--verbosity- Set the verbosity level. Allowed values are q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic]--report- Writes a json file to the given directory. Defaults to 'format-report.json' if no filename given.--binarylog- Writes a binary log file to help in diagnosing solution or project load errors. Defaults to 'format.binlog' if no filename given.
Validate formatting
--verify-no-changes- Formats files without saving changes to disk. Terminates with a non-zero exit code (2) if any files were formatted.
Documentation General Dotnetup README (`documentation/general/dotnetup/README.md`)
Get started with dotnetup
[!IMPORTANT]
dotnetupis in public preview. Its features and behavior might change
before general availability.
dotnetup is a cross-platform toolchain manager for user-level .NET
installations. It installs, updates, and removes .NET SDKs and runtimes without
using a system package manager.
Prerequisites
One of the following operating systems and architectures:
Operating system Architectures Windows x64, Arm64 macOS x64, Arm64 Linux (glibc) x64, Arm64 Linux (musl), such as Alpine Linux x64, Arm64 A terminal.
Bash on macOS or Linux, or PowerShell on Windows, to run the download script.
On macOS or Linux,
curlorwgetto download files, andsha512sumorshasumto verify them.
dotnetup has the same operating-system requirements as the .NET Runtime.
For OS-specific requirements, see
Install .NET on Windows,
Install .NET on macOS,
or Install .NET on Linux.
[!IMPORTANT]
On Windows, the default setup uses theeverywhereaccess mode. This mode:
- Requires elevation to update the system
PATH.- Makes the dotnetup-managed installation take precedence over machine-wide
.NET installations, such as the ones that Visual Studio installs. Projects
and apps that need a machine-wide SDK or runtime that isn't also installed
bydotnetupfail to build or run.- Changes the system
PATH, which applies to all users. Elevated processes
that other users start might resolve .NET from your user profile.To avoid these effects, choose the
noneorshellaccess mode during setup.
If you chooseeverywhere, migrate your existing installations when setup
offers to. For details, see
Everywhere mode considerations.
Download dotnetup
The download scripts install the latest preview build by default. They verify
the downloaded executable with its SHA-512 checksum and install it in~/.dotnetup.
On macOS or Linux, run:
curl -fsSL https://aka.ms/dotnetup/get-dotnetup.sh | bashOn Windows, run:
irm https://aka.ms/dotnetup/get-dotnetup.ps1 | iexTo install the latest daily build on macOS or Linux, run:
curl -fsSL https://aka.ms/dotnetup/get-dotnetup.sh |
bash -s -- --quality dailyTo install the latest daily build on Windows, run:
iex "& { $(irm https://aka.ms/dotnetup/get-dotnetup.ps1) } -Quality daily"[!IMPORTANT]
Daily builds have not completed release validation and are not code-signed.
Use daily builds only for short-lived testing.
The scripts print instructions to add dotnetup to PATH. Open a new terminal
after you apply the instructions.
Run first-time setup
Run the interactive setup:
> dotnetup init
Welcome to dotnetup!
SDK Channel: latest
Mode: <recommended-mode> (Suggested)
<recommended-mode> modifies <configuration-target> to set PATH and DOTNET_ROOT to prefer <install-path>.
Would you like to install .NET with the recommended settings?
> Yes, proceed with defaults and install
Installing SDK <resolved-version> to <install-path>...
<download and installation progress>
Installed at <install-path>:
SDK <resolved-version>
<mode-specific environment guidance>
Setup complete!The paths, progress display, and environment guidance depend on your system and
the selected mode.
The recommended access mode is everywhere on Windows. On macOS and Linux, it
is shell when dotnetup detects a supported shell and none otherwise.
Select No, customize setup to choose the SDK channel, access mode, and
migration options.
Choose an SDK channel
An SDK channel tells dotnetup which SDK to install and how to update it.
| Channel form | Example | Result |
|---|---|---|
| Latest stable | latest |
Latest active stable SDK |
| Latest LTS | lts |
Latest active stable LTS SDK |
| Latest preview | preview |
Latest preview SDK |
| Latest daily | daily |
Latest available daily SDK |
| Major | 10 |
Latest SDK for the specified major version |
| Major and minor | 10.0 |
Latest SDK for the specified major and minor version |
| Feature band | 10.0.1xx |
Latest SDK in the specified feature band |
| Exact version | 10.0.103 |
Only the specified SDK version |
| No initial SDK | none |
Skip installation during setup |
Exact versions do not advance during updates. For all accepted forms, see
dotnetup channels and versions.
Choose how to access .NET
The access mode controls how terminals and applications find the
dotnetup-managed .NET installation.
| Access mode | Behavior |
|---|---|
none |
Does not modify these environment variables. Run .NET with dotnetup dotnet. |
shell |
Modifies the shell profile to set these environment variables. Processes started from that shell use the .NET SDKs and Runtimes installed by dotnetup. |
everywhere |
Modifies the system PATH and sets the user-level DOTNET_ROOT environment variable. Only available on Windows. |
For more details and considerations for everywhere mode, see
dotnetup environment configuration.
Migrate existing installations
Setup can offer to migrate existing machine-wide .NET SDK and Runtime
installations into the dotnetup-managed installation. See
Everywhere mode considerations
for why migration is especially important with everywhere mode.
Verify setup
Open a new terminal after setup changes your environment.
For shell or everywhere mode, run:
dotnet --version
dotnetup listFor none mode, run:
dotnetup dotnet -- --version
dotnetup listRun dotnetup init again to change the setup.
Public documentation
- dotnetup overview
- When to use dotnetup
- Table of contents
- Core concepts
- Download verification
- Release channels
- Troubleshooting
- Telemetry
- CLI reference
- Scenarios
- Update or remove dotnetup
Maintainer documentation
The command reference follows the generated runtime help. Command handlers and
tests verify product behavior. Hidden compatibility and elevation commands are
implementation details. They are not part of the public command reference.
Documentation General Dotnetup Index (`documentation/general/dotnetup/index.md`)
title: dotnetup overview ms.topic: overview ms.date: 08/07/2026
dotnetup overview
[!IMPORTANT]
dotnetupis in public preview. Its features and behavior might change
before general availability.
dotnetup is a cross-platform toolchain manager for user-level .NET
installations. It installs .NET SDKs and runtimes without writing to a
system-managed .NET directory. It also tracks the installation requirements
that you select so that it can update or remove the related files later.
Use dotnetup to:
- Install stable, preview, daily, or exact .NET versions.
- Keep multiple SDK and runtime requirements in one managed installation.
- Install the SDK required by the nearest
global.jsonfile. - Update tracked channels without changing exact-version requirements.
- Configure how terminals and applications find the managed
dotnet. - Run the managed
dotnetwithout changingPATH.
Start
Run the interactive setup:
> dotnetup init
Welcome to dotnetup!
SDK Channel: latest
Mode: Terminal Mode (Suggested)
Would you like to install .NET with the recommended settings?
> Yes, proceed with defaults and install
Downloading SDK <resolved-version>
Installing SDK <resolved-version>
Installed SDK <resolved-version>
Setup complete!The setup asks which SDK channel to install and how you want to access the
managed dotnet command.
For a concise, noninteractive setup, install an SDK and configure the current
shell:
> dotnetup install latest --interactive false
Downloading SDK <resolved-version>
Installing SDK <resolved-version>
Installed SDK <resolved-version>
> dotnetup env set shell
dotnet and dotnetup are on your PATH.
To apply the change to this terminal now, run:
<shell-specific command>
Or open a new terminal.
> dotnetup list
Installations (managed by dotnetup):
<default-installation-root>
Tracked channels:
SDK latest (source: explicit)
Installed versions:
SDK <resolved-version> (<architecture>)
Total: 1
> dotnet --version
<resolved-version>If you do not want to add the managed dotnet command to PATH, use the
forwarding command:
> dotnetup install latest --interactive false
Downloading SDK <resolved-version>
Installing SDK <resolved-version>
Installed SDK <resolved-version>
> dotnetup env set none
dotnetup is on your PATH. dotnet is not — run it with 'dotnetup dotnet <command>'.
Open a new terminal for the change to take effect.
> dotnetup dotnet --version
<resolved-version>The mode, resolved version, architecture, installation path, and shell command
depend on your system and the available releases.
How dotnetup manages .NET
dotnetup tracks the SDK installations that you request. This tracking letsdotnetup update many installations at the same time. It also lets dotnetup
safely remove unused or out-of-support installations.
For more information, see How dotnetup works.
Choose what to read next
| Goal | Article |
|---|---|
| Decide whether dotnetup fits your scenario | When to use dotnetup |
| Install dotnetup and run the first setup | Get started with dotnetup |
| Understand channels, installation roots, and tracking | How dotnetup works |
Use a repository's global.json |
Manage repository SDK requirements |
| Install SDKs and runtimes | Install .NET components |
| Update or remove installations | Update installations |
| Update or remove dotnetup itself | Update or remove dotnetup |
Configure PATH and DOTNET_ROOT |
Manage the dotnetup environment |
| Try preview or daily builds | Use preview and daily builds |
| Learn how downloads are verified | How dotnetup verifies downloads |
| Fix common problems | Troubleshoot dotnetup |
| Learn what data dotnetup collects | dotnetup telemetry |
| Look up command syntax | dotnetup command reference |
Availability
dotnetup is available as a public preview. Commands, options, and behavior
might change between preview releases, and the support lifecycle for the
generally available release isn't final.
To install dotnetup, see Get started with dotnetup. After you
install it, run dotnetup --version to confirm the version anddotnetup --help to see the available commands.
Documentation General Workloads README (`documentation/general/workloads/README.md`)
.NET SDK Workloads
.NET SDK Workloads are optional components of the .NET SDK.
Some of the design docs for workloads are in the dotnet/designs repo:
- .NET Optional SDK Workloads
- MSBuild SDK Resolvers and optional workloads
- .NET SDK Workload Manifests
- Workload installation
Other documentation for workloads is in this repo:
- .NET SDK Workload Rollback
- User local workloads
- Workload manifest fallback
- Preview feature bands
- .NET SDK Installer Finalizer
- Workload description localization
- Grouping multiple packs into one MSI
- Handling workload assets across major .NET versions
- Workload Clean Command
- Workload MSI Installation Tests
- Diagnosing workloads issues
Documentation Manpages Tool README (`documentation/manpages/tool/README.md`)
Manpage update tool
Utility to update dotnet-cli documentation from https://github.com/dotnet/docs.
Docker Usage
If docker is installed, then simply execute run_docker.sh to update manpages.
Prerequisites
- Unix OS
pythonin PATHpandocinstalledpandocfilterspackage installedunzipwgetorcurl
Usage
./update-man-pages.shUbuntu example (from scratch)
apt update
apt install -y jq curl python python-pip wget unzip git < /dev/null
pip install pandocfilters
pandocVersion=$(curl -s https://api.github.com/repos/jgm/pandoc/releases/latest | jq -r ".tag_name")
pandocVersionedName="pandoc-$pandocVersion-1-amd64.deb"
curl -sLO https://github.com/jgm/pandoc/releases/download/$pandocVersion/$pandocVersionedName > /dev/null
dpkg -i $pandocVersionedName
rm $pandocVersionedName*
git clone https://github.com/dotnet/cli
./cli/Documentation/manpages/tool/update-man-pages.shSrc Microsoft.CodeAnalysis.NetAnalyzers Docs Netcore Getting Started (`src/Microsoft.CodeAnalysis.NetAnalyzers/docs/netcore-getting-started.md`)
Getting started with .NET analyzers
The CA#### analyzers live in src/Microsoft.CodeAnalysis.NetAnalyzers, migrated intodotnet/sdk from the retired dotnet/roslyn-analyzers repo. PRs target dotnet/sdk;
servicing fixes target the relevant release/<major>.<minor>.xx branch.
For the step-by-step authoring workflow — ID allocation, resource strings, release
tracking, tests — use theadd-net-analyzer skill andAGENTS.md. This document covers the parts that skill doesn't: the
definition of done, and validating a rule against real code.
Background reading
- The .NET Compiler Platform SDK
overview, for the Roslyn concepts (syntax nodes, tokens, trivia) and the factory APIs. - The analyzer/code-fix tutorial,
which walks an analyzer, a fixer, and unit tests end to end. - Guidelines about new rule ids and docs.
Building
./build.cmd -projects src/Microsoft.CodeAnalysis.NetAnalyzers/Microsoft.CodeAnalysis.NetAnalyzers.slnx -c DebugUse ./build.sh on Linux/macOS. Do not pass -restore/-build alongside -projects;
the driver already implies them and the combination fails. Output lands inartifacts/bin/Microsoft.CodeAnalysis.{,CSharp.,VisualBasic.}NetAnalyzers/<Configuration>/netstandard2.0/.
Definition of done
- Analyzer implemented to work for C# and VB.
- Unit tests for C#:
- All scenarios covered.
- Prefer markup syntax for the majority of tests.
- If your analyzer has placeholders in the diagnostic message and you want to test the arguments, write a smaller number of tests using the
VerifyCS.Diagnosticsyntax to construct specific diagnostic forms.
- Unit tests for VB:
- Obvious positive and negative scenarios covered.
- If the implementation uses any syntax-specific code, then all scenarios must be covered.
- All scenarios covered.
- Unit tests for C#:
- Fixer implemented for C#, using the language-agnostic APIs if possible.
- If the fixer can be entirely implemented with language-agnostic APIs
(IOperation), then VB support is essentially free. - With a language-agnostic fixer, apply the attribute to indicate the fixer also applies to VB and add mainline VB tests.
- If language-specific APIs are needed to implement the fixer, the VB fixer is not required.
- Do not separate analyzer tests from code fix tests. If the analyzer has a code fix, then write all your tests as code fix tests.
- Calling
VerifyCodeFixAsync(source, source)verifies that the analyzer either does not produce diagnostics, or produces diagnostics where no code fix is offered. - Calling
VerifyCodeFixAsync(source, fixedSource)verifies the diagnostics (analyzer testing) and verifies that the code fix on source produces the expected output.
- Calling
- Fix-all is part of the fixer.
WellKnownFixAllProviders.BatchFixerapplies every fix
against the original document and merges the results, which produces a wrong tree when
diagnostics overlap or nest. Derive fromSyntaxEditorBasedCodeFixProvider
instead, and cover the nested case in tests.
- If the fixer can be entirely implemented with language-agnostic APIs
- Run the analyzer locally against
dotnet/runtimeanddotnet/roslyn(instructions).- Review each of the failures in those repositories and determine the course of action for each.
- Use the failures to discover nuance and guide the implementation details.
- Document for review: matching and non-matching scenarios, including any discovered nuance.
- All warnings and errors in these repos are addressed (to prevent build failures).
Infolevel diagnostics do not need to be fully resolved or suppressed as they do not cause build failures.
- Document for review: severity, default, categorization, numbering, titles, messages, and descriptions.
- Create the appropriate documentation for learn.microsoft.com within ONE WEEK, instructions available on Contribute docs for .NET code analysis rules to the .NET docs repository.
- PR merged into
dotnet/sdk. - Validate the analyzer's behavior with end-to-end testing using the command-line and Visual Studio:
- Use
dotnet new consoleanddotnet buildfrom the command-line, updating the code to introduce diagnostics and ensuring warnings/errors are reported at the command-line. - Use Visual Studio to create a new project, introduce diagnostics, and observe the warnings/errors/info messages without invoking a build.
- Use
Validating against a real codebase
Unit tests prove the rule fires. They say nothing about the false-positive rate, which is
what actually decides the RuleLevel and what reviewers will ask about.
Since the analyzers migrated into dotnet/sdk they ship inside the SDK, at<dotnet-root>/sdk/<version>/Sdks/Microsoft.NET.Sdk/analyzers/, laid down byPublishNETAnalyzers inGenerateLayout.targets. A repo that
only sets <AnalysisLevel> consumes that copy, so overwriting the NuGet cache does nothing
for it. A repo that PackageReferences Microsoft.CodeAnalysis.NetAnalyzers is the
reverse: the package carries a props file setting EnableNETAnalyzers=false, which switches
the SDK copy off in its favour. dotnet/runtime does the latter, ineng/Analyzers.targets.
Work out which of the two applies before copying anything.
Either route below changes only what the command line uses. At design time Visual Studio
redirects Microsoft.CodeAnalysis.NetAnalyzers.dll out of the SDK to its own deployed copy
whenever the major and minor versions match, so VS keeps running the shipped analyzers and
your change appears to do nothing. Set DOTNET_ANALYZER_REDIRECTING=0 before launching VS
to suppress it;analyzer-redirecting.md has the
matching rules.
Point the target repo at a locally built SDK
The cleanest route. A full build.cmd produces a complete SDK containing your analyzers:
./build.cmd -c Release
# -> artifacts/bin/redist/Release/dotnetThen run the target repo's build against it, either by setting DOTNET_ROOT and putting
that dotnet first on PATH, or by pointing the target repo's global.json at the
version it contains.
Overwrite the analyzers in an existing SDK
Faster inner loop, and it avoids a full redist build. Build only the analyzer solution,
then copy the three assemblies over the SDK the target repo actually uses — often that
repo's own .dotnet. The copy below is PowerShell; use cp on Linux/macOS.
./build.cmd -projects src/Microsoft.CodeAnalysis.NetAnalyzers/Microsoft.CodeAnalysis.NetAnalyzers.slnx -c Release
$dest = "<target-repo>/.dotnet/sdk/<version>/Sdks/Microsoft.NET.Sdk/analyzers"
Copy-Item artifacts/bin/Microsoft.CodeAnalysis.CSharp.NetAnalyzers/Release/netstandard2.0/*.dll $dest -Force
Copy-Item artifacts/bin/Microsoft.CodeAnalysis.VisualBasic.NetAnalyzers/Release/netstandard2.0/Microsoft.CodeAnalysis.VisualBasic.NetAnalyzers.dll $dest -ForceIf the target repo does pin the Microsoft.CodeAnalysis.NetAnalyzers package, copy into~/.nuget/packages/microsoft.codeanalysis.netanalyzers/<version>/analyzers/dotnet/ instead
— into both cs and vb, since the language-agnostic assembly is duplicated into each
— and build with /p:AssemblyVersion=<version> /p:AutoGenerateAssemblyVersion=false /p:OfficialBuild=true so the assembly version matches what the package declares. Build the
target repo with /bl and
read the binlog
if you are unsure which copy is in play.
dotnet/runtime
Set your rule to warning ineng/CodeAnalysis.src.globalconfig
— e.g. dotnet_diagnostic.CA1234.severity = warning — then build. If nothing fires,
introduce a violation to prove the rule actually ran; pick a project nothing else depends
on, so a deliberate error doesn't cascade.
Triage every hit. Reduce false positives in the analyzer, fix the genuine violations, and
suppress only in rare edge cases.
dotnet/roslyn
dotnet/roslyn builds AnalyzerRunner, which reports diagnostics over a solution without
requiring an analyzer-enabled build of the whole repo.
Build
dotnet/roslyn:./Build.cmd -restore -Configuration Release(theirbuild.shon
Linux/macOS — see roslyn's own docs for its flags).Build the analyzers here in
Debug.From the roslyn root, point
AnalyzerRunnerat the analyzer output directory. It
multi-targets .NET and .NET Framework, so pick the .NET build rather than taking the
first folder underartifacts/bin/AnalyzerRunner/Release/, and launch it throughdotnet execso the path is the same on every platform:powershell$runner = Get-ChildItem artifacts/bin/AnalyzerRunner/Release/*/AnalyzerRunner.dll | Where-Object { $_.Directory.Name -notlike 'net4*' } | Select-Object -First 1 dotnet exec $runner <sdk-repo>/artifacts/bin/Microsoft.CodeAnalysis.CSharp.NetAnalyzers/Debug/netstandard2.0 ` ./Roslyn.slnx /stats /concurrent /a <AnalyzerTypeName> /log Output.txtThe
/avalue is the analyzer type name. Results land inOutput.txt.
Debugging an analyzer inside Visual Studio
- Build the analyzers in
Debugand copy them into the SDK the target project uses, as
above. - Open the project you want to analyze in Visual Studio.
- Analyzers run in
ServiceHub.RoslynCodeAnalysisService.exe; note its process ID.
Code fixes run indevenv.exeinstead — attach to that one to debug aCodeFixProvider. - In a second Visual Studio instance, open
src\Microsoft.CodeAnalysis.NetAnalyzers\Microsoft.CodeAnalysis.NetAnalyzers.slnx, set
your breakpoints, and Debug -> Attach to Process... onto the ID from step 3. - Type in the first instance; the breakpoints should hit. If they don't, either the build
you copied and the solution you attached from are out of sync, or VS redirected the
analyzer — checkDOTNET_ANALYZER_REDIRECTING=0is set.
Documentation TemplateEngine Samples Content 01 Basic Template README (`documentation/TemplateEngine/Samples/content/01-basic-template/README.md`)
The sample in this folder demonstrates:
- How to create a basic template
See template.json
Documentation TemplateEngine Samples Content 02 Add Parameters README (`documentation/TemplateEngine/Samples/content/02-add-parameters/README.md`)
The sample in this folder demonstrates:
- How to create a template with parameters - The parameters are
copyrightNameandtitle
See template.json
Documentation TemplateEngine Samples Content 03 Optional Page README (`documentation/TemplateEngine/Samples/content/03-optional-page/README.md`)
The sample in this folder demonstrates:
- How to have optional content - The contact page is optional
See template.json
Documentation TemplateEngine Samples Content 04 Parameter From List README (`documentation/TemplateEngine/Samples/content/04-parameter-from-list/README.md`)
The sample in this folder demonstrates:
- Creating a parameter based on a list of options - The parameter is used to set the background color of the website
See template.json
Documentation TemplateEngine Samples Content 05 Multi Project README (`documentation/TemplateEngine/Samples/content/05-multi-project/README.md`)
The sample in this folder demonstrates:
- Multi-project template - Console with an optional unit test project
See template.json
Documentation TemplateEngine Samples Content 06 Console Csharp Fsharp README (`documentation/TemplateEngine/Samples/content/06-console-csharp-fsharp/README.md`)
The sample in this folder demonstrates:
- Creating a template that supports multiple languages - Using
groupIdentityto create a console project inC#andF#
In this sample there are two project templates, one using C# and the other F#.
By using groupIdentiy these templates will appear as the same template in the output of dotnet new --list.
To make more than one template appear as the same in dotnet new --list ensure the following:
- Each has a unique value for
identity - Each has the same value for
groupIdentity - Each has the same value for
name - Each has a
languagetag specifying the language supported
See
Documentation TemplateEngine Samples Content 07 Param With Custom Short Name README (`documentation/TemplateEngine/Samples/content/07-param-with-custom-short-name/README.md`)
The sample in this folder demonstrates:
- Customizing parameter names on the CLI
To customize parameter names for the command line (dotnet new), you will create a new file named dotnetcli.host.json.
In that file you can define the long and short name of the parameters, as well as other settings.
See
Note: This sample is the same as 02-add-parameters plus a dotnetcli.host.json file.
Documentation TemplateEngine Samples Content 08 Restore On Create README (`documentation/TemplateEngine/Samples/content/08-restore-on-create/README.md`)
The sample in this folder demonstrates:
- Run
dotnet restoreafter create
Using a post action you can run dotnet restore after the project is created.
In this sample a parameter is configured so the user can skip the restore step if desired.
See
Related
For more info on post actions, including the list of available ones, see ../../../Post-Action-Registry.md.
Documentation TemplateEngine Samples Content 09 Replace Onlyif After README (`documentation/TemplateEngine/Samples/content/09-replace-onlyif-after/README.md`)
The sample in this folder demonstrates:
onlyIf- Shows how you can replace some text on the condition it's preceded by a specified string.
In this sample, we show how you can replace a
From site.css
body {
padding-top: 50px;
padding-bottom: 20px;
background-color: black;
}
/* Set widths on the form inputs since otherwise they're 100% wide */
input,
select,
textarea {
max-width: 280px;
color: black;
}
/* Carousel */
.carousel-caption p {
font-size: 20px;
line-height: 1.4;
color: black
}The sample shows how you can update the black for background-color without impacting the values for color in the following elements.
See template.json
Documentation TemplateEngine Samples Content 10 Symbol From Date README (`documentation/TemplateEngine/Samples/content/10-symbol-from-date/README.md`)
The sample in this folder demonstrates:
- Creating a parameter from the current date/time.
See
Related
Documentation TemplateEngine Samples Content 11 Change String Casing README (`documentation/TemplateEngine/Samples/content/11-change-string-casing/README.md`)
The sample in this folder demonstrates:
- Uppercasing a parameter value.
- Lowercasing a parameter value.
See
Related
Documentation TemplateEngine Samples Content 12 Random Number README (`documentation/TemplateEngine/Samples/content/12-random-number/README.md`)
The sample in this folder demonstrates:
- Creating a random int in a given range.
See
Related
Documentation TemplateEngine Samples Content 13 Constant Value README (`documentation/TemplateEngine/Samples/content/13-constant-value/README.md`)
The sample in this folder demonstrates:
- Creating a value based on a constant.
See
Related
Documentation TemplateEngine Samples Content 14 Guid README (`documentation/TemplateEngine/Samples/content/14-guid/README.md`)
The sample in this folder demonstrates:
- Creating guids in different formats and using those for replacements.
- Replacing guids using the
guidselement intemplate.json
See
Related
Documentation TemplateEngine Samples Content 15 Computed Symbol README (`documentation/TemplateEngine/Samples/content/15-computed-symbol/README.md`)
The sample in this folder demonstrates:
- How to create a computed symbol and use that for conditions
In this sample we define a few parameter in the template.json file. There is also
a computed symbols BackgroundGreyAndDisplayCopyright which combines the value for two parameters. Then this symbol can be used
as a conditional in source files.
Try the sample with the following and compare the results.
dotnet new sample15 -o Sam15 --DisplayCopywrite falsedotnet new sample15 -o Sam15 --DisplayCopywrite true --BackgroundColor aliceblue
See
Documentation TemplateEngine Samples Content 16 String Value Transform README (`documentation/TemplateEngine/Samples/content/16-string-value-transform/README.md`)
The sample in this folder demonstrates using derived parameter to:
- PascalCase a parameter value.
- camelCase a parameter value.
- kebab-case a paremeter value.
- Regex replace a parameter value.
- Chain value forms.
See
Details
- A
derivedtypewith a value transformation is performed using value forms (ValueFormstype). - The sample uses
replace,titleCase,kebabCase,firstLowerCaseInvariantandchainvalue forms. - More value forms can be found in the source code.
Related
Documentation TemplateEngine Samples Content 17 Rename File README (`documentation/TemplateEngine/Samples/content/17-rename-file/README.md`)
The sample in this folder demonstrates:
- How to rename a file and/or folder in your project template
See template.json
See FileToRename.cs
Documentation ProjectJsonToCSProj (`documentation/ProjectJsonToCSProj.md`)
.NET CLI preview 3 is here, and with it comes the .csproj project file format and msbuild engine. The team has put a lot of focus on making the transition as seamless as possible, but as with any change of this magnitude there are some gotcha's to keep in mind. This issue explains how to use the .NET CLI during this transitional period.
Overview
Starting with @coolcsh's great post Changes to Project.json the team has been hard at work moving the .NET command line story from project.json to msbuild. Our plan was fairly straightforward:
- Create a preview3 fork of the CLI
- Temporarily support both project.json and msbuild in the preview3 fork
- This allowed the team to use the CLI to build the new CLI
- msbuild support lit up through
3verbs such asbuild3,publish3,restore3
- Once the msbuild support matures enough to build working applications, remove project.json support
In addition to lighting up the msbuild scenario, the team also provided a migration tool called dotnet migrate that converts project.json files to csproj files.
Where are we now?
The team is feature complete to the plan above. The transition to msbuild is done and the migration tool is already part of the preview3 CLI. Of course there are still many issues to address before we can claim that we're ready to drop the preview suffix, but the core functionality is in place.
How do I...
Until we are ready to call the preview3+ CLI ready for prime-time we find ourselves in a world where it is interesting to work on csproj, project.json, or both. How can we make that work?
How do I keep working with project.json?
Developers who are waiting for the new CLI to ship will continue using the preview2 CLI. As long as they don't install any preview3 or later bits on their machine they will be able to continue using Visual Studio 2015 preview tooling and maintain their existing developer experience.
The preview3 CLI does not offer any benefits for developers that want to keep using project.json for the time being.
How do I work with csproj only?
Developers who want to try out the new csproj / msbuild CLI and don't have project.json-based code to worry about can just install the preview3 tooling. Any build starting at 1.0.0-preview3-004056 is sufficient to get started. Once installed, you can open a command prompt and:
dotnet newto get a new csproj console applicationdotnet restoreto get required nuget packagesdotnet buildto build the projectdotnet runto run the project
How do I work with project.json while trying out csproj?
This scenario presents a few options. First, you can use the dotnet migrate tool to migrate your existing project.json assets to csproj. Alternatively, you can maintain both workflows side-by-side with some care, described below.
How do I migrate project.json to csproj?
I'll start with a warning. Migration is fairly complex and preview3 is the first preview of this capability. The tool will be better in future releases, and it will need your project.json files in order to redo the migration in the future. dotnet migrate moves your project.json assets into a backup folder whose structure matches the layout of your solution. If you intend to migrate with newer tooling in the future then keep this folder in source control so you can put the files back when needed.
To migrate a project open a command prompt and go to the project's root directory. From here, type dotnet migrate and let the tool do its work. For most projects, that's it! There are some special cases where the tool will complain and ask for some help, however:
- Projects are expected to have been updated to the
preview2format forproject.json. If you had noticed the previous CLI complaining aboutdeprecatedproperties, these warnings will need to be cleaned up prior to migration. - Some advanced capabilities, particularly some script variables, do not have an equivalent in the csproj world. The migration tool will ask you to remove these before migration can complete.
Once migration is done you can use the same verbs as before to build, run, publish, etc. your project.
How do I work with project.json and csproj on the same machine?
This is an important scenario, as many folks will keep working with the existing tooling while experimenting with the preview3 implementations.
To work with both project.json and csproj a developer will install two CLIs: one preview2 for project.json and one preview3 for csproj. There will only be one dotnet on the PATH, of course, so the CLI will need some help knowing which version to choose. This is accomplished with the help of the global.json file.
When preview2 shipped the Visual Studio new project templates included both a project.json file and a global.json file. The latter was fairly empty, including project locations and a version property. That version specified the preview2 CLI that shipped with the tools.
{
"projects": [ "src", "test" ],
"sdk": {
"version": "1.0.0-preview2-003121"
}
}We included this file by default as a future-proofing tactic. When the CLI launches it looks for this file in the current directory, or the nearest parent directory, and tries to find a matching version of itself. If an exact match is found then it is used. Otherwise, dotnet.exe picks the latest installed CLI. When there is no exact match AND preview3 is installed then we get into trouble because preview3 cannot reason about project.json files.
When working with preview2 and preview3 on the same machine we need to be sure that preview2 projects have a global.json present and that the version property is set to an installed preview2 version. This will typically be 1.0.0-preview2-003121 or 1.0.0-preview2-003131. You can check what is installed by looking in %PROGRAM FILES%\dotnet\sdk and checking the folder names.
Documentation Migration Issues (`documentation/migration-issues.md`)
Getting help on migration issues
You're using the new .NET Core tools that are MSBuild-based. You took your project.json project and ran dotnet migrate or migrated from Visual Studio 2017...and you maybe ran into problems.
The best way to get help is to file an issue on this repo and we will investigate and provide help and/or fixes as part of new CLI builds. Make sure to read the instructions below and to add the [MIGRATION] prefix to the issue title.
Filing an migration issue
CLI is a very high-traffic repository in terms of issues. In order to be able to respond fast to migration issues, we need the issue to be formatted in a certain way:
- Add
[MIGRATION]:prefix to the title of the issue. - Make sure that we can see your project.json
- If you have a GH repo or this is an OSS project, share the URL to the repo.
- Otherwise attach or paste the project.json contents into the issue.
- Add all of the errors that any operation like
dotnet restore,dotnet buildor others reported. This will help us speedily triage where the potential problem will be. - Add output of
dotnet --infoto the issue so we know what build you are running. - Mention @blackdwarf and @livarcocc in the issue body.
From there on, we will start investigating the issue and respond.
Documentation MigrationPlan CLISDKPlan (`documentation/MigrationPlan/CLISDKPlan.md`)
Given the list from the main migration status page:
- Using Azure DevOps for CI (Done for all repos)
- Using shared toolset (Arcade SDK)
- Engineering dependency flow
- Internal builds from dnceng
CLI
2. Beginning Nov. (Under way)
3. Mid Nov.
4. Eng Nov.
Toolset
2. Mid Nov (Will follow after CLI)
3. Mid Nov
4. Eng Nov
Core-sdk
2. Beginning Nov. (Under way)
3. Mid Nov.
4. Eng Nov.
from @licavalc on 10/30
Documentation TemplateEngine Available Symbols Generators (`documentation/TemplateEngine/Available-Symbols-Generators.md`)
Inside the template.json file, you can define custom symbols that will be used inside the template files.
The supported symbol types are:
- Parameter - the value is typically provided by the user when creating the template. If not provided, the value is taken from host configuration, otherwise default value is used.
- Derived - defines transformation of another symbol. The value of this symbol is derived from the value of another symbol by applying the defined form.
- Computed - the boolean value is evaluated during the processing of the template based on the other symbol values.
- Generated - the value is computed by a built-in symbol value generator.
There are no restrictions on symbol order: e.g. generated/computed/derived symbols can be used in any type of other symbols. The only rule is in avoiding circular dependencies such as:
"symbols": {
"switchCheck": {
"type": "generated",
"generator": "switch",
"datatype": "string",
"parameters": {
"evaluator": "C++",
"cases": [
{
"condition": "(switchCheck2 == 'regions')",
"value": "regions"
}
]
}
},
"switchCheck2": {
"type": "generated",
"generator": "switch",
"datatype": "string",
"parameters": {
"evaluator": "C++",
"cases": [
{
"condition": "(switchCheck == 'regions')",
"value": "regions"
}
]
}
}This article covers available generators for generated symbols.
To use a generated symbol inside your template.json file:
- Add
"type": "generated"to the symbol definition - Use the
"generator": ...parameter to select the generator to use.
This is a sample of definition of a generated symbol, theportgenerator, that generates a random number for an http port.
"IISExpressPortGenerated": {
"type": "generated",
"generator": "port",
"parameters": {
"fallback":"5000"
}
},Most of the generators need to be configured via parameters that let you select the source of the data and select among the options available. Below is a sample of a symbol that uses the now generator to replace a fixed year indication present in the source files with the current year.
"copyrightYear": {
"type": "generated",
"generator": "now",
"replaces": "1975",
"parameters": {
"format": "yyyy"
}
},Available built-in generators for computing generated symbols values are:
| Name | Description |
|---|---|
| casing | Enables changing the casing of a string. |
| coalesce | Behaves like the C# ?? operator. |
| constant | Constant value |
| port | Generate a port number that can be used by web projects. |
| guid | Create a new guid. |
| now | Get the current date/time. |
| random | Generate random int. |
| regex | Process a regular expression. |
| regexMatch | Checks if the value matches the regex pattern. |
| switch | Behaves like a C# switch statement. |
| join | Concatenates multiple symbols or constants. |
Casing
Changes the case of the text of the source value to all upper-case or all lower-case. It does not affect spaces (i.e. does not do any sort of Camel Casing).
Parameters
| Name | Data Type | Description | Mandatory |
|---|---|---|---|
source |
string |
The name of symbol to use as the source of data. | yes |
toLower |
bool |
applies lower case if true, upper case otherwise |
no |
Samples
In this sample three symbols are defined:
ownerNameis a parameter which can be set on the command line usingdotnet newIt has a default value of "John Doe", that will be used if the no value is received from the host. The value will be used to replace "John Smith (a)".nameUpperandnameLowerare the symbols that generate the upperCase and lowerCase version ofownerNamethat are used to replace any instance of "John Smith (U)" and "John Smith (l)".
"symbols":{
"ownerName":{
"type": "parameter",
"datatype":"text",
"replaces": "John Smith (a)",
"defaultValue": "John Doe"
},
"nameUpper":{
"type": "generated",
"generator": "casing",
"parameters": {
"source":"ownerName",
"toLower": false
},
"replaces":"John Smith (U)"
},
"nameLower":{
"type": "generated",
"generator": "casing",
"parameters": {
"source":"ownerName",
"toLower": true
},
"replaces":"John Smith (l)"
}
}Related
Coalesce
Behaves like the C# ?? operator. Note: the empty string value and default value of value type is treated as null.
The typical use of this generator is to check if the parameter was provided by user, otherwise set fallback generated value.
Parameters
| Name | Data Type | Description | Mandatory |
|---|---|---|---|
sourceVariableName |
string |
the symbol name which is a primary source of data (left operand of coalesce) |
yes |
fallbackVariableName |
string |
the symbol name which is an alternate source of data(right operand of coalesce) |
yes |
defaultValue |
string |
The default value. In case it is specified, and primary source is equal to this value, the fallback value will be used. | no |
Samples
In this sample three symbols are defined:
MessageYear- is a parameter set by the user when callingdotnet new.ThisYear- use the now generator to calculate the current year.YearReplacer- ensures that any occurrence of "1234" is replaced. IfMessageYearwas passed in by the user that value will be used. OtherwiseThisYearwill be used.
"symbols":{
"MessageYear":{
"type": "parameter",
"datatype":"int"
},
"ThisYear":{
"type": "generated",
"generator": "now",
"parameters": {
"format": "yyyy"
}
},
"YearReplacer": {
"type": "generated",
"generator": "coalesce",
"parameters": {
"sourceVariableName": "MessageYear",
"fallbackVariableName": "ThisYear"
},
"replaces": "1234"
}
}Related
Constant
Uses constant value.
Parameters
| Name | Data Type | Description | Mandatory |
|---|---|---|---|
value |
string |
constant value | yes |
Samples
myConstant is a symbol that replaces "1234" with "5001"
"symbols":{
"myConstant": {
"type": "generated",
"generator": "constant",
"parameters": {
"value":"5001"
},
"replaces":"1234"
}
}Related
Port
Gets an available port number on the machine.
During evaluation looks for a valid free port number trying to create a socket, and in case of problems, returns the value defined in the fallback parameter.
Parameters
| Name | Data Type | Description | Mandatory |
|---|---|---|---|
high |
integer |
defined the high bound of range to select port from. The maximum value is 65535. If greater value is specified, 65535 is used instead. |
no, default: 65535 |
low |
integer |
defined the low bound of range to select port from. The minimum value is 1024. If less value is specified, 1024 is used instead. |
no, default: 1024 |
fallback |
integer |
fallback value | no, default: 0 |
Note: if low > high, the default values for low and high are used: 1024 - 65535.
The following ports are reserved:
- 1719 - H323 (RAS)
- 1720 - H323 (Q931)
- 1723 - H323 (H245)
- 2049 - NFS
- 3659 - apple-sasl / PasswordServer [Apple addition]
- 4045 - lockd
- 4190 - ManageSieve [Apple addition]
- 5060 - SIP
- 5061 - SIPS
- 6000 - X11
- 6566 - SANE
- 6665 - Alternate IRC [Apple addition]
- 6666 - Alternate IRC [Apple addition]
- 6667 - Standard IRC [Apple addition]
- 6668 - Alternate IRC [Apple addition]
- 6669 - Alternate IRC [Apple addition]
- 6679 - Alternate IRC SSL [Apple addition]
- 6697 - IRC+SSL [Apple addition]
- 10080 - amanda
Samples
In this sample KestrelPortGenerated is a symbol that return the number of an available port or 5000.
"KestrelPortGenerated": {
"type": "generated",
"generator": "port"
"parameters": {
"fallback":"5000"
}
},Related
Guid
Note: Guids section in template.json can be used to achieve same goals with easier configuration
Creates a formatted guid for a replacement. To configure the output format of the macro you can use the defaultFormat parameter that accepts a single value from {'n', 'd', 'b', 'p', 'x'} for lowercase output or {'N', 'D', 'B', 'P', 'X'} for uppercase output. The formats are defined in Guid.ToString() method documentation
Parameters
| Name | Data Type | Description | Mandatory |
|---|---|---|---|
defaultFormat |
string |
format descriptor | no, default: D |
Samples
This sample creates different symbols showing the different formatting available for the generated guid.
"symbols":{
"id01":{
"type": "generated",
"generator": "guid",
"replaces": "myid01",
"parameters": {
"defaultFormat":"N"
}
},
"id02":{
"type": "generated",
"generator": "guid",
"replaces": "myid02",
"parameters": {
"defaultFormat":"D"
}
},
"id03":{
"type": "generated",
"generator": "guid",
"replaces": "myid03",
"parameters": {
"defaultFormat":"B"
}
},
"id04":{
"type": "generated",
"generator": "guid",
"replaces": "myid04",
"parameters": {
"defaultFormat":"P"
}
},
"id05":{
"type": "generated",
"generator": "guid",
"replaces": "myid05",
"parameters": {
"defaultFormat":"X"
}
}
}Related
Implementation classGuid Format Documentation
Guids section in template.json
Now
Creates a symbol from the current date/time.
Parameters
| Name | Data Type | Description | Mandatory |
|---|---|---|---|
format |
string |
DateTime.ToString() format |
no |
utc |
bool |
UTC time if true, local time otherwise |
no |
Samples
In this sample a symbol is created showing the current data, and replacing any instance of "01/01/1999"
"symbols":{
"createdDate": {
"type": "generated",
"generator": "now",
"parameters": {
"format": "MM/dd/yyyy"
},
"replaces":"01/01/1999"
}
}Related
Implementation classDateTime.ToString documentationSample
Random
Creates a random integer value in a specified range.
Parameters
| Name | Data Type | Description | Mandatory |
|---|---|---|---|
low |
integer |
lower inclusive bound | yes |
high |
integer |
upper exclusive bound | no, default:int.MaxValue |
Samples
This sample shows a symbol that generates a value from 0 to 10000 excluded, and replace any instance of 4321
"symbols":{
"myRandomNumber":{
"type": "generated",
"generator": "random",
"parameters": {
"low": 0,
"high": 10000
},
"replaces": "4321"
}
}Related
Regex
Defines a list of data manipulation steps based on regex expressions.
Parameters
| Name | Data Type | Description | Mandatory |
|---|---|---|---|
source |
string |
the symbol to transform | yes |
steps |
array |
replacement steps | yes |
steps element definition:
| Name | Data Type | Description | Mandatory |
|---|---|---|---|
regex |
string, regex pattern |
selection pattern | yes |
replacement |
string |
the replacement value for matched pattern | yes |
Samples
"symbols": {
"regexExample": {
"type": "generated",
"generator": "regex",
"dataType": "string",
"replaces": "A different message", //The value to replace in the output
"parameters": {
"source": "message", //The name of the symbol whose value should be operated on
"steps": [
{
"regex": "^test", //The regular expression whose matches will be replaced with '[Replaced]`
"replacement": "[Replaced]" //The value to replace matches of the expression '^test' with
},
{
"regex": "test$",
"replacement": "[/Replaced]"
}
]
}
}
}Related
Implementation classRegEx.Replace Documentation
RegexMatch
Tries to match regex pattern against value of source symbol and returns true if matched, otherwise false.
Parameters
| Name | Data Type | Description | Mandatory |
|---|---|---|---|
source |
string |
the symbol to attempt to match value | yes |
pattern |
string, regex pattern |
the regex match pattern | yes |
Samples
"symbols": {
"isMatch": {
"type": "generated",
"generator": "regexMatch",
"dataType": "bool",
"replaces": "test.value1",
"parameters": {
"source": "name",
"pattern": "^hello$"
}
}
}Related
Implementation classRegex.IsMatch Documentation
Switch
Defines a set of conditions to be evaluated, and the value to return if the condition is met. The first condition to evaluate to true is used. To include a default case, add a condition that always evaluates to true as the last entry in cases.
Parameters
| Name | Data Type | Description | Mandatory |
|---|---|---|---|
cases |
array |
choices to evaluate | yes |
evaluator |
enum: C++2, C++, MSBuild, VB |
expression evaluation engine | no, default: C++2 |
cases definition
| Name | Data Type | Description | Mandatory |
|---|---|---|---|
condition |
string |
the condition to evaluate, keep empty for default clause. | no |
value |
string |
the value to return, if condition evaluates to true |
yes |
Samples
This sample shows how to change the replacement value based on evaluating conditions using other symbols:
"symbols": {
"test": {
"type": "parameter",
"datatype": "string"
},
"example": {
"type": "generated",
"generator": "switch",
"replaces": "abc",
"parameters": {
"evaluator": "C++",
"datatype": "string",
"cases": [
{
"condition": "(test == '123')",
"value": "456"
},
{
"condition": "(test == '789')",
"value": "012"
}
]
}
}
}In this case, if the user enters the value 123 as the value of the parameter test, abc in the content will be replaced with 456, if the user enters 789, abc is replaced with 012 instead.
Related
Join
Concatenates multiple symbols or constants with the defined separator into a new symbol.
Parameters
| Name | Data Type | Description | Mandatory |
|---|---|---|---|
symbols |
array |
defines the values to concatenate | yes |
separator |
string |
the value used as the separator between the values to be concatenated, notice that you can use / as folder separator also on Windows, since File API will convert it into \ |
no |
removeEmptyValues |
bool |
indicates whether the empty values should be skipped or honored. By default this switch is off - leading to multiple consecutive separators in output string in case that same input values are null or empty | no |
symbols definition
| Name | Data Type | Description | Mandatory |
|---|---|---|---|
type |
enum: ref, const |
ref indicates that the value is referenced from another symbol const - the value is a string constant |
no, default: const |
value |
string |
either a name of another symbol or string constant | yes, should be not empty or whitespace when type is ref |
Samples
This sample shows how to change the replacement value based on evaluating conditions using other symbols:
"symbols": {
"company": {
"type": "parameter",
"dataType": "string",
"defaultValue": "Microsoft"
},
"product": {
"type": "parameter",
"dataType": "string",
"defaultValue": "Visual Studio"
},
"joinedRename": {
"type": "generated",
"generator": "join",
"fileRename": "Api",
"parameters": {
"symbols": [
{
"type": "const",
"value": "Source"
},
{
"type": "const",
"value": "Api"
},
{
"type": "ref",
"value": "company"
},
{
"type": "ref",
"value": "product"
}
],
"separator": "/",
"removeEmptyValues": true
}
}
}This sample will rename folder called Api into Source/Api/Microsoft/Visual Studio. Notice that File API will automatically change / into \ on Windows.
Joining multi-choice symbol values:
template.json:
"symbols": {
"Platform": {
"type": "parameter",
"description": "The target framework for the project.",
"datatype": "choice",
"allowMultipleValues": true,
"choices": [
{
"choice": "Windows",
"description": "Windows Desktop"
},
{
"choice": "WindowsPhone",
"description": "Windows Phone"
},
{
"choice": "MacOS",
"description": "Macintosh computers"
},
{
"choice": "iOS",
"description": "iOS mobile"
},
{
"choice": "android",
"description": "android mobile"
},
{
"choice": "nix",
"description": "Linux distributions"
}
],
"defaultValue": "MacOS|iOS"
},
"joinedRename": {
"type": "generated",
"generator": "join",
"replaces": "SupportedPlatforms",
"parameters": {
"symbols": [
{
"type": "ref",
"value": "Platform"
}
],
"separator": ", ",
"removeEmptyValues": true,
}
}
}Program.cs:
// This file is generated for platform: SupportedPlatformsThis sample will expand and join values of Platform argument and replace SupportedPlatforms string with MacOS, iOS:
Program.cs:
// This file is generated for platform: MacOS, iOSRelated
Documentation TemplateEngine Available Templates For Dotnet New (`documentation/TemplateEngine/Available-templates-for-dotnet-new.md`)
To search for the templates available on NuGet.org, use dotnet new search.
dotnet new search web
dotnet new search azure --type project
dotnet new search azure --author MicrosoftTo ensure that the template package appears in dotnet new search result, set the NuGet package type to Template.
Note: In order to show templates preinstalled with SDK and installed manually run the dotnet new list.
dotnet new list
dotnet new list --author Microsoft
dotnet new list web
dotnet new list web --type projectBelow is a list of selected NuGet.org templates which are available for use with dotnet new:
C# Templates
| Name | Quick Install |
|---|---|
| .NET Boxed | dotnet new install "Boxed.Templates" |
| Auth0 Templates | dotnet new install Auth0.Templates |
| AWS Lambda .NET Core Templates | dotnet new install "Amazon.Lambda.Templates" |
| Avalonia UI Templates - Avalonia is a framework for creating cross platform UI | dotnet new install "Avalonia.Templates" |
| Blazor - Full stack web development with C# and WebAssembly | dotnet new install "Microsoft.AspNetCore.Blazor.Templates::3.0.0-*" |
| Cake.Frosting | dotnet new install "Cake.Frosting.Template" |
| Carter - Carter is a library that allows Nancy-esque routing for use with ASP.Net Core. | dotnet new install "CarterTemplate" |
| CleanBlazor - Minimal Blazor projects. Standard Blazor project templates minus any boilerplate assets (e.g. Bootstrap, Counter.razor, etc.) | dotnet new install "FriscoVInc.DotNet.Templates.CleanBlazor" |
| cloudscribe | dotnet new install "cloudscribe.templates" |
| DotVVM - Open source MVVM framework for line of business web applications | dotnet new install "DotVVM.Templates" |
| Eto.Forms | dotnet new install "Eto.Forms.Templates" |
| GCC.Build - C/C++/CPP/VCXPROJ Build Template using GCC/G++/EMCC or your favorate compiler | dotnet new install GCC.Build.Template |
| Geco - C# 6 Interpolated strings based Code Generator | dotnet new install "iQuarc.Geco.CSharp" |
| GtkSharp | dotnet new install "GtkSharp.Template.CSharp" |
| IdentityServer4.Templates | dotnet new install "identityserver4.templates" |
| Kentico Cloud Boilerplate | dotnet new install "KenticoCloud.CloudBoilerplateNet" |
| MonoGame (.NET Core) | dotnet new install "MonoGame.Templates.CSharp" |
| MSBuild extension | dotnet new install "MSBuildExtensionTemplate" |
| MvxScaffolding Templates - MvvmCross Xamarin native and Xamarin Forms templates. | dotnet new install "MvxScaffolding.Templates" |
| NancyFX Template | not on nuget.org |
| NSpec Templates | dotnet new install "dotnet-new-nspec" |
| NUnit 3 Test Project Template | dotnet new install "NUnit3.DotNetNew.Template" |
| Paulovich.Caju - .NET applications with Event Sourcing, Hexagonal or Clean Architectures styles | dotnet new install "Paulovich.Caju" |
| Paulovich.Manga - Clean Architecture for .NET Applications! | dotnet new install "Paulovich.Manga" |
| Particular Templates - Templates targeting NServiceBus and other tools and libraries from Particular Software | dotnet new install "ParticularTemplates" |
| Pioneer Console Boilerplate - Boilerplated .NET Core console application that includes dependency injection, logging and configuration. | dotnet new install "Pioneer.Console.Boilerplate" |
| PowerShell Core | dotnet new install "FiftyProtons.Templates.PSCore" |
| Prism Forms QuickStarts - Empty & QuickStart project Templates for Prism for Xamarin Forms. Requires dotnet cli 2.0 pre3+ | dotnet new install "Prism.Forms.QuickstartTemplates" |
| Raspberry Pi 3 - C# template for .NET Core 2 IoT applications. | dotnet new install "RaspberryPi.Template" |
| ServiceStack | dotnet new install "ServiceStack.Core.Templates" |
| SpecFlow.Templates.DotNet - A project template for creating executable specifications with SpecFlow. You can choose from different .NET frameworks and test frameworks. | dotnet new install "SpecFlow.Templates.DotNet" |
Template templates - Templates to create new project and item templates. Requires new3. |
dotnet new install "FiftyProtons.Templates.DotNetNew" |
| Zahasoft Templates | dotnet new install "Zahasoft.Skele" |
| ASP.NET Core Web API (extended) | dotnet new install "Popov1024.HttpApi.Template.CSharp" |
| ASP.NET Core Web API for AKS - A template for creating a fully-featured, 12 Factor, ASP.NET Core Web API for AKS | dotnet new install "RobBell.AksApi.Template" |
| HoNoSoFt.DotNet.Web.Spa.ProjectTemplates (VueJs + Picnic CSS) | dotnet new install "HoNoSoFt.DotNet.Web.Spa.ProjectTemplates" |
| xUnit Test Template - Adds a xUnit test file to an existing test project. | dotnet new install GatewayProgrammingSchool.xUnit.CSharp |
| RocketMod Plugin Templates RocketMod is a plugin framework for .NET based games. This template allows to quickly get started with a new RocketMod Plugin. | dotnet new install "Rocket.Templates" |
| EISK Web Api - ASP.NET Core templates with simple use cases to build scalable web api with architectural best practices (DDD, Onion Architecture etc). | dotnet new install "eisk.webapi" |
| OpenMod Plugin Templates - OpenMod is .NET plugin framework. These templates allow user to quickly get started with a new OpenMod Plugin. | dotnet new install "OpenMod.Templates" |
F# Templates
| Name | Quick Install |
|---|---|
| ASP.NET Core WebAPI F# Template | dotnet new install "WebAPI.FSharp.Template" |
| Bolero: F# in WebAssembly | dotnet new install Bolero.Templates |
| Eto.Forms | dotnet new install "Eto.Forms.Templates" |
| Expecto Template | dotnet new install "Expecto.Template" |
| F# TypeProvider Template | dotnet new install FSharp.TypeProviders.Templates |
| Fable-elmish | dotnet new install "Fable.Template.Elmish.React" |
| Fable, F# |> Babel | dotnet new install "Fable.Template" |
| Fable Library - F# Template for creating and publishing Fable libraries | dotnet new install "Fable.Template.Library" |
| Fabulous for Xamarin.Forms | dotnet new install Fabulous.XamarinForms.Templates |
| Freya | dotnet new install "Freya.Template" |
| Giraffe Template | dotnet new install "giraffe-template" |
| GtkSharp | dotnet new install "GtkSharp.Template.FSharp" |
| Interstellar | dotnet new install "Interstellar.Template" |
| MiniScaffold - F# Template for creating and publishing libraries targeting .NET Full (net45) and Core (netstandard1.6) | dotnet new install "MiniScaffold" |
| NancyFx | dotnet new install "NancyFx.Core.Template" |
| SAFE Template | dotnet new install "SAFE.Template" |
| vbfox's F# Templates | dotnet new install "BlackFox.DotnetNew.FSharpTemplates" |
| WebSharper | dotnet new install "WebSharper.Templates" |
VBNet Templates
| Name | Quick Install |
|---|---|
| GtkSharp | dotnet new install "GtkSharp.Template.VBNet" |
| InteXX Assorted Templates | dotnet new install "Intexx.Templates" |
Documentation TemplateEngine Binding And Project Context Evaluation (`documentation/TemplateEngine/Binding-and-project-context-evaluation.md`)
Binding and project context evaluation
Overview
Since .NET SDK 7.0.100 template engine supports binding of symbols to various external sources, including MSBuild properties of the current project.
The feature is available for both dotnet new and Visual Studio.
`bind` symbols
The symbol binds value from external sources.
By default, the following sources are available:
- host parameters - parameters defined at certain host. For .NET SDK the following parameters are defined:
HostIdentifier: dotnetcli,GlobalJsonExists: true/false,WorkingDirectory: <dotnet_new_context_directory>. Binding syntax ishost:, example:host:HostIdentifier. - environment variables - allows to bind environment variables. Binding syntax is
env:<environment variable name>, example:env:MYENVVAR.
It is also possible to bind the parameter without the prefix as a fallback behavior: HostIdentifier, MYENVVAR.
The priority of the sources are following:
- host parameters: 100
- environment variables: 0
The higher value indicates higher priority.
| Name | Description | Mandatory |
|---|---|---|
type |
bind |
yes |
binding |
Mandatory. The name of the source and parameter in the source to take the value from. The syntax follows: :. |
yes |
replaces |
The text to be replaced by the symbol value in the template files content. | no |
fileRename |
The portion of template filenames to be replaced by the symbol value. | no |
defaultValue |
The value assigned to the symbol if no value was provided from external source(s). Recommended to be used when replaces and/or fileRename is used. In case default value is not specified and no value was provided from external source(s) the replacement won't be performed. |
no |
dataType |
The value assigned to the symbol if no value was provided from external source(s). Allowed values are: "bool", "float", "int", "hex", "text", "string". If not specified, the value type will be inferred. In case the type of values might be ambiguous, consider specifying the desired datatype for processing. In case the conversion of value to the type fails, the symbol will be skipped from further processing. For more information about supported data types and their restrictions, refer to data type description for parameter symbols. | no |
Example
"symbols": {
"HostIdentifier": {
"type": "bind",
"binding": "host:HostIdentifier"
},
"WorkingDirectory": {
"type": "bind",
"binding": "host:WorkingDirectory"
}
}Binding to MSBuild properties
It is possible to bind symbols to MSBuild properties of the current project. The prefix to be used: msbuild and it is mandatory.
Commonly used with item templates to get the information about the project it is added to.
dotnet new attempts to find the closest project file using following rules:
- The project in current directory or
--outputdirectory (matching*.*projextension). - If not found, the parent of above and so on.
- The path to the project can be explicitly specified using
--projectinstantiation option. This path takes precedence - so it can be used in case of ambiguity.
Once project is located, its MSBuild properties are evaluated. The project should be restored, otherwise evaluation fails.
Only .NET SDK-style projects are supported.
It is recommended to configure defaultValue for bind symbol that will be used in case evaluation fails.
If applicable, it is also recommended to use project capability constraint to define the projects that the template can be added to.
Example - binds DefaultNamespace symbol to RootNamespace of the project:
"symbols": {
"DefaultNamespace": {
"type": "bind",
"binding": "msbuild:RootNamespace",
"replaces": "%NAMESPACE%",
"defaultValue": "TestNamespace"
}
},
"constraints": {
"csharp-only": {
"type": "project-capability",
"args": "CSharp + TestContainer" // only allowed in C# test project
}
}Visual Studio specifics
Visual Studio supports binding to host parameters, environment variables and MSBuild properties.
In addition to that, there is additional context source supporting:
context:createsolutiondirectory- indicates whether a solution directory is to be created as a result of project creation (Place solution and project in same directory is UNCHECKED in NPD).context:isexclusive- indicates whether the template instantiation is a result of a new project being created (true) vs result of adding to an existing solution (false).context:solutionname- the name of the solution, which may be different from the project name.
Visual Studio also provides a way to bind to "namespace" via host parameters source:
"type": "bind"
"binding": "namespace"or
"type": "bind"
"binding": "host:namespace"Documentation TemplateEngine Blog Posts (`documentation/TemplateEngine/Blog-posts.md`)
- How to create your own templates for
dotnet newby @sayedihashimi - Announcing .NET Core (includes how to use
dotnet new) by @sayedihashimi - Trying out "dotnet new" template updates and csproj with VS2017 by @shanselman
- Custom Project Templates Using dotnet new by @RehanSaeed
- dotnet new Feature Selection by @RehanSaeed
- Building a Solution with dotnet cli nuget templates by @motowilliams
- Building And Debugging The dotnet new Templating Engine In Visual Studio by @chad-ramos
- How To Create A dotnet new Project Template In .NET Core - @chad-ramos
Documentation TemplateEngine Conditional Processing And Comment Syntax (`documentation/TemplateEngine/Conditional-processing-and-comment-syntax.md`)
Table of contents
- Introduction
- Known Issues
- Language Source Files
- JSON Files
- XML Files
- MSBuild Files
- Single hash line comments
- CSS Files
- Command Files
- Razor Views
- Haml Files
- Jsx Files
- Other File Types
Introduction
To add conditional, or dynamic, content you can add Template Engine expressions in your source files. The conditional expression lets you include or exclude part of the file according to a specified condition, and to do this you can use the familiar conditional expressions like #if, #else, #elseif, #endif.
To learn more about conditional expressions evaluation go to Conditions description.
| Name | Description |
|---|---|
| Language files | Common Dotnet language source files. |
| JSON files | Common Json type files. |
| XML files | Common Xml and *tml type files. |
| MSBuild files | MSBuild project files. |
| Single hash line comments | Common file types that use single hash line comment syntax. |
| Css files | Css Files. |
| Command files | Windows command Files. |
| Razor Views | Razor View files. |
| Haml Files | Haml files. |
| JSX Files | Jsx and Tsx files. |
| Other File | Default rules for file type not in this list. |
Known Issues
| Name | Description | Incorrect Use | Correct Use |
|---|---|---|---|
| Conditional statement overlaps with Replacement functionality | There is a problem with using different types of conditional comments in replacement statements. In order to workaround it avoid using comments (e.g. "//") as a part of the candidate string for replacing. | "http://localhost:" | "localhost:" |
File Extensions
.cs, .fs,.cpp, .h, .hpp, .cake.
In these file types you can use a preprocessor directive.
Samples
In this sample, according to the value of the IndividualB2CAuth and OrganizationalAuth the appropriate service is added.
#if (IndividualB2CAuth)
services.AddAzureAdB2CBearerAuthentication();
#elseif (OrganizationalAuth)
services.AddAzureAdBearerAuthentication();
#endifC# Sample
In this sample, using the parameter symbol addMethod we include the definition of a new method, and its use inside the main function.
namespace MyProject.Con
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Hello World!");
#if( addMethod )
HelloWordAgain();
#endif
}
#if( addMethod )
static void HelloWordAgain() {
Console.WriteLine("Hello World Again!");
}
#endif
}
}C++ Sample
In this sample, using the parameter symbol addMethod we include the definition of a new class, and its use inside the main function.
#include "stdafx.h"
#include <string>
#include <iostream>
using namespace std;
#if( addMethod )
class HelloClass
{
public:
HelloClass() {
}
~HelloClass()
{
}
void HelloWordAgain() {
cout << "Hello World Again!";
}
};
#endif
int main()
{
cout << "Hello World!";
#if( addMethod )
HelloClass *hello = new HelloClass();
hello->HelloWordAgain();
#endif
return 0;
}F# Sample
In this sample, using the parameter symbol addMethod we include the definition of a new method, and its use inside the main function.
open System
#if( addMethod )
let helloWorldAgain =
printfn "HelloAgain"
#endif
[<EntryPoint>]
let main argv =
printfn "Hello World from F#!"
#if( addMethod )
helloWorldAgain
#endif
0 // return an integer exit codeFile Extensions
.vb.
For Visual Basic file the expressions must be preceded by a ' comment and conditional expressions are #If, #ElseIf, #Else, #End If.
Visual Basic Sample
In this sample, using the parameter symbol addMethod we include the definition of a new method, and its use inside the main function.
Module Module1
Sub Main()
Console.WriteLine("Hello World!")
'#If( addMethod )
HelloWorldAgain()
'#End If
End Sub
'#If( addMethod )
Sub HelloWorldAgain()
Console.WriteLine("Hello World Again!")
End Sub
'#End If
End ModuleFile Extensions
.js,.ts.
With these file types the expressions must be preceded by a // comment .
JavaScript Sample
In this sample, using the parameter symbol addMethod we include the definition of a new method, and its use inside the main function.
(function () {
//#if( addMethod )
function helloWorldAgain() {
console.log("Hello World Again!");
}
//#endif
console.log("Hello World!");
//#if( addMethod )
helloWorldAgain();
//#endif
})();TypeScript Sample
In this sample, using the parameter symbol addMethod we include the definition of a new method, and its use inside the constructor.
class Student {
constructor() {
console.log("Hello World!");
//#if( addMethod )
this.helloWorldAgain();
//#endif
}
//#if( addMethod )
public helloWorldAgain(): void {
console.log("Hello World Again!");
}
//#endif
}Ignore conditions expressions in language files
Template engine attempts to process all conditional statements in language files. In case conditions should not be processed by template engine, this should be explicitly specified.
There are two ways to do it:
- disable processing for the whole file
- disable processing for the part of the file
If the file should never be processed by template engine, it can be specified as copyOnly in the sources section of the template.json. For example:
"sources": [
{
"modifiers": [
{
"copyOnly": [ "Directory.Build.props" ]
}
]
}
],If template engine should not process only part of the file, but other parts should be processed, the conditional processing can be turned off for the section that should not be processed by using directives:
//-:cnd:noEmit
//+:cnd:noEmit
The part // is the prefix to use for turning operations on and off in language files. The name cnd is the name of the operation to turn on/off. The - and + near the beginning of these lines indicate that the operation should be turned off, and on, respectively. The noEmit part tells templating to not process this line.
For example:
#if DEBUG
Comet.Reload.Init();
#endif
//-:cnd:noEmit
#if DEBUG
Xamarin.Calabash.Start();
#endif
//+:cnd:noEmitWhen invoking the template with the above content, the output looks like this:
#if DEBUG
Xamarin.Calabash.Start();
#endifThe first expression is not emitted because it is processed, and the condition evaluated to false. The second expression is copied as-is because the conditional processing is turned off for that part of the file.
Related
C# Sample
C++ Sample
F# Sample
VB Sample
JavaScript Sample
TypeScript Sample
JSON Files
For .json files, the comment block starts with // or //// to the end of the line. After this marker you can add the conditional expressions.
The choice between // or //// is very important because it lets you choose between different actions to be executed when the condition is met: in the first case the content in the expression is simply rendered into the output files as is, while in the second a different action can be executed, by default uncommenting removing an eventual leading //.
File Extensions
.json, .jsonld, .hjson, .json5, .geojson, .topojson, .bowerrc, .npmrc, .job, .postcssrc, .babelrc, .csslintrc, .eslintrc, .jade-lintrc, .pug-lintrc, .jshintrc, .stylelintrc, .yarnrc.
Samples
In this sample, we see the difference between the two ways to define conditional expression.
If the initial #if condition is preceded by // so, if param1 == true, rows below are copied as is.
second condition #elseif, is preceded by ////, so if param1 == false and param2 == true, rows below will be copied after the leading // has been removed, resulting in
// comment related to the 'elseif' content
content for when param2 is true and param1 is falsethe latest condition, #else, is preceded by ////, so the comments will removed, resulting in
// comment related to the 'else' content
content for when both param1 & param2 are falseChanging from ////#else to //#else the result will be
//// comment related to the 'else' content
// content for when both param1 & param2 are false//#if (param1)
// comment related to the 'if' content
default content // also appropriate if param1 is true
////#elseif (param2)
//// comment related to the 'elseif' content
//content for when param2 is true and param1 is false
////#else
//// comment related to the 'else' content
// content for when both param1 & param2 are false
//#endifRelated
XML Files
File Extensions
.*htm, .*html, .jsp, .asp, .aspx, .nuspec, .xslt, .xsd, .vsixmanifest, .vsct, .storyboard, .axml, .plist, .xib, .strings, .xml, .xaml, .axaml, .md, .appxmanifest.
Well known XML file names
app.config, web.config, web.\*.config, packages.config, nuget.config.
the comment block starts with ``. Inside this block you can add your conditional expressions.
Samples
In this sample, conditional expression is inside the comment `` in the same line. According to the value of the IndividualLocalAuth and UseLocalDB symbol, an element is added.
<SomeXmlHere>true</SomeXmlHere>In this sample, conditional expression is inside the comment `` in a block.
Related
MSBuild Files
File Extensions
.*proj, .proj.user, .msbuild, .targets, .props
MSBuild files, in addition to the #if, #else, #elseif, #endif inside an xml type comment, a Condition expression could be added to an element.
Samples
In this sample, one
<TargetFramework Condition="'$(TargetFrameworkOverride)' == ''">netcoreapp2.0</TargetFramework>
<TargetFramework Condition="'$(TargetFrameworkOverride)' != ''">TargetFrameworkOverride</TargetFramework>In this sample, we can see that if the TargetFrameworkOverride symbol is defined all the package references are added to the project file.
<ItemGroup Condition="'$(TargetFrameworkOverride)' == ''">
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.0-preview2-final" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="2.0.0-preview2-final" PrivateAssets="All" Condition="'$(IndividualAuth)' == 'True'" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="2.0.0-preview2-final" PrivateAssets="All" Condition="'$(IndividualAuth)' == 'True'" />
</ItemGroup>In this snippet of MSBuild file, we see usage of conditional expression embedded inside a xml comment.
<ItemGroup>
<None Update="Company.WebApplication1.db" CopyToOutputDirectory="PreserveNewest" />
</ItemGroup>Ignore conditions expressions in MSBuild files
Template engine attempts to process all conditional statements in MSBuild files. In case conditions should not be processed by template engine, this should be explicitly specified.
There are two ways to do it:
- disable processing for the whole file
- disable processing for the part of the file
If the file should never be processed by template engine, it can be specified as copyOnly in the sources section of the template.json. For example:
"sources": [
{
"modifiers": [
{
"copyOnly": [ "Directory.Build.props" ]
}
]
}
],If template engine should not process only part of the file, but other parts should be processed, the conditional processing can be turned off for the section that should not be processed by using directives:
``
``
The part `
<Foo Condition="'$(OS)' != 'Windows_NT'">Bar</Foo>When invoking the template with the above content in `Directory.Build.props`, the output looks like this:<Foo Condition="'$(OS)' != 'Windows_NT'">Bar</Foo>The first `<Foo Condition...` is copied as-is because the `msbuild-conditional` processing is turned off for that part of the file. But the second one is not emitted because it is processed, and the condition evaluated to `false`.
### Related
[Sample](../../test/TestAssets/TestPackages/TemplateEngine/test_templates/TemplateConditionalProcessing/Test.csproj)
## Single hash line comments
#### File Extensions
`.sln`, `.yml`, `.yaml`, `.sh`, `.ps1`
#### Well-known file names
`.dockerignore`, `.gitignore`, `.gitattributes`, `.editorconfig`, `Dockerfile`, `nginx.conf`, `robots.txt`.
### Samples
For solution files, the comment block starts with # to the end of the line. After this marker you can add the conditional expressions.
```.gitignore
#if (symbol-name == "value")
stuff
#endifIn this sample, using the parameter useSSL add configuration for the 443 port inside nginx configuration
http {
include /etc/nginx/proxy.conf;
limit_req_zone $binary_remote_addr zone=one:10m rate=5r/s;
server_tokens off;
sendfile on;
keepalive_timeout 29; # Adjust to the lowest possible value that makes sense for your use case.
client_body_timeout 10; client_header_timeout 10; send_timeout 10;
upstream hellomvc{
server localhost:5000;
}
server {
listen *:80;
add_header Strict-Transport-Security max-age=15768000;
return 301 https://$host$request_uri;
}
#if( useSSL )
server {
listen *:443 ssl;
server_name example.com;
ssl_certificate /etc/ssl/certs/testCert.crt;
ssl_certificate_key /etc/ssl/certs/testCert.key;
ssl_protocols TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
ssl_ciphers "EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH";
ssl_ecdh_curve secp384r1;
ssl_session_cache shared:SSL:10m;
ssl_session_tickets off;
ssl_stapling on; #ensure your cert is capable
ssl_stapling_verify on; #ensure your cert is capable
add_header Strict-Transport-Security "max-age=63072000; includeSubdomains; preload";
add_header X-Frame-Options DENY;
add_header X-Content-Type-Options nosniff;
#Redirects all traffic
location / {
proxy_pass http://hellomvc;
limit_req zone=one burst=10;
}
}
#endif
}Related
CSS Files
File Extensions
.css, .css.min
the comment block starts with /* and ends with */. Inside this block you can add your conditional expressions.
Samples
In this sample, according to the value of the IndividualLocalAuth symbol, a few classes are added to the css file.
/*#if (IndividualLocalAuth)*/
/* buttons and links extension to use brackets: [ click me ] */
.btn-bracketed::before {
display: inline-block;
content: "[";
padding-right: 0.5em;
}
.btn-bracketed::after {
display: inline-block;
content: "]";
padding-left: 0.5em;
}
.dl-horizontal dt
{
white-space: normal;
}
/*#endif*/Related
Command Files
The comment block starts with rem to the end of line. After this marker you can add the conditional expressions.
File Extensions
.bat, .cmd
Samples
In this sample, according to the value of the enableVerbose symbol, an environment variable is set to true.
rem #if enableVerbose
set environment_verbose = true
rem #endifRelated
Razor Views
File Extensions
.cshtml
The comment block starts with @* and ends with *@. Inside this block you can add your conditional expressions
Samples
In this sample, according to the value of the IndividualLocalAuth symbol, the using is added to an cshtml file.
@*#if (IndividualLocalAuth)
@using Microsoft.AspNetCore.Identity
#endif*@In this sample, according to the value of the IndividualB2CAuth symbol, the inject statement is added to an cshtml file.
@*#if (IndividualB2CAuth)
@inject IOptions<AzureAdB2COptions> AzureAdB2COptions
#endif *@Related
Haml Files
File Extensions
.haml
The comment block starts with -# to the end of the line. After this marker you can add the conditional expressions.
Samples
In this sample, according to the value of the addParagraph symbol, a paragraph is added.
-##if addParagraph
%p A new paragraph is added.
-##endifRelated
Jsx Files
File Extensions
.jsx ,.tsx
The comment block starts with {/* and ends with */}. Inside this block you can add your conditional expressions.
Samples
In this sample, according to the value of the addParagraph symbol, a paragraph is added.
const myElement = (
{/*#if addParagraph
A new paragraph is added
#endif*/}
I am a paragraph.
);Related
Other File Types
The file types that do not have special configuration predefined in template engine or template.json configuration will follow default settings.
The comment block starts with // to the end of the line. After this marker you can add the conditional expressions using #if, #elseif, #endif, #else directives.
Samples
In this sample, according to the value of the boolean param1 symbol, option1 is added to the file.
//#if (param1)
option1
//#endif
option2Related
Documentation TemplateEngine Conditions (`documentation/TemplateEngine/Conditions.md`)
Conditions
Table of contents
Overview
Conditions are used to drive dynamic content generating or replacing.
Conditions use C++ style of conditional preprocessor expressions. Expressions are composed from constant literals (strings, numbers, true, false), operators, symbols, brackets and whitespaces. Only single line expressions are supported. Boolean and numerical expressions are supported (nonzero value is interpreted as true)
Sample conditions in source code
Generated Conditions
Unlike C++ preprocessor conditions, template engine allows ability for using conditional expressions that are based on results of other expressions. Specifically Evaluate and Computed symbols can be leveraged for this purpose.
Example
(other related sample in GeneratorTest.json):
template.json:
"symbols":{
"langVersion": {
"type": "parameter",
"datatype": "text",
"description": "Sets the LangVersion property in the created project file",
"defaultValue": "",
"replaces": "$(ProjectLanguageVersion)",
"displayName": "Language version"
},
"csharp10orLater": {
"type": "generated",
"generator": "regexMatch",
"datatype": "bool",
"parameters": {
"pattern": "^(|10\\.0|10|preview|latest|default|latestMajor)$",
"source": "langVersion"
}
},
"csharpFeature_ImplicitUsings": {
"type": "computed",
"value": "csharp10orLater == \"true\""
},
}Program.cs:
#if (!csharpFeature_ImplicitUsings)
using System;
#endifChoice symbols
Quoteless literals
Choice Symbol can have one of N predefined values. Those predefined values can be referenced in the conditions as quoted literals. Unquoted literals are as well supported as opt-in feature via enableQuotelessLiterals. Following 2 expressions are equivalent when opted in:
#if (PLATFORM == "Windows")
#if (PLATFORM == Windows)
This allows for easier authoring of nested generated conditions.
Multi-choice symbols
Information about multi-choice symbols can be found in Reference for template.json
Comparison to multi-choice symbol results in operation checking of a presence of any value of a multi-choice parameter - meaning == operator behaves as contains() operation. Example (sourced from integration test):
template.json:
"symbols": {
"Platform": {
"type": "parameter",
"description": "The target platform for the project.",
"datatype": "choice",
"allowMultipleValues": true,
"enableQuotelessLiterals": true,
"choices": [
{
"choice": "Windows",
"description": "Windows Desktop"
},
{
"choice": "WindowsPhone",
"description": "Windows Phone"
},
{
"choice": "MacOS",
"description": "Macintosh computers"
},
{
"choice": "iOS",
"description": "iOS mobile"
},
{
"choice": "android",
"description": "android mobile"
},
{
"choice": "nix",
"description": "Linux distributions"
}
],
"defaultValue": "MacOS|iOS"
}
}Program.cs:
#if (Platform == MacOS)
// MacOS choice flag specified here
#endifIn above example if Platform has it's default value (MacOS and iOS) or if those 2 values are passed to the engine (e.g. via command line: dotnet new MyTemplate --Platform MacOS --Platform iOS), the condition in Program.cs file will be evaluated as true.
Order of operands doesn't matter - PLATFORM == Windows evaluates identical as Windows == PLATFORM. Comparing 2 multi-choice symbols leads to standard equality check
Using Computed Conditions to work with multi-choice symbols
Cases that needs evaluation of different type of condition over multi-choice symbols than 'contains' (e.g. exclusive equality or membership in subset of possible values) can be achieved with slightly more involved condition - so we recommend definition of aliases via computed conditions.
Example:
Lets consider following multi-choice symbol:
template.json:
"symbols": {
"PLATFORM": {
"type": "parameter",
"description": "The target platform for the project.",
"datatype": "choice",
"allowMultipleValues": true,
"enableQuotelessLiterals": true,
"choices": [
{
"choice": "Windows",
"description": "Windows Desktop"
},
{
"choice": "WindowsPhone",
"description": "Windows Phone"
},
{
"choice": "MacOS",
"description": "Macintosh computers"
},
{
"choice": "iOS",
"description": "iOS mobile"
},
{
"choice": "android",
"description": "android mobile"
},
{
"choice": "nix",
"description": "Linux distributions"
}
],
"defaultValue": "WindowsPhone|iOS|android"
}
}Then Checking whether platform is a mobile platform can be performed with following condition: (PLATFORM == android || PLATFORM == iOS || PLATFORM == WindowsPhone) && PLATFORM != Windows && PLATFORM != MacOS && PLATFORM != nix
Checking for one and only one platform needs similarly involved condition: PLATFORM == android && PLATFORM != iOS && PLATFORM != WindowsPhone && PLATFORM != Windows && PLATFORM != MacOS
This is given by the fact that we do not support exclusive equality operator (in the future, if needed, we can introduce dedicated operator for that - e.g. ===).
To simplify templates and make them more readable - following computed conditions can be defined:
template.json:
"symbols": {
"IsMobile": {
"type": "computed",
"value": "(PLATFORM == android || PLATFORM == iOS || PLATFORM == WindowsPhone) && PLATFORM != Windows && PLATFORM != MacOS && PLATFORM != nix"
},
"IsAndroidOnly": {
"type": "computed",
"value": "PLATFORM == android && PLATFORM != iOS && PLATFORM != WindowsPhone && PLATFORM != Windows && PLATFORM != MacOS && PLATFORM != nix"
},
}Usage can then look as following:
Program.cs
#if IsAndroidOnly
// This renders for android only
#elseif IsMobile
// This renders for rest of mobile platforms
#else
// This renders for desktop platforms
#endifConditional Parameters
Parameter symbols in template can be specified together with optional conditions:
IsEnabled Condition- Used to determine when (or if) this symbol should be used. If this condition is specified and evaluates tofalse(or afalseconstant is passed), then this parameter is treated as if it does not exist. This applies to the use of conditional processing of sources and replacements. Verification of mandatory parameters does not consider disabled parameters (even if marked as required).IsRequired Condition- defines if parameter is required or optional.
Evaluation
Input - currently only other parameter symbols from the template configuration are supported within the parameter conditions. Any other variables are not bound and replaced (they are considered part of literal string).
Evaluation order - Dependencies between parameters are detected and evaluation is performed in order that guarantees that all dependencies are evaluated prior their dependant (see Topological Sorting for details).
In case of cyclic dependency the evaluation proceeds only if current input values of parameters do not lead to nondeterministic result (and the cycle is indicated in warning log message). That means order of evaluation or number of reevaluations should not have impact on the result of evaluation. Otherwise an error is reported, indicating the cycle.
Example template.json with cyclic dependency:
"symbols": {
"A": {
"type": "parameter",
"datatype": "bool",
"isEnabled": "B != false",
"defaultValue": false
},
"B": {
"type": "parameter",
"datatype": "bool",
"isEnabled": "A != true",
"defaultValue": true
}
}The following input parameter values can (and will) be evaluated deterministically: --A false --B true
The following input parameter values cannot be evaluated deterministically (and will lead to error): --A true --B false
Applying user, host and default values - All user-provided, host-provided and default values are applied before the conditions are evaluated. After the evaluation default values are reapplied to parameters that were evaluated as optional and that do not have user-/host-provided values. After this an evaluation of presence of required values takes place.
Performing evaluation externally
Users of Edge API can supply evaluation results of parameters conditions when instantiating template via TemplateCreator. More details are in Inside the Template Engine document.
Documentation TemplateEngine Constraints (`documentation/TemplateEngine/Constraints.md`)
Constraints
| Constraint | type |
|---|---|
| Operating system | os |
| Running template engine host | host |
| Installed workloads | workload |
| Current SDK version | sdk-version |
| Project capabilities | project-capability |
The feature is available since .NET SDK 7.0.100.
The template may define constraints, all of which must be met in order for the template to be usable. In case constraints are not met, the template will be installed, however will not be visible nor used by default.
Base configuration
The constraints are defined under constraints top-level property in template.json. constraints contains objects (constraint definition). Each constraint should have a unique name, and the following properties:
type: (string) - constraint type (mandatory)args: (string, array, object) - constraint arguments - depend on actual constraint implementation. May be optional.
Example template.json:
}
// other template elements
"constraints": {
"windows-only": { // Custom name - not validated
"type": "os", // Type of the constraint - used to match to proper Constraint component to evaluate the constraint
"args": "Windows" // Arguments passed to the evaluating constraint component
}
}
}Operating system
Restrict the template instantiation to certain operating system.
Configuration:
type:osargs: (string, array) - list of supported operating systems. Possible values are:Windows,Linux,OSX.
Supported in:
- all hosts (by default). 3rd party host may explicitly disable the constraint.
Examples
"constraints": {
"linux-only": {
"type": "os",
"args": "Linux"
},
}"constraints": {
"linux-and-osx": {
"type": "os",
"args": [ "Linux", "OSX" ]
},
}Template engine host
Restrict template to be run only in certain application and its version.
The following host identifiers are available:
dotnetcli- .NET SDKvs- Visual Studiovs-mac- Visual Studio for Macide- may refer to both Visual Studio and Visual Studio for Macdotnetcli-preview-dotnet new3command (used for debugging testing)
3rd party applications may define other host identifiers.
Configuration:
type:hostargs(array). Mandatory. Array elements can have following properties:hostname: (string) - the host identifier (see above)version: (string, optional) - supported version, or version range. If not specified, all the versions are supported.
Supported in:
- all hosts (by default). 3rd party host may explicitly disable the constraint.
The version and version range syntax is explained here.
The parsing is done in following order:
- exact version syntax (
1.0.0) - floating version syntax (
1.*) - version range syntax (
(1.0,))
Examples
Supported on .NET SDK 6.
"constraints": {
"sdk-only": {
"type": "host",
"args": [
{
"hostname": "dotnetcli",
"version": "6.0.*"
}
]
},
}Supported from .NET SDK 6.
"constraints": {
"sdk-only": {
"type": "host",
"args": [
{
"hostname": "dotnetcli",
"version": "[6.0,)"
}
]
},
}Supported in .NET SDK and Visual Studio
"constraints": {
"sdk-only": {
"type": "host",
"args": [
{
"hostname": "dotnetcli"
},
{
"hostname": "vs"
},
]
},
}Installed Workloads
Defines applicability of a template in the dotnet runtime with specific workloads installed.
All the installed (queryable via dotnet workload list) as well as extended workloads are inspected during evaluating of this constraint.
Configuration:
type:workloadargs(string, array). Mandatory. List of names of supported workloads (running host need to have at least one of the requested workloads installed).To see the list of installed workloads run
dotnet workload list. To see the list of available workloads rundotnet workload search
Supported in:
- .NET SDK CLI (
dotnet new) - Visual Studio 17.4
Examples
"constraints": {
"android-runtime": {
"type": "workload",
"args": [ "microsoft-net-runtime-android", "microsoft-net-runtime-android-aot" ]
},
}"constraints": {
"web-assembly": {
"type": "workload",
"args": "wasm-tools"
},
}Current SDK Version
Defines .NET SDK version(s) the template can be used on.
Only the currently active SDK (queryable via dotnet --version, changeable by the global.json) is being considered. Other available SDKs (queryable via dotnet --list-sdks) are checked for possible match and result is reported in the evaluation output with possible remedy steps - the form of reporting is dependent on the templating host.
Configuration:
type:sdk-versionargs(string, array). List of versions supported by the template. Syntax and match evaluation of versions are identical as in the Template engine host constraint.
Supported in:
- .NET SDK CLI (
dotnet new) - Visual Studio 17.4
Examples
"constraints": {
"LTS ": {
"type": "sdk-version",
"args": [ "6.0.*", "3.1.*" ]
},
}"current-with-previews": {
"web-assembly": {
"type": "sdk-version",
"args": "7.*.*-*"
},
}Project capabilities
Defines project capabilities that the template requires.
Commonly used with item templates to define the certain projects it is applicable to.dotnet new attempts to find the closest project file using following rules:
- The project in current directory or
--outputdirectory (matching*.*projextension). - If not found, the parent of above and so on.
- The path to the project can be explicitly specified using
--projectinstantiation option. This path takes precedence - so it can be used in case of ambiguity.
Once project is located, its project capabilities are evaluated. The project should be restored, otherwise evaluation fails.
Only .NET SDK-style projects are supported.
Configuration:
type:project-capabilityargs: (string) project capability expression that should be satisfied by the project.
Supported in:
- .NET SDK CLI (
dotnet new) - Visual Studio 17.4 Preview 3
Examples
"constraints": {
"CSharp": {
"type": "project-capability",
"args": "CSharp",
},
}"constraints": {
"CSharpTest": {
"type": "project-capability",
"args": "CSharp & TestContainer",
},
}Documentation TemplateEngine Exit Codes (`documentation/TemplateEngine/Exit-Codes.md`)
`dotnet new` exit codes and their meaning
Exit codes are chosen to conform to existing standards or standardization attempts and well known exit code. See Related resources for more details
| Exit Code | Reason |
|---|---|
| 0 | Success |
| 70 | Unexpected internal software issue. |
| 73 | Can't create output file. |
| 100 | Instantiation Failed - Processing issues. |
| 101 | Invalid template or template package. |
| 102 | Missing required option(s) and/or argument(s) for the command. |
| 103 | The template or the template package was not found. |
| 104 | PostAction operation was cancelled. |
| 105 | Instantiation Failed - Post action failed. |
| 106 | Template/Package management operation Failed. |
| 107 - 113 | Reserved. |
| 127 | Unrecognized option(s) and/or argument(s) for a command. |
| 130 | Command terminated by user. |
To enable verbose logging in order to troubleshoot issue(s), set the DOTNET_CLI_CONTEXT_VERBOSE environment variable to true
PowerShell:
$env:DOTNET_CLI_CONTEXT_VERBOSE = 'true'Cmd:
set DOTNET_CLI_CONTEXT_VERBOSE=true70 - Unexpected internal software issue
Unexpected result or issue. File a bug if you encounter this exit code.
This is a semi-standardized exit code (see EX_SOFTWARE in /usr/include/sysexits.h)
73 - Can't create output file.
The operation was cancelled due to detection of an attempt to perform destructive changes to existing files. This can happen if you are attempting to instantiate template into the same folder where it was previously instantiated under same target name (specified via --name option or defaults to the target directory name)
Example:
> dotnet new console
The template "Console App" was created successfully.
Processing post-creation actions...
Running 'dotnet restore' on C:\tmp\tmp.csproj...
Determining projects to restore...
Restored C:\tmp\tmp.csproj (in 47 ms).
Restore succeeded.
> dotnet new console
Creating this template will make changes to existing files:
Overwrite ./tmp.csproj
Overwrite ./Program.cs
Rerun the command and pass --force to accept and create.
For details on current exit code please visit https://aka.ms/templating-exit-codes#73Destructive changes can be forced by passing --force option.
This is a semi-standardized exit code (see EX_CANTCREAT in /usr/include/sysexits.h)
100 - Instantiation Failed - Processing issues
The template instantiation failed due to error(s). Caused by environment (failure to read/write template(s) or cache).
101 - Invalid template or template package
Reserved for future usage - described behavior is yet not implemented. Feature is tracked
Caused by erroneous template(s) (incomplete conditions, symbols or macros etc.). Exact error reason will be output to stderr.
Examples:
Missing mandatory properties in template.json
{
"author": "John Doe",
"name": "name",
}102 - Missing required option(s) and/or argument(s) for the command
Reserved for future usage - described behavior is only partially implemented. Some cases that should fall under this exit code are now leading to code 127 Issue is tracked
The exit code is used when one or more required options or/and arguments used for the command were not passed. Applicable to search command with not enough information as well.
Applicable as well if template option marked as required was not passed during the template instantiation.
Examples:
> dotnet new my-template
Mandatory option '--MyMandatoryParam' is missing for the template 'My Template'.
For details on current exit code please visit https://aka.ms/templating-exit-codes#102> dotnet new search
Search failed: not enough information specified for search.
To search for templates, specify partial template name or use one of the supported filters: '--author', '--baseline', '--language', '--type', '--tag', '--package'.
Examples:
dotnet new search web
dotnet new search --author Microsoft
dotnet new search web --language C#
For details on current exit code please visit https://aka.ms/templating-exit-codes#102103 - The template or the template package was not found
Applicable to instantiation, listing, remote sources searching and installation.
Examples:
> dotnet new xyz
No templates found matching: 'xyz'.
To list installed templates, run:
dotnet new list
To search for the templates on NuGet.org, run:
dotnet new search xyz
For details on current exit code please visit https://aka.ms/templating-exit-codes#103> dotnet new list xyz
No templates found matching: 'xyz'.
To search for the templates on NuGet.org, run:
dotnet new search xyz
For details on current exit code please visit https://aka.ms/templating-exit-codes#103> dotnet new search xyz
Searching for the templates...
Matches from template source: NuGet.org
No templates found matching: 'xyz'.
For details on current exit code please visit https://aka.ms/templating-exit-codes#103> dotnet new install foobarbaz
The following template packages will be installed:
foobarbaz
foobarbaz could not be installed, no NuGet feeds are configured or they are invalid.
For details on current exit code please visit https://aka.ms/templating-exit-codes#103104 - Post action operation was cancelled
Applicable to a case when user aborts run-script post action.
105 - Instantiation Failed - Post action failed
Applicable to a case when post action fails - unless it is configured to continue on errors.
106 - Template/Package management operation failed
The exit code is used for errors during templates installation, uninstallation or updates.
Failure to download packages, read/write templates or cache, erroneous or corrupted template, or an attempt to install same package multiple times.
Example:
>dotnet nuget disable source nuget.org
Package source with Name: nuget.org disabled successfully.
> dotnet new install webapi2
The following template packages will be installed:
webapi2
Error: No NuGet sources are defined or enabled.
webapi2 could not be installed, the package does not exist.
For details on current exit code please visit https://aka.ms/templating-exit-codes#106107 - 113
Reserved for future use.
File a bug if you encounter any of these exit codes.
127 - Unrecognized option(s) and/or argument(s) for a command
The exit code is used when one or more options or/and arguments used in the command not recognized or invalid.
Usually a mismatch in type of the specified template option or unrecognized choice value.
Examples:
> dotnet new console --framework xyz
Error: Invalid option(s):
--framework xyz
'xyz' is not a valid value for --framework. The possible values are:
net6.0 - Target net6.0
net7.0 - Target net7.0
For details on current exit code please visit https://aka.ms/templating-exit-codes#127dotnet new update --smth
Unrecognized command or argument '--smth'
Checks the currently installed template packages for update, and install the updates.
Usage:
dotnet new update [options]
Options:
--interactive Allows the command to stop and wait for user input or action (for
example to complete authentication).
--add-source, --nuget-source <nuget-source> Specifies a NuGet source to use during install.
--check-only, --dry-run Only check for updates and display the template packages to be updated
without applying update.
-?, -h, --help Show command line help.
For details on current exit code please visit https://aka.ms/templating-exit-codes#127This is a semi-standardized exit code (see 127 - "command not found" in 'The Linux Documentation Project')
130 - Command terminated by user.
Reserved for future usage - described behavior is yet not implemented. Feature is tracked
The exit code is used if command is terminated after user non-forceful termination request (e.g. Ctrl-C, Ctrl-Break).
This is a semi-standardized exit code (see 130 - Script terminated by Control-C in 'The Linux Documentation Project')
Related Resources
Documentation TemplateEngine Home (`documentation/TemplateEngine/Home.md`)
Environments using Template Engine
dotnet new- Visual Studio
- Visual Studio for Mac
Community templates
Template authoring
- How to create templates
- Samples repository
- Reference for
template.json - Post actions
- Symbols Generators
- Value Forms
- Conditional content generation
- Template constraints
- Binding and project context evaluation
- Authoring tools: localization
- Authoring tools: testing the templates
Documentation TemplateEngine Naming And Default Value Forms (`documentation/TemplateEngine/Naming-and-default-value-forms.md`)
`sourceName` default value forms
sourceName defines the name in the source tree to replace with the name the user specifies. The value to be replaced with can be given using the -n --name options while running a template or Name field in IDE. The template engine will look for any occurrence of the name present in the config file and replace it in file names and file contents. If no name is specified by the host, the current directory is used. The value of the sourceName is available in built-in name symbol and can be used as the source for creating other symbols and condition expressions. Therefore, it is not allowed to define name symbol in symbols in template.json configuration.
When selecting a sourceName for a template you're authoring, keep in mind the default value forms applied to this symbol:
identity- the value as entered by user.namespace- the value transformed in a way to be a correct .NET namespace. Detailsclass name- the value transformed in a way to be a correct .NET class name. Detailslower case namespace- same asnamespace, but lower case.lower case class name- same asclass name, but lower case.
sourceName is available in template configuration as name variable.
A good choice for sourceName is the value that produces distinct values under the below transformations, for example Template.1:
| Form | Source | Transformed value |
|---|---|---|
identity |
Template.1 |
Template.1 |
namespace |
Template.1 |
Template._1 |
class name |
Template.1 |
Template__1 |
lower case namespace |
Template.1 |
template._1 |
lower case class name |
Template.1 |
template__1 |
In this case, you can use the transformed value to force using the form, for example:
namespace Template._1; //uses `namespace` form
public class Template__1 //uses `class` form
{
var str = "My template name is Template.1"; //uses `identity` form
}In this case, if user use My-App as the name, the generated content will be as follows:
| Form | Source | Transformed value |
|---|---|---|
identity |
My-App |
My-App |
namespace |
My-App |
My_App |
class name |
My-App |
My_App |
lower case namespace |
My-App |
my_app |
lower case class name |
My-App |
my_app |
namespace My_App; //uses `namespace` form
public class My_App //uses `class` form
{
var str = "My template name is My-App"; //uses `identity` form
}An example of wrong sourceName is template1, in this case all form transformations result in template1.
Referring to previous example:
namespace template1; //intent to use `namespace` form
public class template1 //intent to use `class` form
{
var str = "My template name is template1"; //intent to use `identity` form
}In this case, if the user use My-App as the name, the generated content may be as follows:
namespace My-App; //intent to use `namespace` form, but `identity` was used instead. It is not guaranteed which of `My-App`, `My_App`, `my_app` will be used here.
public class My-App //intent to use `class` form, but `identity` was used instead
{
var str = "My template name is My_App"; //intent to use `identity` form, but `namespace` was used instead
}As the result, this code won't compile as namespace and class are not using correct names.
Besides using the forms in template content, it is possible to access certain form of sourceName via the following variables:
identity:name{-VALUE-FORMS-}identity, equivalent toname.namespace:name{-VALUE-FORMS-}safe_namespaceclass name:name{-VALUE-FORMS-}safe_namelower case namespace:name{-VALUE-FORMS-}lower_safe_namespacelower case class name:name{-VALUE-FORMS-}lower_safe_name
You can use them in conditions or other expressions of template configuration. Example:
<RootNamespace Condition="'$(name)' != '$(name{-VALUE-FORMS-}safe_namespace)'">Company.ConsoleApplication1</RootNamespace>For more details on value forms, refer to the article.
Documentation TemplateEngine Post Action Registry (`documentation/TemplateEngine/Post-Action-Registry.md`)
Existing Post Actions
| Description | ActionID |
|---|---|
| Restore NuGet packages | 210D431B-A78B-4D2F-B762-4ED3E3EA9025 |
| Run script | 3A7C4B45-1F5D-4A30-959A-51B88E82B5D2 |
| Open a file in the editor | 84C0DA21-51C8-4541-9940-6CA19AF04EE6 |
| Add a reference to a project file | B17581D1-C5C9-4489-8F0A-004BE667B814 |
| Add projects to a solution file | D396686C-DE0E-4DE6-906D-291CD29FC5DE |
| Change file permissions (Unix/OS X) | CB9A6CF3-4F5C-4860-B9D2-03A574959774 |
| Display manual instructions | AC1156F7-BB77-4DB8-B28F-24EEBCCA1E5C |
| Add a property to an existing JSON file | 695A3659-EB40-4FF5-A6A6-C9C4E629FCB0 |
Base configuration
Each post action has set of standard properties as well as custom properties defined by certain post action.
The standard properties are listed below.
- Configuration :
actionId(string): Action ID.condition(string) (optional): A C++ style boolean expression defining if post action should be run. This expression may use any symbols that have been defined.description(string) (optional): A human-readable description of the action.configFile(string) (optional): Additional configuration for the associated post action. The structure & content will vary based on the post action.continueOnError(bool) (optional): If this action fails, the value of continueOnError indicates whether to process the next action, or stop processing the post actions. Should be set to true when subsequent actions rely on the result of the current action. The default value is false.manualInstructions(array) (optional): An ordered list of possible instructions to display if the action cannot be performed. Each element in the list must contain a key named "text", whose value contains the instructions. Each element may also optionally provide a key named "condition" - a boolean expression. The first instruction with blank condition is considered a default. If true conditions are present, the last one of them will be considered valid, all other ignored. It is recommended not to have more than one true condition at the time.applyFileRenamesToArgs(array) (optional): A list of arguments names from 'args' to which the file renames configured in symbols should be applied. By default, the file renames are not applied. Available since .NET SDK 8.0.100.applyFileRenamesToManualInstructions(boolean) (optional): If set to true, the file renames configured in symbols should be applied to manual instructions. By default, the file renames are not applied. Available since .NET SDK 8.0.100.
Restore NuGet packages
Used to restore NuGet packages after project create.
Action ID :
210D431B-A78B-4D2F-B762-4ED3E3EA9025Specific Configuration :
args:files(string|array) (optional):string: A semicolon delimited list of files that should be restored. If specified, the primary outputs will be ignored for processing. If not specified, matching primary outputs are restored.array: An array of files that should be restored. If specified, the primary outputs will be ignored for processing. If not specified, matching primary outputs are restored.
Note: the file path specified in
filesis used as glob pattern matching relative source path that starts with./. If none of the patterns is matched, matching primary outputs are restored.Given that relative source paths are:
- ./src/Client/Client.csproj
- ./src/Client/Client.Library.csproj
- ./src/Client/Client.Test.csproj
The following patterns can be used.
Description Glob Pattern Exact path matching single project ./src/Client/Client.Test.csprojWildcard *matching multiple projects./src/Client/Client.*.csprojGlobstar **recursively matching multiple layers of directories**/Client.Library.csproj;**/Client.csprojFile name without parent path matching the project with the same name Client.Library.csproj
Supported in:
dotnet new3dotnet new(2.0.0 or higher)
Ignored in:
Visual Studio- Visual Studio restores all projects automatically, so post action will be ignored.
Note: when using files argument it should contain the path to the file in source template definition, and ignore all the path and filename changes that can happen when instantiating template. For more details, see the article.
Example
Restores the project mentioned in primary outputs:
"primaryOutputs": [
{
"path": "MyTestProject.csproj"
}
],
"postActions": [{
"condition": "(!skipRestore)",
"description": "Restore NuGet packages required by this project.",
"manualInstructions": [{
"text": "Run 'dotnet restore'"
}],
"actionId": "210D431B-A78B-4D2F-B762-4ED3E3EA9025",
"continueOnError": true
}]Restores the files mentioned in files argument. The primary outputs will be ignored.
"primaryOutputs": [
{
"path": "Primary/Output/PrimaryOutput.csproj" // will not be restored
}
],
"postActions": [{
"condition": "(!skipRestore)",
"description": "Restore NuGet packages required by this project.",
"manualInstructions": [{
"text": "Run 'dotnet restore'"
}],
"actionId": "210D431B-A78B-4D2F-B762-4ED3E3EA9025",
"continueOnError": true,
"args": {
"files": ["./Client/Client.csproj", "./Server/Server.csproj"]
}
}]If none of files mentioned in files argument is matched, the primary outputs will be restored.
"primaryOutputs": [
{
"path": "Primary/Output/PrimaryOutput.csproj" // will be restored
}
],
"postActions": [{
"condition": "(!skipRestore)",
"description": "Restore NuGet packages required by this project.",
"manualInstructions": [{
"text": "Run 'dotnet restore'"
}],
"actionId": "210D431B-A78B-4D2F-B762-4ED3E3EA9025",
"continueOnError": true,
"args": {
"files": ["Client/Client.csproj"] // This will not match any project because relative source path starts with "./"
}
}]Run script
Used to run a script after create.
- Action ID :
3A7C4B45-1F5D-4A30-959A-51B88E82B5D2 - Specific Configuration : There are three required properties that must be specified.
argsexecutable(string): The executable to launch.args(string): The arguments to pass to the executable.redirectStandardOutput(bool) (optional): Whether or not to redirect stdout for the process (prevents output from being displayed if true). The default value is true.redirectStandardError(bool) (optional): Defines whether or not the stderr should be redirected. If the output is redirected, it prevents it from being displayed. The default value is true. Available since .NET SDK 6.0.100.
manualInstructions(required)
- Supported in:
dotnet new3dotnet new(2.0.0 or higher)
The working directory for the launched executable is set to the root of the output template content.
Example
"postActions": [{
"actionId": "3A7C4B45-1F5D-4A30-959A-51B88E82B5D2",
"args": {
"executable": "setup.cmd",
"args": "",
"redirectStandardOutput": false,
"redirectStandardError": false
},
"manualInstructions": [{
"text": "Run 'setup.cmd'"
}],
"continueOnError": false,
"description ": "setups the project by calling setup.cmd"
}]Open a file in the editor
Opens a file in the editor. For command line cases this post action will be ignored.
- Action ID :
84C0DA21-51C8-4541-9940-6CA19AF04EE6 - Specific Configuration :
files(string): A semicolon delimited list of indexes to the primary outputs.
Note: If primary outputs are conditional, multiple post actions with the same
conditions as the primary outputs might be necessary.
- Supported in:
- since
Visual Studio 2017.3 Preview 1
- since
Example
"primaryOutputs": [
{ "path": "Company.ClassLibrary1.csproj" },
{
"condition": "(HostIdentifier != \"dotnetcli\")",
"path": "Class1.cs"
}
],
"postActions": [
{
"condition": "(HostIdentifier != \"dotnetcli\")",
"description": "Opens Class1.cs in the editor",
"manualInstructions": [ ],
"actionId": "84C0DA21-51C8-4541-9940-6CA19AF04EE6",
"args": {
"files": "1"
},
"continueOnError": true
}
]Add a reference to a project file
- Action ID :
B17581D1-C5C9-4489-8F0A-004BE667B814 - Specific Configuration :
argstargetFiles(string|array) (optional):string: A semicolon delimited list of files that should be processed. If not specified, the project file in output directory or its closest parent directory will be used.array: An array of files that should be processed. If not specified, the project file in output directory or its closest parent directory will be used.
referenceType(string): Either "package" or "project".reference(string): The package ID or relative path of the project to add the reference to.projectFileExtensions(string) (optional): A semicolon delimited list of literal file extensions to use when searching for the project to add the reference to. If not specified,*.*projmask is used when searching.version(string) (optional) (package referenceType only): The version of the package to install.
- Supported in:
dotnet new3dotnet new(2.0.0 or higher)
Note: when using targetFiles argument it should contain the path to the file in source template definition, and ignore all the path and filename changes that can happen when instantiating template. For more details, see the article.
Example
Adds a reference Microsoft.NET.Sdk.Functions to the project file.
"postActions": [{
"Description": "Adding Reference to Microsoft.NET.Sdk.Functions NuGet package",
"ActionId": "B17581D1-C5C9-4489-8F0A-004BE667B814",
"ContinueOnError": "false",
"ManualInstructions": [{
"Text": "Manually add the reference to Microsoft.NET.Sdk.Functions to your project file"
}],
"args": {
"referenceType": "package",
"reference": "Microsoft.NET.Sdk.Functions",
"version": "1.0.0",
"projectFileExtensions": ".csproj"
}
}]Includes a reference to SomeDependency into MyProjectFile. The referenced project file is in the SomeDependency folder.
"postActions": [{
"Description": "Adding a reference to another project",
"ActionId": "B17581D1-C5C9-4489-8F0A-004BE667B814",
"ContinueOnError": "false",
"ManualInstructions": [{
"Text": "Manually add the reference to SomeDependency to MyProjectFile"
}],
"args": {
"targetFiles": ["MyProjectFile.csproj"]
"referenceType": "project",
"reference": "SomeDependency/SomeDependency.csproj"
}
}]Adding references to existing projects
It is possible to add references to existing projects in your working directory. Since the name of the existing project is likely not a constant value for all template instantiations, a symbol can be used to pass the name of the existing project.
The example below demonstrates how to add the existing project src/AlreadyExisting/AlreadyExisting.csproj as a reference to the template source project Project1/Project1.csproj.
{
"symbols": {
"existingProject": {
...
"type": "parameter",
"datatype": "string",
"defaultValue": "ExistingProject/ExistingProject.csproj",
"fileRename": "ExistingProjectPath" // Must be same as targetFile
}
},
"postActions": [
{
"Description": "Add ProjectReference to ExistingProject/ExistingProject.csproj",
"applyFileRenamesToArgs": [
"targetFiles" // Must be specified
],
"args": {
"targetFiles": [
"ExistingProjectPath" // Must be same as fileRename
],
"referenceType": "project",
"reference": "Project1/Project1.csproj"
}
}]
}The template above:
- Configures the
existingProjectparameter symbol with afileRenameconfiguration. - Instructs the 'add reference to a project file' post action to apply
fileRenameto thetargetFilesargument. - Uses the value passed to the
existingProjectsymbol to replace the value of the matchingtargetFiles.
This template can be instantiated using:
dotnet new [templateName] --existingProject src/AlreadyExisting/AlreadyExisting.csproj
Add project(s) to a solution file
- Action ID :
D396686C-DE0E-4DE6-906D-291CD29FC5DE - Specific Configuration :
args:projectFiles(string|array) (optional):string: A semicolon delimited list of files that should be added to solution. If not specified, primary outputs will be used instead.array: An array of files that should be added to solution. If not specified, primary outputs will be used instead.
primaryOutputIndexes(string) (optional): A semicolon delimited list of indexes to the primary outputs. If not specified, all primary outputs will be added. Note: If primary outputs are conditional, multiple post actions with the same conditions as the primary outputs might be necessary.solutionFolder(string) (optional) (supported in 5.0.200 or higher): the destination solution folder path to add the projects to.inRoot(boolean) (optional) (supported in 7.0.200 or higher): whether to place the projects in the root of the solution, rather than create a solution folder. Cannot be used withsolutionFolder.
- Supported in:
dotnet new3dotnet new(2.0.0 or higher)
- Ignored in:
Visual Studio- the user indicates where to add project explicitly, so post action defined in the template will be ignored.
Note: when using projectFiles argument it should contain the path to the file in source template definition, and ignore all the path and filename changes that can happen when instantiating template. For more details, see the article.
Example
Adds MyTestProject.csproj to solution in output directory or its closest parent directory.
"primaryOutputs": [
{
"path": "MyTestProject.csproj"
}
],
"postActions": [{
"description": "Add projects to solution",
"manualInstructions": [ { "text": "Add generated project to solution manually." } ],
"args": {
"solutionFolder": "src"
},
"actionId": "D396686C-DE0E-4DE6-906D-291CD29FC5DE",
"continueOnError": true
}]Adds MyTestProject.csproj to solution in output directory or its closest parent directory (using projectFiles argument).
"postActions": [{
"description": "Add projects to solution",
"manualInstructions": [ { "text": "Add generated project to solution manually." } ],
"args": {
"solutionFolder": "src",
"projectFiles": ["MyTestProject.csproj"]
},
"actionId": "D396686C-DE0E-4DE6-906D-291CD29FC5DE",
"continueOnError": true
}]Adds MyTestProject.csproj in the root of the solution.
"primaryOutputs": [{
"path": "MyTestProject.csproj"
}
],
"postActions": [{
"description": "Add projects to solution",
"manualInstructions": [{
"text": "Add generated project to solution manually."
}
],
"args": {
"inRoot": true
},
"actionId": "D396686C-DE0E-4DE6-906D-291CD29FC5DE",
"continueOnError": true
}
]Change file permissions
Unix / OS X only (runs the Unix chmod command).
- Action ID :
CB9A6CF3-4F5C-4860-B9D2-03A574959774 - Specific Configuration :
args: The permissions to set (see examples). Usually this will contain a glob like{ "+x": "*.sh" }or a list of filenames like{ "+x": ["script1", "script2"] }.
- Supported in:
dotnet new3dotnet new(2.0.0 or higher)
Example
"postActions": [{
"condition": "(OS != \"Windows_NT\")",
"description": "Make scripts executable",
"manualInstructions": [{
"text": "Run 'chmod +x *.sh'"
}],
"actionId": "cb9a6cf3-4f5c-4860-b9d2-03a574959774",
"args": {
"+x": "*.sh"
},
"continueOnError": true
}]or
"postActions": [{
"condition": "(OS != \"Windows_NT\")",
"description": "Make scripts executable",
"manualInstructions": [ { "text": "Run 'chmod +x *.sh somethingelse'" } ],
"actionId": "cb9a6cf3-4f5c-4860-b9d2-03a574959774",
"args": {
"+x": [
"*.sh",
"somethingelse"
]
},
"continueOnError": true
}]Display manual instructions
Prints out the manual instructions after instantiating template in format:
Manual instructions: <manual instructions defined in post action>
Actual command: <executable> <args>Command is printed only if defined in post action arguments.
- Action ID :
AC1156F7-BB77-4DB8-B28F-24EEBCCA1E5C - Specific Configuration :
args:executable(string) (optional): command to runargs(string) (optional): arguments to use
- Supported in:
dotnet new3dotnet new(2.0.0 or higher)
Example
"postActions": [{
"description": "Manual actions required",
"manualInstructions": [{
"text": "Run the following command"
}],
"actionId": "AC1156F7-BB77-4DB8-B28F-24EEBCCA1E5C",
"args": {
"executable": "setup.cmd",
"args": "<your project name>"
},
"continueOnError": true
}]Add a property to an existing JSON file
Adds a new JSON property in an existing JSON file.
- Action ID : 695A3659-EB40-4FF5-A6A6-C9C4E629FCB0
- Specific Configuration :
args:jsonFileName (string): The path to the JSON file that must be modified.parentPropertyPath (string)(optional): Specifies an existing property in the JSON file for which the new property must be a child property. The complete path must be specified, using a colon (:) as a separator character, for instance,Person:Address. If parentPropertyPath is not defined, the new property will be added to the root of the JSON document.
newJsonPropertyName (string): The name that must be given to the new property.newJsonPropertyValue (string): The value that must be assigned to the new property. This must be a valid JSON.allowPropertyOverwrite (bool)(optional, .NET 12 SDK or later): Whether an existing property may be replaced with a different value. The default istruefor compatibility. Whenfalse, an existing equal value is accepted, but a conflicting value causes the post action to fail with a diagnostic and leaves the file unchanged. Missing properties can still be added.ignorePropertyValueCase (bool)(optional, .NET 12 SDK or later): WhenallowPropertyOverwriteisfalse, compare scalar string values usingOrdinalIgnoreCaseand retain an existing matching value. The default isfalse. This does not change object property names or strings nested inside objects or arrays.- Starting in .NET 10 SDK, the following are also supported:
detectRepositoryRoot (bool): Whether or not a detection logic to find repo root is enabled. When the JSON file is not found, it will be created in the detected repo root if this option is true. Also when searching for an existing JSON file, the search will stop at the repo root and won't consider any parent directories. The default isfalse.includeAllDirectoriesInSearch (bool): Whether or not sub-directories are searched for a matching json file (i.e, useSearchOption.AllDirectories). The default istrue.includeAllParentDirectories (bool): Whether or not all parent directories (up to repo root, ifdetectRepositoryRootis true) are searched for a matching JSON file. Whenfalse, only one level up is searched. The default isfalse.
- Supported in :
- dotnet new3
- dotnet new (2.0.0 or higher)
The built-in MSTest, Playwright MSTest, NUnit, and xUnit v3 templates set
the JSON post-action'sallowPropertyOverwrite to false and ignorePropertyValueCase to true when selecting Microsoft.Testing.Platform inglobal.json. An explicit conflicting runner is preserved rather than silently
migrating every project in that file's scope. Runner comparison matches the
CLI's case-insensitive resolution,
without changing the JSON post-action's default case-sensitive comparison.
Project creation still succeeds because
these post actions use continueOnError, but the diagnostic and manual instructions
require the user to resolve the runner choice. If no runner is configured, the templates
still add Microsoft.Testing.Platform; existing projects in that scope must be compatible.
Older SDK hosts do not implement this guard, so servicing requires updating both the
post-action processor and the template configuration.
Example
"postActions": [{ `
`"description": "Adds a new JSON property in an existing JSON file.",`
`"manualInstructions": [ { "text": "Add a new property 'LogLevel' with value 'Information' to '.\deployment.json' under existing property 'moduleConfiguration:edgeAgent:properties.desired'" } ],`
`"actionId": "695A3659-EB40-4FF5-A6A6-C9C4E629FCB0",`
`"args": {`
`"jsonFileName": ".\deployment.json",`
`"parentPropertyPath": "moduleConfiguration:edgeAgent:properties.desired",`
`"newJsonPropertyName": "LogLevel",`
`"newJsonPropertyValue": "Information"`
`},`
`"continueOnError": true`
`}]Documentation TemplateEngine Reference For Template.Json (`documentation/TemplateEngine/Reference-for-template.json.md`)
Overview
This page describes the available properties of template.json configuration file.
The templates defined using template.jsonare still the "runnable projects" A "runnable project" is a project that can be
executed as a normal project can. Instead of updating your source files to be tokenized you define replacements, and other processing, mostly in an external file,
the template.json file. This requires that a few changes have to be done on the fly during the preparation of the package, and in the template.json we define all the operations needed to create a well working package.
Benefits of "runnable project" templates
- Code format is not modified, therefore existing editors work great for template content
- You can still build, run, debug and test your template just like any other project
- No injection of special templating tokens into the project is required (though possible)
Typical layout on disk
.template.config/
template.json
MyTemplate/
MyTemplate.csproj
Program.csThe templates can be packaged to a NuGet package for further distribution.
A tutorial on how to create the template package can be found here.
| Category | Description |
|---|---|
| Template Definition | Metadata of the template |
| Content Manipulation | Configuration of content changes in source files |
| Output Management | Configuration of the final output |
Template Definition
| Name | Description | Mandatory |
|---|---|---|
identity |
A unique name for this template | yes |
author |
The author of the template | no |
classifications |
Zero or more characteristics of the template which are shown in the tabular output of dotnet new list and dotnet new search as "Tags". It is possible to filter the templates based on them using --tag option. In Visual Studio those items are shown in New Project Dialog in the available list of templates together with template name, description and language. Common classifications are: Library, Test, Web etc. |
no |
name |
The name for the template. This is displayed as the template name when using dotnet new and Visual Studio. |
yes |
groupIdentity |
The ID of the group this template belongs to. This allows multiple templates to be displayed as one, with the decision for which one to use based on the template options. See more information on templates grouping in this article. | no |
tags |
You can use tags to improve the metadata of your project. Well-known tags are: language and type. To specify the template language, use the tag language. To specify the template type, use the tag type. Supported types are: project, item, solution. |
no |
shortName |
A name for selecting the template in CLI environment. This is the name shown as Short Name in dotnet new list of templates, and is the name to use to run this template. It is possible to specify multiple short names for the single template, and then any of them can be used to instantiate the template. The first element of the array is considered as the primary and first choice in scenarios where only single value is allowed (for example in tab completion of dotnet new). Be mindful when selecting the short name and using synonyms to avoid conflicts with other templates - the template short name should be unique. In case multiple template with the same short name are installed at the same time, the user won't be able to use any of them until one of the packages is uninstalled making the short name unique again. This doesn't apply for the templates that are part of the same group (have same groupIdentity). |
yes |
postActions |
Enables actions to be performed after the project is created. See the article on post actions for more details. | no |
constraints |
Template constraints |
Template constraints
Available since .NET SDK 7.0.100.
The template may define the constraints all of which must be met in order for the template to be used.
In case constraints are not met, the template will be installed, however will not be visible by default.
For the details on available constraints, refer to the article.
The constraints are defined under constraints property (top level in template.json). constraints contains objects (constraint definition). Each constraint should have a unique name, type and optional arguments (args). Argument syntax depends on the constraint implementation.
"constraints": {
"linux-only": {
"type": "os",
"args": "Linux"
},
"sdk-only": {
"type": "host",
"args": [
{
"hostname": "dotnetcli",
"version": "[6.0.100, )"
}
]
}
}Content Manipulation
| Name | Description | Default | Mandatory |
|---|---|---|---|
sources |
The set of mappings in the template content to user directories. It's defined as any array of Source | If not specified, an implicit source is created with "source": "./" and "target": "./", all other properties in the source are set to their defaults |
no |
guids |
Guids | no | |
symbols |
Symbols | no | |
forms |
Value forms | no |
Source Definition
| Name | Description | Default | Mandatory |
|---|---|---|---|
source |
The path in the template content (relative to the directory containing the .template.config folder) that should be processed | ./ |
no |
target |
The path (relative to the directory the user has specified) that content should be written to | ./ |
no |
include |
The set of globing patterns indicating the content to process in the path referred to by source |
[ "**/*" ] | no |
exclude |
The set of globing patterns indicating the content that was included by sources.include that should not be processed | [ "**/[Bb]in/**", "**/[Oo]bj/**", ".template.config/**/*", "**/*.filelist", "**/*.user", "**/*.lock.json" ] |
no |
copyOnly |
The set of globing patterns indicating the content that was included by include, that hasn't been excluded by sources.exclude that should be placed in the user's directory without modification |
[ "**/node_modules/**/*" ] |
no |
rename |
The set of explicit renames to perform. Each key is a path to a file in the source, each value is a path to the target location - only the values will be evaluated with the information the user supplies | no | |
condition |
A boolean condition to indicate if the sources configuration should be included or ignored. If the condition evaluates to true or is not provided, the sources config will be used for creating the template. If it evaluates to false, the sources config will be ignored |
no | |
modifiers |
A list of additional source information which gets added to the top-level source information, based on evaluation the corresponding source.modifiers.condition. Is defined as an array of Modifier |
no |
Modifier Definition
| Name | Description | Mandatory |
|---|---|---|
condition |
A boolean condition to indicate if the sources.modifiers instance should be included or ignored. If the condition evaluates to true or is not provided, the sources.modifiers instance will be used for creating the template. If it evaluates to false, the sources.modifiers config will be ignored. |
yes |
include |
Include configuration specific to this sources.modifiers instance, contingent on the corresponding sources.modifiers.condition. See sources.include for more info. |
no |
exclude |
Exclude configuration specific to this sources.modifiers instance, contingent on the corresponding sources.modifiers.condition. See sources.exclude for more info |
no |
copyOnly |
CopyOnly configuration specific to this sources.modifiers instance, contingent on the corresponding sources.modifiers.condition. See sources.copyOnly for more info |
no |
Guids
An optional list of guids which appear in the template source and should be replaced in the template output. For each guid listed, a replacement guid is generated, and replaces all occurrences of the source guid in the output. Matching of the guids in the source template works independently on the format and casing of the guids in the template.json file and source files. Format and casing from template source is preserved in the output (casing and format of the guid in Guids section of template.json doesn't influence matching or output generation).
Example
Sample template.json snippet:
"guids": [
"98048C9C-BF28-46BA-A98E-63767EE5E3A8",
"c7ab42cf938548c08b8784349ab5e04b"
],Sample template file content:
[n]: 98048c9cbf2846baa98e63767ee5e3a8
[d]: 98048c9c-bf28-46ba-a98e-63767ee5e3a8
[b]: {98048c9c-bf28-46ba-a98e-63767ee5e3a8}
[p]: (98048c9c-bf28-46ba-a98e-63767ee5e3a8)
[x]: {0x98048c9c,0xbf28,0x46ba,{0xa9,0x8e,0x63,0x76,0x7e,0xe5,0xe3,0xa8}}
[N]: 98048C9CBF2846BAA98E63767EE5E3A8
[D]: 98048C9C-BF28-46BA-A98E-63767EE5E3A8
[B]: {98048C9C-BF28-46BA-A98E-63767EE5E3A8}
[P]: (98048C9C-BF28-46BA-A98E-63767EE5E3A8)
[X]: {0X98048C9C,0XBF28,0X46BA,{0XA9,0X8E,0X63,0X76,0X7E,0XE5,0XE3,0XA8}}
[n]: c7ab42cf938548c08b8784349ab5e04b
[d]: c7ab42cf-9385-48c0-8b87-84349ab5e04b
[b]: {c7ab42cf-9385-48c0-8b87-84349ab5e04b}
[p]: (c7ab42cf-9385-48c0-8b87-84349ab5e04b)
[x]: {0xc7ab42cf,0x9385,0x48c0,{0x8b,0x87,0x84,0x34,0x9a,0xb5,0xe0,0x4b}}
[N]: C7AB42CF938548C08B8784349AB5E04B
[D]: C7AB42CF-9385-48C0-8B87-84349AB5E04B
[B]: {C7AB42CF-9385-48C0-8B87-84349AB5E04B}
[P]: (C7AB42CF-9385-48C0-8B87-84349AB5E04B)
[X]: {0XC7AB42CF,0X9385,0X48C0,{0X8B,0X87,0X84,0X34,0X9A,0XB5,0XE0,0X4B}}Output content after template instantiation:
[n]: a6d920ff125841318f5e07df108f5a4a
[d]: a6d920ff-1258-4131-8f5e-07df108f5a4a
[b]: {a6d920ff-1258-4131-8f5e-07df108f5a4a}
[p]: (a6d920ff-1258-4131-8f5e-07df108f5a4a)
[x]: {0xa6d920ff,0x1258,0x4131,{0x8f,0x5e,0x07,0xdf,0x10,0x8f,0x5a,0x4a}}
[N]: A6D920FF125841318F5E07DF108F5A4A
[D]: A6D920FF-1258-4131-8F5E-07DF108F5A4A
[B]: {A6D920FF-1258-4131-8F5E-07DF108F5A4A}
[P]: (A6D920FF-1258-4131-8F5E-07DF108F5A4A)
[X]: {0XA6D920FF,0X1258,0X4131,{0X8F,0X5E,0X07,0XDF,0X10,0X8F,0X5A,0X4A}}
[n]: 2879773c9a5241f78fa5ac318214f54d
[d]: 2879773c-9a52-41f7-8fa5-ac318214f54d
[b]: {2879773c-9a52-41f7-8fa5-ac318214f54d}
[p]: (2879773c-9a52-41f7-8fa5-ac318214f54d)
[x]: {0x2879773c,0x9a52,0x41f7,{0x8f,0xa5,0xac,0x31,0x82,0x14,0xf5,0x4d}}
[N]: 2879773C9A5241F78FA5AC318214F54D
[D]: 2879773C-9A52-41F7-8FA5-AC318214F54D
[B]: {2879773C-9A52-41F7-8FA5-AC318214F54D}
[P]: (2879773C-9A52-41F7-8FA5-AC318214F54D)
[X]: {0X2879773C,0X9A52,0X41F7,{0X8F,0XA5,0XAC,0X31,0X82,0X14,0XF5,0X4D}}Symbols
The symbols section defines variables and their values, the values may be the defined in terms of other symbols. When a defined symbol name is encountered anywhere in the template definition, it is replaced by the value defined in this configuration. The symbols configuration is a collection of key-value pairs. The keys are the symbol names, and the value contains key-value-pair configuration information on how to assign the symbol a value.
The supported symbol types are:
- Parameter
- Derived
- Computed
- Generated
- Bind
There are 3 places from which a symbol can acquire its value:
- Template configuration (this).
- Host provided values, which override template configuration values. For example, the host may provide the operating system kind as "Linux", overriding a template default value of "Windows".
- User provided values, which override host & template values. The way these are provided to the template generation broker is specific to the broker. This may be via additional configuration files, command line parameters, inputs to a UI, etc.
Parameter symbol
A symbol for which the config provides literal and/or default values.
| Name | Description | Mandatory |
|---|---|---|
type |
parameter |
yes |
dataType |
Supported values: - bool: boolean type, possible values: true/false. - choice: enumeration, possible values are defined in choices property.- float: double-precision floating format number. Accepts any value that can be parsed by double.TryParse().- int/integer: 64-bit signed integer. Accepts any value that can be parsed by long.TryParse().- hex: hex number. Accepts any value that can be parsed by long.TryParse(value.Substring(2), NumberStyles.HexNumber, CultureInfo.InvariantCulture, out long convertedHex).- text/string: string type.- <any other>: treated as string. |
no, default - string |
defaultValue |
The value assigned to the symbol if no parameter is provided by the user or host. The default is not applied if isRequired configuration is set to true for a parameter (or is set to condition that evaluates to true), as that is an indication that user specified value is required. |
no |
defaultIfOptionWithoutValue |
The value assigned to the symbol if explicit null parameter value is provided by the user or host. |
no |
replaces |
The text to be replaced by the symbol value in the template files content | no |
fileRename |
The portion of template filenames to be replaced by the symbol value. | no |
description |
Human readable text describing the meaning of the symbol. This has no effect on template generation. | no |
isRequired |
Optional. Indicates if the user supplied value is required or not. Might be a fixed boolean value or a condition string that evaluates based on passed parameters - more details in Conditions documentation. If set to true (or condition that evaluates to true) and user has not specified the value on input, validation error occurs - even if defaultValue is present. |
no |
isEnabled |
Optional condition indicating whether parameter should be processed. Might be a fixed boolean value or a condition string that evaluates based on passed parameters - more details in Conditions documentation. | no |
choices |
Applicable only when datatype=choice.List of available choices. Contains array of the elements: - choice: possible value of the symbol.- description: human readable text describing the meaning of the choice. This has no effect on template generation. If not provided, there are no valid choices for the symbol, so it can never be assigned a value. |
yes, for dataType = choice |
allowMultipleValues |
Applicable only when datatype=choice.Enables ability to specify multiple values for single symbol. |
no |
enableQuotelessLiterals |
Applicable only when datatype=choice. Enables ability to specify choice literals in conditions without quotation. |
no |
onlyIf |
Defines the conditions that should be fulfilled in order that replacement happens. | no |
forms |
Defines the set of transforms that can be referenced by symbol definitions. Forms allow the specification of a "replaces"/"replacement" pair to also apply to other ways the "replaces" value may have been specified in the source by specifying a transform from the original value of "replaces" in configuration to the one that may be found in the source. Details | no |
Examples
Boolean optional parameter with default value false:
"symbols": {
"TestProject": {
"type": "parameter",
"dataType": "bool",
"defaultValue": "false"
}
},Choice optional parameter with 3 possible values:
"symbols": {
"Framework": {
"type": "parameter",
"description": "The target framework for the project.",
"datatype": "choice",
"enableQuotelessLiterals": true,
"choices": [
{
"choice": "netcoreapp3.1",
"description": "Target netcoreapp3.1"
},
{
"choice": "netstandard2.1",
"description": "Target netstandard2.1"
},
{
"choice": "netstandard2.0",
"description": "Target netstandard2.0"
}
],
"replaces": "netstandard2.0",
"defaultValue": "netstandard2.0"
}
}String optional parameter, replaces TargetFrameworkOverride:
"symbols": {
"TargetFrameworkOverride": {
"type": "parameter",
"description": "Overrides the target framework",
"replaces": "TargetFrameworkOverride",
"datatype": "string",
"defaultValue": ""
}
}Multi-choice symbols specifics
Multi-choice symbols have similar behavior and usage scenarios as C# Flag enums - they express a range of possible values (not a single value - unlike the plain choice symbol)
Example definition of multi-choice symbol:
"symbols":
{
"Platform": {
"type": "parameter",
"description": "The target platform for the project.",
"datatype": "choice",
"allowMultipleValues": true, // multi-choice indicator
"choices": [
{
"choice": "Windows",
"description": "Windows Desktop"
},
{
"choice": "MacOS",
"description": "Macintosh computers"
},
{
"choice": "iOS",
"description": "iOS mobile"
},
{
"choice": "android",
"description": "android mobile"
},
{
"choice": "nix",
"description": "Linux distributions"
}
],
"defaultValue": "MacOS|iOS"
}
}There are some specifics in behavior of multi-choice symbols that are worth noting:
Condition evaluation - closer described in Conditions document.
Switchsymbol evaluation - conditions are evaluated by identical evaluator as preprocessing conditions (previous bullet point).Argument passing and tab completion on CLI - User can specify multiple options via repeating the argument switch for each option:
dotnet new MyTemplate --MyParameter value1 --MyParameter value2or by passing multiple tokens to single option switch:
dotnet new MyTemplate --MyParameter value1 value2Tab completion works identically as for standard choice symbol
Default values specification and API usage - Currently multiple values can be specified within single string separated by
|or,characters. Escaping of those characters within values is currently not supported.Using multi-choice value as a string in template content - this can be achieved via leveraging the
joinsymbol. For simplicity it is as well possible to specify replacement for choice symbol with multiple values - in such case the values will be rendered into single string separated by|sign.
Derived symbol
A symbol that defines transformation of another symbol. The value of this symbol is derived from the value of another symbol by the application of form defined in valueTransform.
| Name | Description | Mandatory |
|---|---|---|
type |
derived |
yes |
valueSource |
The name of the other symbol which value will be used to derive this value. | yes |
valueTransform |
The name of the value form to apply to the source value. | yes |
replaces |
The text to be replaced by the symbol value in the template files content | no |
fileRename |
The portion of template filenames to be replaced by the symbol value. | no |
description |
Human readable text describing the meaning of the symbol. This has no effect on template generation. | no |
Examples
Renames Application1 file to value of name symbol after last dot
{
...
"symbols": {
"app1Rename": {
"type": "derived",
"valueSource": "name",
"valueTransform": "ValueAfterLastDot",
"fileRename": "Application1",
"description": "A value derived from the 'name' param, used to rename Application1.cs"
}
}
...
"forms": {
"ValueAfterLastDot": {
"identifier": "replace",
"pattern": "^.*\\.(?=[^\\.]+$)", // regex to match everything up to and including the final "."
"replacement": "" // replace it with empty string
}
}
...
}Generated symbol
A symbol which value gets computed by a built-in symbol value generator. Details
| Name | Description | Mandatory |
|---|---|---|
type |
generated |
yes |
generator |
Generator to use: See this article for more details. | yes |
parameters |
The parameters for generator. See description for each generator for details. | depends on generator |
replaces |
The text to be replaced by the symbol value in the template files content | no |
fileRename |
(supported in 5.0.200 or higher) The portion of template filenames to be replaced by the symbol value. | no |
dataType |
Supported values: - bool: boolean type, possible values: true/false. - float: double-precision floating format number. Accepts any value that can be parsed by double.TryParse().- int/integer: 64-bit signed integer. Accepts any value that can be parsed by long.TryParse().- hex: hex number. Accepts any value that can be parsed by long.TryParse(value.Substring(2), NumberStyles.HexNumber, CultureInfo.InvariantCulture, out long convertedHex).- text/string: string type.- <any other>: treated as string. |
no, default: string |
Example
myconstant: replaces1234with5001ownername: replacesJohn Smith (a)with the value of theownernameparameternameUpper:- replaces
John Smith (U)with the value of theownernameparameter in upper case in template files content - replaces
author_ucwith the value of theownernameparameter in upper case in filenames
- replaces
nameLower:- replaces
John Smith (l)with the value of theownernameparameter in lower case in template files content - replaces
author_lcwith the value of theownernameparameter in lower case in filenames
- replaces
"symbols":{
"myconstant": {
"type": "generated",
"generator": "constant",
"parameters": {
"value":"5001"
},
"replaces":"1234"
},
"ownername":{
"type": "parameter",
"datatype":"text",
"replaces": "John Smith (a)",
"defaultValue": "John Doe"
},
"nameUpper":{
"type": "generated",
"generator": "casing",
"parameters": {
"source":"ownername",
"toLower": false
},
"replaces":"John Smith (U)",
"fileRename": "author_uc"
},
"nameLower":{
"type": "generated",
"generator": "casing",
"parameters": {
"source":"ownername",
"toLower": true
},
"replaces":"John Smith (l)",
"fileRename": "author_lc"
}
}Computed symbol
A symbol for which the config provides a Boolean predicate whose evaluation result is the computed symbol result.
| Name | Description | Mandatory |
|---|---|---|
type |
computed |
yes |
value |
Boolean expression to be computed. | yes |
evaluator |
Language to be used for evaluation of expression: - C++2 - C++- MSBUILD- VB |
no, default: C++2 |
Please note that math operations are not supported in expressions at this point.
Example
Values of OrganizationalAuth, WindowsAuth, MultiOrgAuth, SingleOrgAuth, IndividualAuth, NoAuth, RequiresHttps symbols are computed based on auth symbol.
/* Detailed source-code truncated for AI context efficiency. */Bind symbol
See the article.
Output Management
| Name | Description | Default | Mandatory |
|---|---|---|---|
sourceName |
The text in the source content to replace with the name the user specifies. The value to be replaced with can be given using the -n --name options while running a template. The template engine will look for any occurrence of the sourceName present in the config file and replace it in file names and file contents. If no name is specified by the host, the current directory is used. The value of the sourceName is available in built-in name symbol and can be used as the source for creating other symbols and condition expressions. Due to implicit forms applied to sourceName it is important to select the replacement that doesn't cause the conflicts. See more details about sourceName in the article |
no | |
preferDefaultName |
Boolean value that decides which name will be used if no --name is specified during creation. If false it will use the fallback name (output folder name), if true it will use the template's defaultName. If no defaultName and no fallback name is specified and preferDefaultName is set to true, the template creation will not succeed with a TemplateIssueDetected exception. |
If not specified, false is used. |
no |
preferNameDirectory |
Boolean value, indicates whether to create a directory for the template if name is specified but an output directory is not set (instead of creating the content directly in the current directory). | If not specified, false is used. |
no |
placeholderFilename |
A filename that will be completely ignored, used to indicate that its containing directory should be copied. This allows creation of empty directory in the created template, by having a corresponding source directory containing just the placeholder file. By default, empty directories are ignored. | If not specified, a default value of "-.-" is used. |
no |
primaryOutputs |
A list of template files for further processing by the host (including post-actions). The path should contain the relative path to the file prior to the symbol based renaming that may happen during template generation. It is defined as an array of Primary Outputs | no |
Primary Output Definition
Primary outputs define the list of template files for further processing, usually post actions.
| Name | Description | Mandatory |
|---|---|---|
path |
should contain the relative path to the file after the template is instantiated. | yes |
condition |
if the condition evaluates to true, the corresponding path will be added to primary outputs, if false, the path is ignored. If no condition is provided for a path, the condition defaults to true. |
no |
For more information on primary outputs, refer to the article.
Global custom operations and special custom operations
This advanced configuration allows the template author to define custom actions for the template creation process. Global custom operations are scoped globally unless overridden by a more restrictive custom configuration.
Special custom operations are scoped to the files matched by their glob pattern.
Customizations allowed include:
- Flag definitions
- Modification operations
There can only be one instance of the (global) customOperations section, as follows:
"customOperations": {
// configuration details
}But since there can be many instances of the SpecialCustomOperations, each applicable to their glob patterns, the specialCustomOperations configuration section is defined as follows:
"specialCustomOperations": {
"<fileglob1>": {
// configuration details
},
"<fileglob2>": {
// configuration details
},
}The configuration details options are identical in both situations, they only differ in the scopes they're applied in. The below sections are labelled customOperations.<item>, but are equally applicable to specialCustomOperations.<fileglob>.<Item>
| Name | Description | Mandatory |
|---|---|---|
flagPrefix |
Overrides the default prefix to indicate a flag option in a file being processed. | no |
operations |
An array that defines custom operations for processing data in the files within the scope of the configuration. These operations are applied in addition to other operations setup by default, except in the case of the conditional operation. If a custom conditional operation is defined, the default conditional operation(s) are ignored (in this scope). | no |
operations.type |
Indicates the type of operation being configured. The operations currently available to configure are: - balancedNesting- conditional - flag - include- region - replacement |
yes |
operations.condition |
A boolean expression whose result determines whether or not to use this custom operation. If this is not provided, the operation is used. | no |
operations.configuration |
The details of the operation configuration. Each type of operation has its own configuration options, as detailed below. | yes |
SpecialCustomOperations can be used for adding conditions for handling files with extensions not listed in Conditional processing and comment syntax.
{
"SpecialCustomOperations": {
"**.axml": {
"operations": [
{
"type": "conditional",
"configuration": {
"endif": [ "#endif", " https://github.com/dotnet/sdk/issues/YYYY
1 ---> 4283
2 ---> 4284
3 ---> 4285
4 ---> 4286
9 ---> 4287
10 ---> 4288
11 ---> 4289
12 ---> 4290
13 ---> 4291
14 ---> 4292
15 ---> 4293
16 ---> 4294
17 ---> 4295
18 ---> 4296
19 ---> 4297
20 ---> 4298
21 ---> 4299
22 ---> 4300
23 ---> 4301
24 ---> 4302
25 ---> 4303
26 ---> 4304
27 ---> 4305
28 ---> 4306
29 ---> 4307
30 ---> 4308
31 ---> 4309
32 ---> 4310
34 ---> 4311
35 ---> 4312
36 ---> 4313
39 ---> 4314
41 ---> 4315
44 ---> 4316
45 ---> 4317
47 ---> 4318
48 ---> 4319
51 ---> 4320
52 ---> 4321
53 ---> 4322
55 ---> 4323
57 ---> 4324
58 ---> 4325
59 ---> 4326
60 ---> 4327
62 ---> 4328
63 ---> 4329
64 ---> 4330
65 ---> 4331
66 ---> 4332
67 ---> 4333
68 ---> 4334
70 ---> 4335
71 ---> 4336
72 ---> 4337
76 ---> 4338
77 ---> 4339
79 ---> 4340
81 ---> 4341
82 ---> 4342
83 ---> 4343
84 ---> 4344
85 ---> 4345
90 ---> 4346
101 ---> 4347
106 ---> 4348
107 ---> 4349
112 ---> 4350
115 ---> 4351
116 ---> 4352
117 ---> 4353
118 ---> 4354
119 ---> 4355
125 ---> 4356
126 ---> 4357
127 ---> 4358
128 ---> 4359
129 ---> 4360
132 ---> 4361
134 ---> 4362
136 ---> 4363
137 ---> 4364
140 ---> 4365
144 ---> 4366
151 ---> 4367
156 ---> 4368
157 ---> 4369
159 ---> 4370
164 ---> 4371
165 ---> 4372
166 ---> 4373
167 ---> 4374
168 ---> 4375
171 ---> 4376
175 ---> 4377
181 ---> 4378
182 ---> 4379
184 ---> 4380
185 ---> 4381
186 ---> 4382
187 ---> 4383
191 ---> 4384
192 ---> 4385
194 ---> 4386
195 ---> 4387
198 ---> 4388
199 ---> 4389
200 ---> 4390
201 ---> 4391
202 ---> 4392
205 ---> 4393
212 ---> 4394
214 ---> 4395
215 ---> 4396
216 ---> 4397
218 ---> 4398
219 ---> 4399
221 ---> 4400
223 ---> 4401
226 ---> 4402
232 ---> 4403
233 ---> 4404
234 ---> 4405
236 ---> 4406
237 ---> 4407
238 ---> 4408
240 ---> 4409
242 ---> 4410
244 ---> 4411
246 ---> 4412
247 ---> 4413
249 ---> 4414
250 ---> 4415
251 ---> 4416
253 ---> 4417
254 ---> 4418
255 ---> 4419
257 ---> 4420
258 ---> 4421
259 ---> 4422
260 ---> 4423
261 ---> 4424
262 ---> 4425
263 ---> 4426
265 ---> 4427
266 ---> 4428
269 ---> 4429
270 ---> 4430
271 ---> 4431
274 ---> 4432
275 ---> 4433
278 ---> 4434
279 ---> 4435
280 ---> 4436
281 ---> 4437
282 ---> 4438
283 ---> 4439
287 ---> 4440
289 ---> 4441
290 ---> 4442
291 ---> 4443
293 ---> 4444
294 ---> 4445
295 ---> 4446
296 ---> 4447
298 ---> 4448
300 ---> 4449
301 ---> 4450
302 ---> 4451
304 ---> 4452
305 ---> 4453
306 ---> 4454
307 ---> 4455
308 ---> 4456
309 ---> 4457
311 ---> 4458
312 ---> 4459
313 ---> 4460
314 ---> 4461
316 ---> 4462
317 ---> 4463
319 ---> 4464
320 ---> 4465
325 ---> 4466
326 ---> 4467
328 ---> 4468
329 ---> 4469
332 ---> 4470
333 ---> 4471
335 ---> 4472
340 ---> 4473
342 ---> 4474
345 ---> 4475
350 ---> 4476
351 ---> 4477
353 ---> 4478
354 ---> 4479
356 ---> 4480
359 ---> 4481
360 ---> 4482
362 ---> 4483
365 ---> 4484
366 ---> 4485
369 ---> 4486
371 ---> 4487
374 ---> 4488
375 ---> 4489
376 ---> 4490
377 ---> 4491
381 ---> 4492
382 ---> 4493
383 ---> 4494
385 ---> 4495
390 ---> 4496
391 ---> 4497
392 ---> 4498
393 ---> 4499
394 ---> 4500
395 ---> 4501
397 ---> 4502
398 ---> 4503
399 ---> 4504
401 ---> 4505
402 ---> 4506
403 ---> 4507
404 ---> 4508
405 ---> 4509
406 ---> 4510
407 ---> 4511
408 ---> 4512
412 ---> 4513
414 ---> 4514
415 ---> 4515
416 ---> 4516
417 ---> 4517
418 ---> 4518
419 ---> 4519
420 ---> 4520
421 ---> 4521
422 ---> 4522
423 ---> 4523
426 ---> 4524
427 ---> 4525
428 ---> 4526
429 ---> 4527
431 ---> 4528
432 ---> 4529
433 ---> 4530
435 ---> 4531
437 ---> 4532
438 ---> 4533
439 ---> 4534
440 ---> 4535
441 ---> 4536
442 ---> 4537
443 ---> 4538
444 ---> 4539
446 ---> 4540
447 ---> 4541
450 ---> 4542
451 ---> 4543
452 ---> 4544
453 ---> 4545
454 ---> 4546
459 ---> 4547
460 ---> 4548
462 ---> 4549
463 ---> 4550
464 ---> 4551
465 ---> 4552
467 ---> 4553
468 ---> 4554
470 ---> 4555
471 ---> 4556
473 ---> 4557
476 ---> 4558
477 ---> 4559
478 ---> 4560
479 ---> 4561
481 ---> 4562
483 ---> 4563
484 ---> 4564
485 ---> 4565
486 ---> 4566
488 ---> 4567
489 ---> 4568
490 ---> 4569
491 ---> 4570
492 ---> 4571
494 ---> 4572
495 ---> 4573
496 ---> 4574
498 ---> 4575
500 ---> 4576
501 ---> 4577
502 ---> 4578
503 ---> 4579
504 ---> 4580
505 ---> 4581
506 ---> 4582
507 ---> 4583
510 ---> 4584
511 ---> 4585
513 ---> 4586
514 ---> 4587
515 ---> 4588
518 ---> 4589
519 ---> 4590
520 ---> 4591
523 ---> 4592
525 ---> 4593
526 ---> 4594
527 ---> 4595
528 ---> 4596
529 ---> 4597
531 ---> 4598
532 ---> 4599
533 ---> 4600
535 ---> 4601
539 ---> 4602
540 ---> 4603
541 ---> 4604
546 ---> 4605
547 ---> 4606
548 ---> 4607
549 ---> 4608
550 ---> 4609
551 ---> 4610
552 ---> 4611
553 ---> 4612
554 ---> 4613
555 ---> 4614
556 ---> 4615
557 ---> 4616
558 ---> 4617
559 ---> 4618
560 ---> 4619
561 ---> 4620
562 ---> 4621
563 ---> 4622
564 ---> 4623
565 ---> 4624
566 ---> 4625
567 ---> 4626
568 ---> 4627
569 ---> 4628
570 ---> 4629
571 ---> 4630
572 ---> 4631
573 ---> 4632
574 ---> 4633
575 ---> 4634
576 ---> 4635
577 ---> 4636
578 ---> 4637
579 ---> 4638
580 ---> 4639
581 ---> 4640
582 ---> 4641
583 ---> 4642
584 ---> 4643
585 ---> 4644
586 ---> 4645
587 ---> 4646
588 ---> 4647
589 ---> 4648
590 ---> 4649
591 ---> 4650
592 ---> 4651
593 ---> 4652
594 ---> 4653
595 ---> 4654
596 ---> 4655
597 ---> 4656
598 ---> 4657
599 ---> 4658
600 ---> 4659
601 ---> 4660
602 ---> 4661
603 ---> 4662
604 ---> 4663
605 ---> 4664
606 ---> 4665
607 ---> 4666
608 ---> 4667
609 ---> 4668
610 ---> 4669
615 ---> 4670
616 ---> 4671
618 ---> 4672
619 ---> 4673
620 ---> 4674
623 ---> 4675
624 ---> 4676
627 ---> 4677
628 ---> 4678
629 ---> 4679
631 ---> 4680
633 ---> 4681
635 ---> 4682
639 ---> 4683
640 ---> 4684
641 ---> 4685
643 ---> 4686
645 ---> 4687
646 ---> 4688
647 ---> 4689
648 ---> 4690
649 ---> 4691
651 ---> 4692
652 ---> 4693
654 ---> 4694
655 ---> 4695
656 ---> 4696
657 ---> 4697
659 ---> 4698
663 ---> 4699
668 ---> 4700
669 ---> 4701
670 ---> 4702
671 ---> 4703
673 ---> 4704
674 ---> 4705
678 ---> 4706
680 ---> 4707
682 ---> 4708
683 ---> 4709
685 ---> 4710
686 ---> 4711
687 ---> 4712
691 ---> 4713
692 ---> 4714
693 ---> 4715
694 ---> 4716
696 ---> 4717
697 ---> 4718
698 ---> 4719
702 ---> 4720
703 ---> 4721
704 ---> 4722
707 ---> 4723
710 ---> 4724
711 ---> 4725
712 ---> 4726
714 ---> 4727
715 ---> 4728
716 ---> 4729
718 ---> 4730
720 ---> 4731
721 ---> 4732
724 ---> 4733
726 ---> 4734
728 ---> 4735
729 ---> 4736
732 ---> 4737
733 ---> 4738
735 ---> 4739
737 ---> 4740
738 ---> 4741
742 ---> 4742
743 ---> 4743
745 ---> 4744
749 ---> 4745
750 ---> 4746
753 ---> 4747
754 ---> 4748
760 ---> 4749
762 ---> 4750
764 ---> 4751
765 ---> 4752
768 ---> 4753
771 ---> 4754
772 ---> 4755
773 ---> 4756
775 ---> 4757
777 ---> 4758
778 ---> 4759
781 ---> 4760
783 ---> 4761
784 ---> 4762
786 ---> 4763
790 ---> 4764
792 ---> 4765
794 ---> 4766
797 ---> 4767
799 ---> 4768
801 ---> 4769
802 ---> 4770
803 ---> 4771
804 ---> 4772
805 ---> 4773
806 ---> 4774
807 ---> 4775
809 ---> 4776
810 ---> 4777
811 ---> 4778
812 ---> 4779
813 ---> 4780
814 ---> 4781
819 ---> 4782
822 ---> 4783
823 ---> 4784
824 ---> 4785
825 ---> 4786
827 ---> 4787
832 ---> 4788
834 ---> 4789
835 ---> 4790
838 ---> 4791
839 ---> 4792
841 ---> 4793
844 ---> 4794
845 ---> 4795
846 ---> 4796
847 ---> 4797
848 ---> 4798
850 ---> 4799
854 ---> 4800
857 ---> 4801
858 ---> 4802
862 ---> 4803
864 ---> 4804
865 ---> 4805
866 ---> 4806
869 ---> 4807
870 ---> 4808
871 ---> 4809
876 ---> 4810
878 ---> 4811
881 ---> 4812
882 ---> 4813
884 ---> 4814
885 ---> 4815
886 ---> 4816
887 ---> 4817
888 ---> 4818
889 ---> 4819
892 ---> 4820
895 ---> 4821
897 ---> 4822
900 ---> 4823
901 ---> 4824
903 ---> 4825
904 ---> 4826
905 ---> 4827
907 ---> 4828
908 ---> 4829
910 ---> 4830
911 ---> 4831
912 ---> 4832
913 ---> 4833
914 ---> 4834
917 ---> 4835
918 ---> 4836
925 ---> 4837
928 ---> 4838
932 ---> 4839
933 ---> 4840
934 ---> 4841
937 ---> 4842
938 ---> 4843
941 ---> 4844
948 ---> 4845
949 ---> 4846
950 ---> 4847
951 ---> 4848
952 ---> 4849
953 ---> 4850
954 ---> 4851
955 ---> 4852
956 ---> 4853
959 ---> 4854
961 ---> 4855
962 ---> 4856
964 ---> 4857
965 ---> 4858
966 ---> 4859
967 ---> 4860
968 ---> 4861
969 ---> 4862
970 ---> 4863
974 ---> 4864
977 ---> 4865
980 ---> 4866
982 ---> 4867
986 ---> 4868
987 ---> 4869
988 ---> 4870
990 ---> 4871
991 ---> 4872
992 ---> 4873
994 ---> 4874
995 ---> 4875
997 ---> 4876
1000 ---> 4877
1001 ---> 4878
1002 ---> 4879
1003 ---> 4880
1005 ---> 4881
1006 ---> 4882
1007 ---> 4883
1008 ---> 4884
1009 ---> 4885
1010 ---> 4886
1011 ---> 4887
1014 ---> 4888
1016 ---> 4889
1017 ---> 4890
1019 ---> 4891
1020 ---> 4892
1022 ---> 4893
1024 ---> 4894
1026 ---> 4895
1031 ---> 4896
1032 ---> 4897
1033 ---> 4898
1034 ---> 4899
1035 ---> 4900
1036 ---> 4901
1038 ---> 4902
1039 ---> 4903
1040 ---> 4904
1041 ---> 4905
1042 ---> 4906
1043 ---> 4907
1044 ---> 4908
1046 ---> 4909
1047 ---> 4910
1049 ---> 4911
1050 ---> 4912
1053 ---> 4913
1054 ---> 4914
1057 ---> 4915
1059 ---> 4916
1064 ---> 4917
1065 ---> 4918
1066 ---> 4919
1068 ---> 4920
1069 ---> 4921
1070 ---> 4922
1071 ---> 4923
1072 ---> 4924
1073 ---> 4925
1075 ---> 4926
1076 ---> 4927
1079 ---> 4928
1080 ---> 4929
1081 ---> 4930
1084 ---> 4931
1087 ---> 4932
1090 ---> 4933
1091 ---> 4934
1092 ---> 4935
1093 ---> 4936
1094 ---> 4937
1096 ---> 4938
1098 ---> 4939
1099 ---> 4940
1101 ---> 4941
1102 ---> 4942
1103 ---> 4943
1106 ---> 4944
1109 ---> 4945
1110 ---> 4946
1111 ---> 4947
1112 ---> 4948
1115 ---> 4949
1118 ---> 4950
1119 ---> 4951
1122 ---> 4952
1125 ---> 4953
1126 ---> 4954
1129 ---> 4955
1131 ---> 4956
1132 ---> 4957
1135 ---> 4958
1136 ---> 4959
1137 ---> 4960
1139 ---> 4961
1140 ---> 4962
1141 ---> 4963
1142 ---> 4964
1143 ---> 4965
1144 ---> 4966
1145 ---> 4967
1146 ---> 4968
1147 ---> 4969
1148 ---> 4970
1149 ---> 4971
1150 ---> 4972
1152 ---> 4973
1153 ---> 4974
1154 ---> 4975
1156 ---> 4976
1161 ---> 4977
1162 ---> 4978
1163 ---> 4979
1165 ---> 4980
1166 ---> 4981
1171 ---> 4982
1174 ---> 4983
1177 ---> 4984
1179 ---> 4985
1181 ---> 4986
1183 ---> 4987
1184 ---> 4988
1188 ---> 4989
1189 ---> 4990
1190 ---> 4991
1196 ---> 4992
1199 ---> 4993
1201 ---> 4994
1202 ---> 4995
1204 ---> 4996
1205 ---> 4997
1210 ---> 4998
1213 ---> 4999
1215 ---> 5000
1216 ---> 5001
1218 ---> 5002
1219 ---> 5003
1222 ---> 5004
1223 ---> 5005
1224 ---> 5006
1227 ---> 5007
1229 ---> 5008
1230 ---> 5009
1233 ---> 5010
1236 ---> 5011
1237 ---> 5012
1239 ---> 5013
1245 ---> 5014
1246 ---> 5015
1247 ---> 5016
1250 ---> 5017
1251 ---> 5018
1255 ---> 5019
1266 ---> 5020
1267 ---> 5021
1268 ---> 5022
1273 ---> 5023
1274 ---> 5024
1275 ---> 5025
1276 ---> 5026
1277 ---> 5027
1278 ---> 5028
1279 ---> 5029
1280 ---> 5030
1282 ---> 5031
1283 ---> 5032
1286 ---> 5033
1287 ---> 5034
1288 ---> 5035
1289 ---> 5036
1290 ---> 5037
1291 ---> 5038
1292 ---> 5039
1294 ---> 5040
1296 ---> 5041
1297 ---> 5042
1298 ---> 5043
1299 ---> 5044
1301 ---> 5045
1302 ---> 5046
1303 ---> 5047
1304 ---> 5048
1305 ---> 5049
1306 ---> 5050
1307 ---> 5051
1308 ---> 5052
1309 ---> 5053
1310 ---> 5054
1311 ---> 5055
1315 ---> 5056
1316 ---> 5057
1319 ---> 5058
1320 ---> 5059
1322 ---> 5060
1323 ---> 5061
1326 ---> 5062
1327 ---> 5063
1329 ---> 5064
1331 ---> 5065
1334 ---> 5066
1335 ---> 5067
1336 ---> 5068
1337 ---> 5069
1339 ---> 5070
1341 ---> 5071
1342 ---> 5072
1343 ---> 5073
1344 ---> 5074
1349 ---> 5075
1351 ---> 5076
1352 ---> 5077
1353 ---> 5078
1355 ---> 5079
1356 ---> 5080
1359 ---> 5081
1360 ---> 5082
1361 ---> 5083
1365 ---> 5084
1366 ---> 5085
1368 ---> 5086
1369 ---> 5087
1370 ---> 5088
1371 ---> 5089
1372 ---> 5090
1374 ---> 5091
1376 ---> 5092
1380 ---> 5093
1381 ---> 5094
1383 ---> 5095
1384 ---> 5096
1385 ---> 5097
1388 ---> 5098
1389 ---> 5099
1390 ---> 5100
1391 ---> 5101
1394 ---> 5102
1396 ---> 5103
1399 ---> 5104
1401 ---> 5105
1403 ---> 5106
1404 ---> 5107
1405 ---> 5108
1407 ---> 5109
1409 ---> 5110
1410 ---> 5111
1412 ---> 5112
1413 ---> 5113
1414 ---> 5114
1415 ---> 5115
1420 ---> 5116
1422 ---> 5117
1425 ---> 5118
1427 ---> 5119
1429 ---> 5120
1430 ---> 5121
1431 ---> 5122
1433 ---> 5123
1437 ---> 5124
1440 ---> 5125
1445 ---> 5126
1446 ---> 5127
1447 ---> 5128
1448 ---> 5129
1450 ---> 5130
1453 ---> 5131
1456 ---> 5132
1459 ---> 5133
1472 ---> 5134
1473 ---> 5135
1474 ---> 5136
1475 ---> 5137
1476 ---> 5138
1480 ---> 5139
1481 ---> 5140
1485 ---> 5141
1486 ---> 5142
1488 ---> 5143
1489 ---> 5144
1492 ---> 5145
1493 ---> 5146
1494 ---> 5147
1495 ---> 5148
1496 ---> 5149
1497 ---> 5150
1498 ---> 5151
1503 ---> 5152
1505 ---> 5153
1506 ---> 5154
1507 ---> 5155
1508 ---> 5156
1509 ---> 5157
1510 ---> 5158
1512 ---> 5159
1514 ---> 5160
1515 ---> 5161
1517 ---> 5162
1518 ---> 5163
1519 ---> 5164
1520 ---> 5165
1521 ---> 5166
1525 ---> 5167
1527 ---> 5168
1528 ---> 5169
1531 ---> 5170
1532 ---> 5171
1534 ---> 5172
1537 ---> 5173
1540 ---> 5174
1541 ---> 5175
1542 ---> 5176
1543 ---> 5177
1544 ---> 5178
1545 ---> 5179
1547 ---> 5180
1548 ---> 5181
1549 ---> 5182
1550 ---> 5183
1555 ---> 5184
1556 ---> 5185
1557 ---> 5186
1558 ---> 5187
1559 ---> 5188
1560 ---> 5189
1561 ---> 5190
1562 ---> 5191
1566 ---> 5192
1567 ---> 5193
1569 ---> 5194
1570 ---> 5195
1571 ---> 5196
1572 ---> 5197
1573 ---> 5198
1574 ---> 5199
1575 ---> 5200
1576 ---> 5201
1578 ---> 5202
1579 ---> 5203
1580 ---> 5204
1581 ---> 5205
1582 ---> 5206
1584 ---> 5207
1585 ---> 5208
1586 ---> 5209
1587 ---> 5210
1588 ---> 5211
1589 ---> 5212
1591 ---> 5213
1592 ---> 5214
1593 ---> 5215
1596 ---> 5216
1599 ---> 5217
1600 ---> 5218
1601 ---> 5219
1602 ---> 5220
1603 ---> 5221
1604 ---> 5222
1605 ---> 5223
1606 ---> 5224
1607 ---> 5225
1612 ---> 5226
1613 ---> 5227
1614 ---> 5228
1616 ---> 5229
1617 ---> 5230
1618 ---> 5231
1619 ---> 5232
1620 ---> 5233
1623 ---> 5234
1624 ---> 5235
1625 ---> 5236
1626 ---> 5237
1627 ---> 5238
1628 ---> 5239
1629 ---> 5240
1631 ---> 5241
1632 ---> 5242
1635 ---> 5243
1637 ---> 5244
1639 ---> 5245
1641 ---> 5246
1642 ---> 5247
1643 ---> 5248
1644 ---> 5249
1646 ---> 5250
1647 ---> 5251
1649 ---> 5252
1650 ---> 5253
1651 ---> 5254
1654 ---> 5255
1655 ---> 5256
1656 ---> 5257
1657 ---> 5258
1658 ---> 5259
1659 ---> 5260
1661 ---> 5261
1662 ---> 5262
1663 ---> 5263
1664 ---> 5264
1665 ---> 5265
1666 ---> 5266
1668 ---> 5267
1669 ---> 5268
1670 ---> 5269
1672 ---> 5270
1675 ---> 5271
1677 ---> 5272
1679 ---> 5273
1680 ---> 5274
1681 ---> 5275
1682 ---> 5276
1683 ---> 5277
1685 ---> 5278
1686 ---> 5279
1688 ---> 5280
1689 ---> 5281
1690 ---> 5282
1693 ---> 5283
1694 ---> 5284
1695 ---> 5285
1698 ---> 5286
1700 ---> 5287
1702 ---> 5288
1705 ---> 5289
1706 ---> 5290
1707 ---> 5291
1709 ---> 5292
1711 ---> 5293
1713 ---> 5294
1714 ---> 5295
1715 ---> 5296
1716 ---> 5297
1717 ---> 5298
1718 ---> 5299
1719 ---> 5300
1720 ---> 5301
1721 ---> 5302
1722 ---> 5303
1723 ---> 5304
1725 ---> 5305
1726 ---> 5306
1727 ---> 5307
1728 ---> 5308
1729 ---> 5309
1730 ---> 5310
1732 ---> 5311
1733 ---> 5312
1735 ---> 5313
1736 ---> 5314
1742 ---> 5315
1743 ---> 5316
1744 ---> 5317
1745 ---> 5318
1746 ---> 5319
1748 ---> 5320
1749 ---> 5321
1751 ---> 5322
1752 ---> 5323
1753 ---> 5324
1754 ---> 5325
1755 ---> 5326
1758 ---> 5327
1759 ---> 5328
1760 ---> 5329
1762 ---> 5330
1764 ---> 5331
1765 ---> 5332
1767 ---> 5333
1770 ---> 5334
1771 ---> 5335
1774 ---> 5336
1775 ---> 5337
1776 ---> 5338
1777 ---> 5339
1778 ---> 5340
1779 ---> 5341
1780 ---> 5342
1781 ---> 5343
1783 ---> 5344
1785 ---> 5345
1787 ---> 5346
1788 ---> 5347
1790 ---> 5348
1791 ---> 5349
1793 ---> 5350
1794 ---> 5351
1797 ---> 5352
1799 ---> 5353
1800 ---> 5354
1803 ---> 5355
1804 ---> 5356
1805 ---> 5357
1811 ---> 5358
1812 ---> 5359
1813 ---> 5360
1815 ---> 5361
1816 ---> 5362
1818 ---> 5363
1821 ---> 5364
1822 ---> 5365
1826 ---> 5366
1827 ---> 5367
1828 ---> 5368
1829 ---> 5369
1830 ---> 5370
1832 ---> 5371
1833 ---> 5372
1834 ---> 5373
1835 ---> 5374
1837 ---> 5375
1839 ---> 5376
1846 ---> 5377
1848 ---> 5378
1854 ---> 5379
1855 ---> 5380
1858 ---> 5381
1859 ---> 5382
1860 ---> 5383
1863 ---> 5384
1864 ---> 5385
1876 ---> 5386
1881 ---> 5387
1882 ---> 5388
1886 ---> 5389
1888 ---> 5390
1896 ---> 5391
1897 ---> 5392
1904 ---> 5393
1905 ---> 5394
1907 ---> 5395
1908 ---> 5396
1910 ---> 5397
1914 ---> 5398
1916 ---> 5399
1917 ---> 5400
1919 ---> 5401
1924 ---> 5402
1925 ---> 5403
1926 ---> 5404
1928 ---> 5405
1933 ---> 5406
1935 ---> 5407
1936 ---> 5408
1940 ---> 5409
1944 ---> 5410
1948 ---> 5411
1949 ---> 5412
1950 ---> 5413
1955 ---> 5414
1956 ---> 5415
1957 ---> 5416
1958 ---> 5417
1959 ---> 5418
1961 ---> 5419
1962 ---> 5420
1963 ---> 5421
1964 ---> 5422
1965 ---> 5423
1966 ---> 5424
1967 ---> 5425
1968 ---> 5426
1970 ---> 5427
1973 ---> 5428
1974 ---> 5429
1975 ---> 5430
1976 ---> 5431
1977 ---> 5432
1979 ---> 5433
1981 ---> 5434
1985 ---> 5435
1988 ---> 5436
1992 ---> 5437
1993 ---> 5438
1994 ---> 5439
1995 ---> 5440
1997 ---> 5441
1998 ---> 5442
2000 ---> 5443
2001 ---> 5444
2002 ---> 5445
2004 ---> 5446
2005 ---> 5447
2006 ---> 5448
2007 ---> 5449
2008 ---> 5450
2009 ---> 5451
2010 ---> 5452
2012 ---> 5453
2013 ---> 5454
2018 ---> 5455
2020 ---> 5456
2024 ---> 5457
2025 ---> 5458
2026 ---> 5459
2027 ---> 5460
2028 ---> 5461
2037 ---> 5462
2038 ---> 5463
2039 ---> 5464
2042 ---> 5465
2044 ---> 5466
2045 ---> 5467
2047 ---> 5468
2050 ---> 5469
2052 ---> 5470
2054 ---> 5471
2055 ---> 5472
2057 ---> 5473
2058 ---> 5474
2059 ---> 5475
2061 ---> 5476
2063 ---> 5477
2070 ---> 5478
2071 ---> 5479
2072 ---> 5480
2073 ---> 5481
2081 ---> 5482
2082 ---> 5483
2085 ---> 5484
2089 ---> 5485
2090 ---> 5486
2091 ---> 5487
2093 ---> 5488
2098 ---> 5489
2099 ---> 5490
2100 ---> 5491
2103 ---> 5492
2104 ---> 5493
2110 ---> 5494
2112 ---> 5495
2113 ---> 5496
2115 ---> 5497
2116 ---> 5498
2119 ---> 5499
2120 ---> 5500
2121 ---> 5501
2122 ---> 5502
2123 ---> 5503
2125 ---> 5504
2126 ---> 5505
2127 ---> 5506
2129 ---> 5507
2132 ---> 5508
2134 ---> 5509
2135 ---> 5510
2140 ---> 5511
2141 ---> 5512
2142 ---> 5513
2143 ---> 5514
2146 ---> 5515
2152 ---> 5516
2154 ---> 5517
2155 ---> 5518
2157 ---> 5519
2159 ---> 5520
2161 ---> 5521
2164 ---> 5522
2165 ---> 5523
2166 ---> 5524
2170 ---> 5525
2172 ---> 5526
2173 ---> 5527
2174 ---> 5528
2175 ---> 5529
2176 ---> 5530
2178 ---> 5531
2179 ---> 5532
2180 ---> 5533
2182 ---> 5534
2183 ---> 5535
2184 ---> 5536
2189 ---> 5537
2190 ---> 5538
2192 ---> 5539
2193 ---> 5540
2194 ---> 5541
2195 ---> 5542
2196 ---> 5543
2199 ---> 5544
2200 ---> 5545
2201 ---> 5546
2202 ---> 5547
2203 ---> 5548
2204 ---> 5549
2205 ---> 5550
2206 ---> 5551
2207 ---> 5552
2210 ---> 5553
2211 ---> 5554
2212 ---> 5555
2213 ---> 5556
2216 ---> 5557
2217 ---> 5558
2218 ---> 5559
2221 ---> 5560
2222 ---> 5561
2225 ---> 5562
2228 ---> 5563
2229 ---> 5564
2230 ---> 5565
2231 ---> 5566
2233 ---> 5567
2234 ---> 5568
2236 ---> 5569
2237 ---> 5570
2241 ---> 5571
2242 ---> 5572
2243 ---> 5573
2245 ---> 5574
2246 ---> 5575
2250 ---> 5576
2251 ---> 5577
2252 ---> 5578
2254 ---> 5579
2255 ---> 5580
2256 ---> 5581
2257 ---> 5582
2258 ---> 5583
2260 ---> 5584
2261 ---> 5585
2262 ---> 5586
2263 ---> 5587
2265 ---> 5588
2266 ---> 5589
2267 ---> 5590
2270 ---> 5591
2273 ---> 5592
2276 ---> 5593
2277 ---> 5594
2278 ---> 5595
2279 ---> 5596
2281 ---> 5597
2285 ---> 5598
2286 ---> 5599
2287 ---> 5600
2288 ---> 5601
2289 ---> 5602
2291 ---> 5603
2292 ---> 5604
2293 ---> 5605
2295 ---> 5606
2299 ---> 5607
2302 ---> 5608
2303 ---> 5609
2305 ---> 5610
2307 ---> 5611
2308 ---> 5612
2309 ---> 5613
2311 ---> 5614
2314 ---> 5615
2315 ---> 5616
2317 ---> 5617
2318 ---> 5618
2322 ---> 5619
2324 ---> 5620
2326 ---> 5621
2327 ---> 5622
2330 ---> 5623
2332 ---> 5624
2333 ---> 5625
2334 ---> 5626
2335 ---> 5627
2336 ---> 5628
2339 ---> 5629
2341 ---> 5630
2343 ---> 5631
2344 ---> 5632
2346 ---> 5633
2347 ---> 5634
2348 ---> 5635
2349 ---> 5636
2351 ---> 5637
2352 ---> 5638
2355 ---> 5639
2357 ---> 5640
2359 ---> 5641
2361 ---> 5642
2362 ---> 5643
2364 ---> 5644
2366 ---> 5645
2367 ---> 5646
2369 ---> 5647
2370 ---> 5648
2372 ---> 5649
2373 ---> 5650
2374 ---> 5651
2375 ---> 5652
2380 ---> 5653
2381 ---> 5654
2382 ---> 5655
2383 ---> 5656
2384 ---> 5657
2385 ---> 5658
2386 ---> 5659
2388 ---> 5660
2389 ---> 5661
2390 ---> 5662
2391 ---> 5663
2393 ---> 5664
2394 ---> 5665
2395 ---> 5666
2396 ---> 5667
2397 ---> 5668
2398 ---> 5669
2400 ---> 5670
2402 ---> 5671
2404 ---> 5672
2405 ---> 5673
2406 ---> 5674
2407 ---> 5675
2408 ---> 5676
2413 ---> 5677
2417 ---> 5678
2418 ---> 5679
2419 ---> 5680
2420 ---> 5681
2421 ---> 5682
2423 ---> 5683
2424 ---> 5684
2425 ---> 5685
2426 ---> 5686
2427 ---> 5687
2428 ---> 5688
2429 ---> 5689
2430 ---> 5690
2431 ---> 5691
2432 ---> 5692
2433 ---> 5693
2434 ---> 5694
2435 ---> 5695
2436 ---> 5696
2438 ---> 5697
2440 ---> 5698
2442 ---> 5699
2444 ---> 5700
2446 ---> 5701
2448 ---> 5702
2451 ---> 5703
2452 ---> 5704
2453 ---> 5705
2454 ---> 5706
2455 ---> 5707
2456 ---> 5708
2457 ---> 5709
2458 ---> 5710
2459 ---> 5711
2460 ---> 5712
2461 ---> 5713
2462 ---> 5714
2463 ---> 5715
2464 ---> 5716
2465 ---> 5717
2466 ---> 5718
2467 ---> 5719
2468 ---> 5720
2469 ---> 5721
2474 ---> 5722
2475 ---> 5723
2476 ---> 5724
2477 ---> 5725
2479 ---> 5726
2480 ---> 5727
2482 ---> 5728
2483 ---> 5729
2484 ---> 5730
2485 ---> 5731
2486 ---> 5732
2487 ---> 5733
2488 ---> 5734
2489 ---> 5735
2490 ---> 5736
2492 ---> 5737
2494 ---> 5738
2495 ---> 5739
2496 ---> 5740
2497 ---> 5741
2498 ---> 5742
2499 ---> 5743
2500 ---> 5744
2501 ---> 5745
2502 ---> 5746
2503 ---> 5747
2504 ---> 5748
2505 ---> 5749
2506 ---> 5750
2507 ---> 5751
2509 ---> 5752
2510 ---> 5753
2512 ---> 5754
2513 ---> 5755
2514 ---> 5756
2515 ---> 5757
2520 ---> 5758
2521 ---> 5759
2522 ---> 5760
2523 ---> 5761
2524 ---> 5762
2525 ---> 5763
2526 ---> 5764
2528 ---> 5765
2529 ---> 5766
2531 ---> 5767
2532 ---> 5768
2533 ---> 5769
2535 ---> 5770
2536 ---> 5771
2537 ---> 5772
2540 ---> 5773
2541 ---> 5774
2542 ---> 5775
2543 ---> 5776
2544 ---> 5777
2545 ---> 5778
2547 ---> 5779
2549 ---> 5780
2551 ---> 5781
2552 ---> 5782
2555 ---> 5783
2556 ---> 5784
2558 ---> 5785
2561 ---> 5786
2562 ---> 5787
2563 ---> 5788
2564 ---> 5789
2565 ---> 5790
2566 ---> 5791
2567 ---> 5792
2568 ---> 5793
2569 ---> 5794
2570 ---> 5795
2571 ---> 5796
2572 ---> 5797
2573 ---> 5798
2576 ---> 5799
2577 ---> 5800
2578 ---> 5801
2581 ---> 5802
2582 ---> 5803
2583 ---> 5804
2584 ---> 5805
2585 ---> 5806
2587 ---> 5807
2588 ---> 5808
2589 ---> 5809
2590 ---> 5810
2592 ---> 5811
2593 ---> 5812
2595 ---> 5813
2596 ---> 5814
2598 ---> 5815
2599 ---> 5816
2600 ---> 5817
2602 ---> 5818
2604 ---> 5819
2605 ---> 5820
2607 ---> 5821
2608 ---> 5822
2609 ---> 5823
2611 ---> 5824
2612 ---> 5825
2613 ---> 5826
2615 ---> 5827
2616 ---> 5828
2618 ---> 5829
2621 ---> 5830
2622 ---> 5831
2623 ---> 5832
2624 ---> 5833
2625 ---> 5834
2627 ---> 5835
2628 ---> 5836
2629 ---> 5837
2632 ---> 5838
2633 ---> 5839
2634 ---> 5840
2635 ---> 5841
2637 ---> 5842
2639 ---> 5843
2640 ---> 5844
2641 ---> 5845
2643 ---> 5846
2644 ---> 5847
2645 ---> 5848
2646 ---> 5849
2647 ---> 5850
2649 ---> 5851
2650 ---> 5852
2652 ---> 5853
2655 ---> 5854
2656 ---> 5855
2657 ---> 5856
2660 ---> 5857
2664 ---> 5858
2665 ---> 5859
2666 ---> 5860
2668 ---> 5861
2669 ---> 5862
2671 ---> 5863
2672 ---> 5864
2674 ---> 5865
2675 ---> 5866
2676 ---> 5867
2677 ---> 5868
2678 ---> 5869
2682 ---> 5870
2683 ---> 5871
2686 ---> 5872
2687 ---> 5873
2688 ---> 5874
2689 ---> 5875
2690 ---> 5876
2691 ---> 5877
2692 ---> 5878
2693 ---> 5879
2695 ---> 5880
2697 ---> 5881
2698 ---> 5882
2701 ---> 5883
2702 ---> 5884
2706 ---> 5885
2708 ---> 5886
2710 ---> 5887
2712 ---> 5888
2713 ---> 5889
2714 ---> 5890
2715 ---> 5891
2716 ---> 5892
2718 ---> 5893
2719 ---> 5894
2720 ---> 5895
2727 ---> 5896
2728 ---> 5897
2729 ---> 5898
2730 ---> 5899
2731 ---> 5900
2734 ---> 5901
2737 ---> 5902
2739 ---> 5903
2740 ---> 5904
2741 ---> 5905
2743 ---> 5906
2748 ---> 5907
2751 ---> 5908
2752 ---> 5909
2753 ---> 5910
2754 ---> 5911
2755 ---> 5912
2756 ---> 5913
2758 ---> 5914
2759 ---> 5915
2760 ---> 5916
2761 ---> 5917
2762 ---> 5918
2763 ---> 5919
2765 ---> 5920
2766 ---> 5921
2768 ---> 5922
2771 ---> 5923
2772 ---> 5924
2773 ---> 5925
2775 ---> 5926
2776 ---> 5927
2777 ---> 5928
2780 ---> 5929
2782 ---> 5930
2783 ---> 5931
2784 ---> 5932
2785 ---> 5933
2786 ---> 5934
2788 ---> 5935
2791 ---> 5936
2793 ---> 5937
2794 ---> 5938
2796 ---> 5939
2799 ---> 5940
2800 ---> 5941
2801 ---> 5942
2802 ---> 5943
2803 ---> 5944
2806 ---> 5945
2807 ---> 5946
2810 ---> 5947
2811 ---> 5948
2815 ---> 5949
2817 ---> 5950
2819 ---> 5951
2821 ---> 5952
2823 ---> 5953
2824 ---> 5954
2825 ---> 5955
2826 ---> 5956
2827 ---> 5957
2829 ---> 5958
2830 ---> 5959
2831 ---> 5960
2833 ---> 10584
2835 ---> 5961
2836 ---> 5962
2840 ---> 5963
2841 ---> 5964
2843 ---> 5965
2844 ---> 5966
2845 ---> 5967
2847 ---> 5968
2852 ---> 5969
2853 ---> 5970
2854 ---> 5971
2855 ---> 5972
2859 ---> 5973
2861 ---> 5974
2862 ---> 5975
2865 ---> 5976
2866 ---> 5977
2867 ---> 5978
2869 ---> 5979
2871 ---> 5980
2872 ---> 5981
2873 ---> 5982
2874 ---> 5983
2879 ---> 5984
2881 ---> 5985
2882 ---> 5986
2883 ---> 5987
2884 ---> 5988
2885 ---> 5989
2886 ---> 5990
2887 ---> 5991
2888 ---> 5992
2889 ---> 5993
2890 ---> 5994
2892 ---> 5995
2893 ---> 5996
2894 ---> 5997
2895 ---> 5998
2896 ---> 5999
2897 ---> 6000
2902 ---> 6001
2904 ---> 6002
2905 ---> 6003
2906 ---> 6004
2907 ---> 6005
2908 ---> 6006
2909 ---> 6007
2910 ---> 6008
2911 ---> 6009
2912 ---> 6010
2913 ---> 6011
2914 ---> 6012
2915 ---> 6013
2916 ---> 6014
2917 ---> 6015
2918 ---> 6016
2919 ---> 6017
2920 ---> 6018
2921 ---> 6019
2922 ---> 6020
2923 ---> 6021
2924 ---> 6022
2925 ---> 6023
2926 ---> 6024
2927 ---> 6025
2928 ---> 6026
2929 ---> 6027
2931 ---> 6028
2934 ---> 6029
2935 ---> 6030
2937 ---> 6031
2938 ---> 6032
2939 ---> 6033
2940 ---> 6034
2942 ---> 6035
2944 ---> 6036
2947 ---> 6037
2948 ---> 6038
2949 ---> 6039
2950 ---> 6040
2951 ---> 6041
2952 ---> 6042
2953 ---> 6043
2955 ---> 6044
2956 ---> 6045
2957 ---> 6046
2958 ---> 6047
2959 ---> 6048
2960 ---> 6049
2961 ---> 6050
2962 ---> 6051
2963 ---> 6052
2964 ---> 6053
2965 ---> 6054
2966 ---> 6055
2967 ---> 6056
2968 ---> 6057
2970 ---> 6058
2971 ---> 6059
2972 ---> 6060
2973 ---> 6061
2974 ---> 6062
2975 ---> 6063
2976 ---> 6064
2977 ---> 6065
2978 ---> 6066
2979 ---> 6067
2982 ---> 6068
2983 ---> 6069
2984 ---> 6070
2985 ---> 6071
2986 ---> 6072
2987 ---> 6073
2988 ---> 6074
2989 ---> 6075
2992 ---> 6076
2994 ---> 6077
2995 ---> 6078
2996 ---> 6079
2997 ---> 6080
2999 ---> 6081
3000 ---> 6082
3006 ---> 6083
3008 ---> 6084
3009 ---> 6085
3010 ---> 6086
3012 ---> 6087
3014 ---> 6088
3015 ---> 6089
3016 ---> 6090
3017 ---> 6091
3019 ---> 6092
3021 ---> 6093
3023 ---> 6094
3024 ---> 6095
3026 ---> 6096
3029 ---> 6097
3030 ---> 6098
3031 ---> 6099
3034 ---> 6100
3035 ---> 6101
3036 ---> 6102
3037 ---> 6103
3038 ---> 6104
3040 ---> 6105
3041 ---> 6106
3043 ---> 6107
3044 ---> 6108
3048 ---> 6109
3049 ---> 6110
3050 ---> 6111
3051 ---> 6112
3053 ---> 6113
3054 ---> 6114
3055 ---> 6115
3057 ---> 6116
3059 ---> 6117
3062 ---> 6118
3063 ---> 6119
3064 ---> 6120
3065 ---> 6121
3066 ---> 6122
3067 ---> 6123
3069 ---> 6124
3070 ---> 6125
3071 ---> 6126
3072 ---> 6127
3073 ---> 6128
3075 ---> 6129
3076 ---> 6130
3077 ---> 6131
3078 ---> 6132
3079 ---> 6133
3081 ---> 6134
3082 ---> 6135
3083 ---> 6136
3084 ---> 6137
3085 ---> 6138
3086 ---> 6139
3087 ---> 6140
3088 ---> 6141
3089 ---> 6142
3090 ---> 6143
3091 ---> 6144
3093 ---> 6145
3094 ---> 6146
3095 ---> 6147
3096 ---> 6148
3097 ---> 6149
3098 ---> 6150
3099 ---> 6151
3101 ---> 6152
3102 ---> 6153
3103 ---> 6154
3105 ---> 6155
3108 ---> 6156
3109 ---> 6157
3110 ---> 6158
3112 ---> 6159
3113 ---> 6160
3114 ---> 6161
3115 ---> 6162
3117 ---> 6163
3118 ---> 6164
3119 ---> 6165
3120 ---> 6166
3121 ---> 6167
3123 ---> 6168
3124 ---> 6169
3125 ---> 6170
3126 ---> 6171
3127 ---> 6172
3128 ---> 6173
3130 ---> 6174
3131 ---> 6175
3133 ---> 6176
3135 ---> 6177
3136 ---> 6178
3137 ---> 6179
3141 ---> 6180
3143 ---> 6181
3144 ---> 6182
3145 ---> 6183
3146 ---> 6184
3147 ---> 6185
3151 ---> 6186
3152 ---> 6187
3153 ---> 6188
3154 ---> 6189
3155 ---> 6190
3156 ---> 6191
3157 ---> 6192
3158 ---> 6193
3159 ---> 6194
3162 ---> 6195
3164 ---> 6196
3166 ---> 6197
3168 ---> 6198
3169 ---> 6199
3170 ---> 6200
3171 ---> 6201
3172 ---> 6202
3173 ---> 6203
3174 ---> 6204
3175 ---> 6205
3176 ---> 6206
3177 ---> 6207
3178 ---> 6208
3179 ---> 6209
3181 ---> 6210
3183 ---> 6211
3184 ---> 6212
3185 ---> 6213
3186 ---> 6214
3187 ---> 6215
3189 ---> 6216
3190 ---> 6217
3192 ---> 6218
3193 ---> 6219
3194 ---> 6220
3196 ---> 6221
3197 ---> 6222
3198 ---> 6223
3199 ---> 6224
3200 ---> 6225
3201 ---> 6226
3202 ---> 6227
3203 ---> 6228
3205 ---> 6229
3206 ---> 6230
3209 ---> 6231
3210 ---> 6232
3211 ---> 6233
3212 ---> 6234
3213 ---> 6235
3214 ---> 6236
3216 ---> 6237
3218 ---> 6238
3219 ---> 6239
3220 ---> 6240
3221 ---> 6241
3222 ---> 6242
3224 ---> 6243
3226 ---> 6244
3232 ---> 6245
3233 ---> 6246
3234 ---> 6247
3235 ---> 6248
3237 ---> 6249
3238 ---> 6250
3239 ---> 6251
3243 ---> 6252
3244 ---> 6253
3247 ---> 6254
3249 ---> 6255
3250 ---> 6256
3251 ---> 6257
3252 ---> 6258
3253 ---> 6259
3255 ---> 6260
3259 ---> 6261
3263 ---> 6262
3265 ---> 6263
3266 ---> 6264
3267 ---> 6265
3269 ---> 6266
3274 ---> 6267
3279 ---> 6268
3280 ---> 6269
3282 ---> 6270
3283 ---> 6271
3285 ---> 6272
3286 ---> 6273
3288 ---> 6274
3289 ---> 6275
3290 ---> 6276
3292 ---> 6277
3293 ---> 6278
3294 ---> 6279
3296 ---> 6280
3297 ---> 6281
3298 ---> 6282
3301 ---> 6283
3306 ---> 6284
3307 ---> 6285
3310 ---> 6286
3311 ---> 6287
3314 ---> 6288
3315 ---> 6289
3316 ---> 6290
3317 ---> 6291
3318 ---> 6292
3320 ---> 6293
3322 ---> 6294
3330 ---> 6295
3335 ---> 6296
3338 ---> 6297
3339 ---> 6298
3340 ---> 6299
3342 ---> 6300
3343 ---> 6301
3344 ---> 6302
3345 ---> 6303
3347 ---> 6304
3348 ---> 6305
3349 ---> 6306
3350 ---> 6307
3356 ---> 6308
3360 ---> 6309
3362 ---> 6310
3363 ---> 6311
3365 ---> 6312
3366 ---> 6313
3367 ---> 6314
3368 ---> 6315
3371 ---> 6316
3372 ---> 6317
3377 ---> 6318
3379 ---> 6319
3381 ---> 6320
3382 ---> 6321
3383 ---> 6322
3385 ---> 6323
3387 ---> 6324
3390 ---> 6325
3391 ---> 6326
3392 ---> 6327
3396 ---> 6328
3400 ---> 6329
3401 ---> 6330
3404 ---> 6331
3406 ---> 6332
3408 ---> 6333
3409 ---> 6334
3410 ---> 6335
3415 ---> 6336
3416 ---> 6337
3418 ---> 6338
3419 ---> 6339
3420 ---> 6340
3421 ---> 6341
3422 ---> 6342
3424 ---> 6343
3427 ---> 6344
3428 ---> 6345
3430 ---> 6346
3431 ---> 6347
3432 ---> 6348
3434 ---> 6349
3436 ---> 6350
3438 ---> 6351
3439 ---> 6352
3440 ---> 6353
3444 ---> 6354
3445 ---> 6355
3447 ---> 6356
3450 ---> 6357
3453 ---> 6358
3457 ---> 6359
3459 ---> 6360
3460 ---> 6361
3462 ---> 6362
3465 ---> 6363
3466 ---> 6364
3467 ---> 6365
3469 ---> 6366
3473 ---> 6367
3474 ---> 6368
3475 ---> 6369
3476 ---> 6370
3478 ---> 6371
3481 ---> 6372
3488 ---> 6373
3495 ---> 6374
3496 ---> 6375
3497 ---> 6376
3498 ---> 6377
3499 ---> 6378
3500 ---> 6379
3501 ---> 6380
3502 ---> 6381
3503 ---> 6382
3504 ---> 6383
3505 ---> 6384
3506 ---> 6385
3508 ---> 6386
3509 ---> 6387
3510 ---> 6388
3511 ---> 6389
3512 ---> 6390
3513 ---> 6391
3515 ---> 6392
3517 ---> 6393
3519 ---> 6394
3520 ---> 6395
3521 ---> 6396
3522 ---> 6397
3527 ---> 6398
3528 ---> 6399
3530 ---> 6400
3531 ---> 6401
3532 ---> 6402
3533 ---> 6403
3534 ---> 6404
3536 ---> 6405
3539 ---> 6406
3540 ---> 6407
3542 ---> 6408
3544 ---> 6409
3546 ---> 6410
3548 ---> 6411
3550 ---> 6412
3552 ---> 6413
3553 ---> 6414
3557 ---> 6415
3558 ---> 6416
3560 ---> 6417
3561 ---> 6418