TrackableEntities / AspNetCore.ApiControllers.Templates

Customizable Razor templates for ASP.NET Core Web API controllers
MIT License
7 stars 1 forks source link

Error while trying to install the template #3

Closed noufionline closed 6 years ago

noufionline commented 6 years ago

Hi Tony,

Good Morning!

I am getting an error while trying to install the template.

While trying from NuGet Package Manager

Severity Code Description Project File Line Suppression State Error Package 'AspNetCore.WebApi.Templates 1.0.0-beta' has a package type 'Template' that is not supported by project 'WebApplication1'. 0

While trying from CLI

PS C:\Users\Noufal\Documents\Visual Studio 2017\Projects.netcore2.0\Web> dotnet new -i 'AspNetCore.WebApi.Templates::*' Restoring packages for C:\Users\Noufal.templateengine\dotnetcli\v2.0.2\scratch\restore.csproj... C:\Users\Noufal.templateengine\dotnetcli\v2.0.2\scratch\restore.csproj : error NU1103: Unable to find a stable package AspNetCore.WebApi.Templates with version C:\Users\Noufal.templateengine\dotnetcli\v2.0.2\scratch\restore.csproj : error NU1103: - Found 1 version(s) in nuget.org [ Nearest version: 1.0.0-beta ] C:\Users\Noufal.templateengine\dotnetcli\v2.0.2\scratch\restore.csproj : error NU1103: - Found 0 version(s) in Microsoft Visual Studio Offline Packages C:\Users\Noufal.templateengine\dotnetcli\v2.0.2\scratch\restore.csproj : error NU1103: - Found 0 version(s) in C:\Program Files\dotnet\sdk\NuGetFallbackFolder C:\Users\Noufal.templateengine\dotnetcli\v2.0.2\scratch\restore.csproj : error NU1103: - Found 0 version(s) in DevExpress Nuget Server C:\Users\Noufal.templateengine\dotnetcli\v2.0.2\scratch\restore.csproj : error NU1103: - Found 0 version(s) in OdataNightly C:\Users\Noufal.templateengine\dotnetcli\v2.0.2\scratch\restore.csproj : error NU1103: - Found 0 version(s) in ABS Generating MSBuild file C:\Users\Noufal.templateengine\dotnetcli\v2.0.2\scratch\obj\restore.csproj.nuget.g.props. Generating MSBuild file C:\Users\Noufal.templateengine\dotnetcli\v2.0.2\scratch\obj\restore.csproj.nuget.g.targets. Restore failed in 1.47 sec for C:\Users\Noufal.templateengine\dotnetcli\v2.0.2\scratch\restore.csproj.

Templates Short Name Language Tags

Console Application console [C#], F#, VB Common/Console Class library classlib [C#], F#, VB Common/Library Unit Test Project mstest [C#], F#, VB Test/MSTest xUnit Test Project xunit [C#], F#, VB Test/xUnit ASP.NET Core Empty web [C#], F# Web/Empty ASP.NET Core Web App (Model-View-Controller) mvc [C#], F# Web/MVC ASP.NET Core Web App razor [C#] Web/MVC/Razor Pages ASP.NET Core with Angular angular [C#] Web/MVC/SPA ASP.NET Core with React.js react [C#] Web/MVC/SPA ASP.NET Core with React.js and Redux reactredux [C#] Web/MVC/SPA ASP.NET Core Web API webapi [C#], F# Web/WebAPI global.json file globaljson Config Nuget Config nugetconfig Config Web Config webconfig Config Solution File sln Solution Razor Page page Web/ASP.NET MVC ViewImports viewimports Web/ASP.NET MVC ViewStart viewstart Web/ASP.NET

Examples: dotnet new mvc --auth Individual dotnet new xunit dotnet new --help

tonysneed commented 6 years ago

So this is a quirk of dotnet. In order to install pre-release versions you need to specify the actual version number followed by -*. Otherwise it will only install stable versions.

dotnet new -i "AspNetCore.WebApi.Templates::1.0.0-*"

I'm updating the ReadMe to reflect this.