Skip to content

dotnet-scaffold command #4588

@prafullbhosale

Description

@prafullbhosale

dotnet-scaffold

NAME

dotnet-scaffold -- Code Generation tools for .Net framework

SYNOPSIS

dotnet-scaffold [options] [generator specific options]

DESCRIPTION

The dotnet-scaffold command is used to scaffold code for your application. Scaffolded code is generated by code generators. The code generators are specified as dependencies in the application's project.json. Every code generator is identified by a 'generator-name'. Only one 'generator' can be invoked by a command. (i.e. cannot chain multiple code generators in a single command)
The generator can be installed as a nuget package using the 'dependencies' specified. If the specified dependencies could not be installed, the command will exit with an error.
If no 'generator' is found the command will exit with an error.
If more than one 'generator' is found with the same name, the command will exit with an error.

Options
-p, --project [path] Path to project.json

-r, --relativeOutputPath [path] **
Path relative to the project.json where the scaffolded code should be created

-d, --dependencies [dep1:ver1 dep2:ver2 …]
A delimited list of nuget packages that are needed for the generator.

-n, --name [Name] **
Name of the primary class/ file being generated.

-f, --force **
Flag to indicate whether to overwrite existing files.

[generator specific options] **
Options and flags that can be used by individual generators.

** These options will be passed to the specific generator being invoked and the behavior will be controlled by the specific generator.

EXAMPLES

dotnet scaffold controller --project .\project.json --relativeOutputPath .\Controllers --name EmptyController --noViews

dotnet scaffold view --project .\project.json --relativeOutputPath .\Views --name EmptyView

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions