dotnet / Scaffolding

Code generators to speed up development.
MIT License
620 stars 218 forks source link

aspnet-codegenerator not listing code generators #1418

Open JoeSherwood335 opened 3 years ago

JoeSherwood335 commented 3 years ago

Note: If filing an issue related to using Scaffolding within Microsoft Visual Studio, please file an issue on the Microsoft Developer Community instead of here. This can be accomplished from Visual Studio by clicking on Help > Send Feedback, and choosing the appropriate action.

Steps to reproduce:

dotnet new mvc --auth Individual dotnet tool install --global dotnet-aspnet-codegenerator --version 3.1.4 dotnet add package Microsoft.VisualStudio.Web.CodeGeneration.Design dotnet restore

dotnet aspnet-codegenerator

Expected behavior:

Usage: aspnet-codegenerator [arguments] [options]

Arguments:
  generator  Name of the generator. Check available generators below.

Options:
  -p|--project             Path to .csproj file in the project.
  -n|--nuget-package-dir   
  -c|--configuration       Configuration for the project (Possible values: Debug/ Release)
  -tfm|--target-framework  Target Framework to use. (Short folder name of the tfm. eg. net46)
  -b|--build-base-path     
  --no-build               

%list of code generators including controller,area, identity%

Actual behavior:

Usage: aspnet-codegenerator [arguments] [options]

Arguments:
  generator  Name of the generator. Check available generators below.

Options:
  -p|--project             Path to .csproj file in the project.
  -n|--nuget-package-dir   
  -c|--configuration       Configuration for the project (Possible values: Debug/ Release)
  -tfm|--target-framework  Target Framework to use. (Short folder name of the tfm. eg. net46)
  -b|--build-base-path     
  --no-build               

No code generators are available in this project.Add Microsoft.VisualStudio.Web.CodeGeneration.Design package to the project as a NuGet package reference.

Additional information about the project being scaffolded, such as:

dotnet --info

.NET Core SDK (reflecting any global.json):
 Version:   3.1.401
 Commit:    39d17847db

Runtime Environment:
 OS Name:     linuxmint
 OS Version:  19.3
 OS Platform: Linux
 RID:         linux-x64
 Base Path:   /usr/share/dotnet/sdk/3.1.401/

Host (useful for support):
  Version: 3.1.7
  Commit:  fcfdef8d6b

.NET Core SDKs installed:
  3.1.401 [/usr/share/dotnet/sdk]

.NET Core runtimes installed:
  Microsoft.AspNetCore.App 3.1.7 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 3.1.7 [/usr/share/dotnet/shared/Microsoft.NETCore.App]

To install additional .NET Core runtimes or SDKs:
  https://aka.ms/dotnet-download

dotnet tool list -g

Package Id                       Version      Commands                   
-------------------------------------------------------------------------
dotnet-aspnet-codegenerator      3.1.4        dotnet-aspnet-codegenerator
dotnet-ef                        3.1.5        dotnet-ef                  
dotnet-user-secrets              2.2.0        dotnet-user-secrets  

cat webistar.csprog

<Project Sdk="Microsoft.NET.Sdk.Web">

  <PropertyGroup>
    <TargetFramework>netcoreapp3.1</TargetFramework>
    <UserSecretsId>1234retfsdbdffsdfsfsdfsfsfB</UserSecretsId>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="3.1.2" />
    <PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="3.1.2" />
    <PackageReference Include="Microsoft.AspNetCore.Identity.UI" Version="3.1.2" />
    <PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="3.1.2" />
    <PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="3.1.3" />
    <PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="3.1.2" />
    <PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="3.1.4" />
    <PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="3.1.2" />
  </ItemGroup>

</Project>
cezarlamann commented 3 years ago

Maybe #1393 ?

JoeSherwood335 commented 3 years ago

per #1393, i am using this work around

papyr commented 3 years ago

I have reported issues in the past especially concerning the UI side of the scaffolder, there is no way to track it and get others peoples feedback.

IMHO This place is a much better options - they should pull from here.

munkito commented 3 years ago

Same problem:

Ubuntu 20.04

dotnet --info

lSDK de .NET Core (reflejando cualquier global.json): Version: 3.1.403 Commit: 9e895200cd

Entorno de tiempo de ejecución: OS Name: ubuntu OS Version: 20.04 OS Platform: Linux RID: ubuntu.20.04-x64 Base Path: /usr/share/dotnet/sdk/3.1.403/

Host (useful for support): Version: 3.1.9 Commit: 774fc3d6a9

.NET Core SDKs installed: 3.1.403 [/usr/share/dotnet/sdk]

.NET Core runtimes installed: Microsoft.AspNetCore.App 3.1.9 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.NETCore.App 3.1.9 [/usr/share/dotnet/shared/Microsoft.NETCore.App]

To install additional .NET Core runtimes or SDKs: https://aka.ms/dotnet-download

dotnet aspnet-codegenerator --help

Usage: aspnet-codegenerator [arguments] [options]

Arguments: generator Name of the generator. Check available generators below.

Options: -p|--project Path to .csproj file in the project. -n|--nuget-package-dir
-c|--configuration Configuration for the project (Possible values: Debug/ Release) -tfm|--target-framework Target Framework to use. (Short folder name of the tfm. eg. net46) -b|--build-base-path
--no-build

No code generators are available in this project.Add Microsoft.VisualStudio.Web.CodeGeneration.Design package to the project as a NuGet package reference.

RunTime 00:00:01.34

project.csproj `

netcoreapp3.1 runtime; build; native; contentfiles; analyzers; buildtransitive all

`

jahnog commented 3 years ago

Seems to be the same generator problem described in 1384 and 1385. There is a temporary solution (downgrading net core sdk) until this is issue is really fixed.