Создание нового Angular проекта на Mac с помощью Visual Studio

Я сейчас прохожу через https://channel9.msdn.com/Events/Visual-Studio/Visual-Studio-2017-Launch/WEB-103 по настройке приложений Spa с помощью Visual Studio на Mac (macOS Sierra, Visual Studio Community 2017).

Я успешно установил angular core и сейчас пытаюсь создать новый проект на основе одного из установленных шаблонов.

Я могу видеть два угловых шаблона, когда я бегу sudo dotnet new -l:

MVC ASP.NET Core with Angular angular [C#] Web/MVC/SPA ASP.NET Core with Angular angular [C#] Web/MVC/SPA

При беге sudo dotnet new angularЯ продолжаю получать следующую ошибку:

Unable to determine the desired template from the input template name: angular.
The following templates partially match the input. Be more specific with the template name and/or language.

Templates                          Short Name      Language      Tags       
----------------------------------------------------------------------------
MVC ASP.NET Core with Angular      angular         [C#]          Web/MVC/SPA
ASP.NET Core with Angular          angular         [C#]          Web/MVC/SPA


Examples:
    dotnet new angular
    dotnet new angular
    dotnet new --help

Есть ли что-то в команде, что я пропускаю? Что-то с Visual Studio / dotnet настроено неправильно?

2 ответа

Чтобы установить шаблоны одностраничного приложения (SPA), выполните следующую команду:

dotnet new --install Microsoft.AspNetCore.SpaTemplates::*

введите описание изображения здесь

Теперь создайте любой СПА...

dotnet new angular -o ngApp
cd .\ngApp\
npm install
dotnet restore
dotnet run

С.netcore 2.1

dotnet new angular -o my-new-app
cd my-new-app

Теперь на 2.1 package.json находится внутри клиентского приложения

    cd ClientApp
    npm install
    dotnet restore
    dotnet run
Другие вопросы по тегам