DotVVM Command Line
When you create DotVVM project (ASP.NET Core) using DotVVM for Visual Studio or using dotnet new, the DotVVM Command Line tool should be already registered in the project file:
<Project ToolsVersion="15.0" Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
</PropertyGroup>
...
<ItemGroup>
<DotNetCliToolReference Include="DotVVM.CommandLine" Version="1.1.0" />
</ItemGroup>
</Project>
This will allow to run commands starting with dotnet dotvvm ...
in the project directory to perform various actions with the DotVVM project.
Creating Pages, Master Pages and Markup Controls
DotVVM Command Line can create new pages, master pages and markup controls in ASP.NET Core projects.
Task | Short Syntax | Long Syntax | Options |
---|---|---|---|
Create Page | dotnet dotvvm ap |
dotnet dotvvm add page |
|
Create Master Page | dotnet dotvvm am |
dotnet dotvvm add master |
|
Create Markup Control | dotnet dotvvm ac |
dotnet dotvvm add control |
|
Examples
- Create the
Views/Site.dotmaster
master page:
dotnet dotvvm add master Site
- Create the
Views/Page1.dothtml
page and embed it in theViews/Site.dotmaster
:
dotnet dotvvm add page Page1 -m Site
- Create the
Controls/MyControl.dotcontrol
user control with the code behind file:
dotnet dotvvm add control Controls/MyControl.dotcontrol -c
Support for REST API Bindings was added in DotVVM 2.0.