Search code examples
c#command-lineasp.net-coreasp.net-core-cli

How to create new dotnetcore EMPTY web project template from a command line


At the command line I can type

dotnet new -t web

to scaffold a new asp.net core web project but it contains the 'full template' (equivalent to creating a new MVC project in Visual Studio).

In visual studio I can create a new EMPTY project too (which just returns a 'Hello World' string response).

Is there an equivalent command line option to scaffold an EMPTY project?

I have found the docs for the dotnet newcommand here but there doesn't seem to be such an option


Solution

  • Update

    Microsoft no longer support yeoman, and the provided links below will redirect permanently to:

    dotnet new


    Outdated Answer

    According to MS docs

    Building Projects with Yeoman

    you can also use the Yeoman command-line tool yo alongside a Yeoman generator.

    You are going to need to install Node.js and npm.

    From there run the ASP.NET generator for yo

    yo aspnet
    

    The generator displays a menu. Arrow down to the Empty Web Application project, tap Enter and then name your project. Yeoman will scaffold the project and its supporting files.