Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to scaffold AspNetCore Identity for .Net Core 3.0 #1214

Closed
bchewy opened this issue Dec 31, 2019 · 5 comments
Closed

Unable to scaffold AspNetCore Identity for .Net Core 3.0 #1214

bchewy opened this issue Dec 31, 2019 · 5 comments

Comments

@bchewy
Copy link

bchewy commented Dec 31, 2019

Describe the bug

I was unable to scaffold the AspNetCore Identity with aspnet-codegenerator. I followed this guide thoroughly and even made a new MVC project with the dotnet new mvc -au Individiual command - to no avail.

I also tried to update the aspnet-codegenerator, but nothing worked.

To Reproduce

  1. Generate a new MVC application with dotnet new mvc -au Individual
  2. Install the aspnet codegenerator with dotnet tool install -g dotnet-aspnet-codegenerator
  3. Add the references, and packages which is the second step here
dotnet add package Microsoft.VisualStudio.Web.CodeGeneration.Design
dotnet add package Microsoft.EntityFrameworkCore.Design
dotnet add package Microsoft.AspNetCore.Identity.EntityFrameworkCore
dotnet add package Microsoft.AspNetCore.Identity.UI
dotnet add package Microsoft.EntityFrameworkCore.SqlServer
dotnet add package Microsoft.EntityFrameworkCore.Tools

Step 3 gave us this output:

obj/Debug/netcoreapp3.0/box.AssemblyInfo.cs(10,42): error CS0234: The type or namespace name 'UI' does not exist in the namespace 'Microsoft.AspNetCore.Identity' (are you missing an assembly reference?) [/Users/brianchew/Desktop/Project/box.csproj]
Startup.cs(7,37): error CS0234: The type or namespace name 'UI' does not exist in the namespace 'Microsoft.AspNetCore.Identity' (are you missing an assembly reference?) [/Users/brianchew/Desktop/Project/box.csproj]

The build failed. Fix the build errors and run again.
watch : Exited with error code 1
  1. Run the aspnet-codegenerator identity -h

Output of aspnet-codegenerator identity -h

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               

Selected Code Generator: identity
No code generator found with the name 'identity'.

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

RunTime 00:00:01.12

Further technical details

project.csproj file

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

  <PropertyGroup>
    <TargetFramework>netcoreapp3.0</TargetFramework>
    <UserSecretsId>**************************************</UserSecretsId>
  </PropertyGroup>


  <ItemGroup>
    <None Update="app.db" CopyToOutputDirectory="PreserveNewest" />
  </ItemGroup>

  <ItemGroup>
    <PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="3.0.0" />
    <PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="3.1.0" />
    <PackageReference Include="Microsoft.AspNetCore.Identity.UI" Version="3.1.0" />
    <PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="3.1.0">
      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
      <PrivateAssets>all</PrivateAssets>
    </PackageReference>
    <PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="3.0.1" />
    <PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="3.1.0" />
    <PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="3.1.0">
      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
      <PrivateAssets>all</PrivateAssets>
    </PackageReference>
    <PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="3.1.0" />
  </ItemGroup>

</Project>

dotnet --info output

.NET Core SDK (reflecting any global.json):
 Version:   3.0.101
 Commit:    bc5f8df0f5

Runtime Environment:
 OS Name:     Mac OS X
 OS Version:  10.15
 OS Platform: Darwin
 RID:         osx.10.15-x64
 Base Path:   /usr/local/share/dotnet/sdk/3.0.101/

Host (useful for support):
  Version: 3.0.1
  Commit:  32085cbc72

.NET Core SDKs installed:
  2.1.802 [/usr/local/share/dotnet/sdk]
  3.0.100 [/usr/local/share/dotnet/sdk]
  3.0.101 [/usr/local/share/dotnet/sdk]

.NET Core runtimes installed:
  Microsoft.AspNetCore.All 2.1.13 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.App 2.1.13 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 3.0.0 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 3.0.1 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 2.1.13 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.1.14 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 3.0.0 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 3.0.1 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]

To install additional .NET Core runtimes

Any help is greatly appreciated. The only other workaround I found was to use a windows machine, and manually scapfold this with Visual Studio Community 2019.

@bchewy bchewy changed the title Unable to scapfold Unable to scaffold AspNetCore Identity for .Net Core 3.0 Dec 31, 2019
@blowdart blowdart transferred this issue from dotnet/aspnetcore Jan 1, 2020
@deepchoudhery
Copy link
Contributor

Hi,
We do not support using the CodeGeneration.Design package v 3.1.0 in a netcoreapp3.0 project. I would recommend either using a netcoreapp3.1 project or downgrading your packages to 3.0.0. Unfortunately, "dotnet add PACKAGE" does not care about project tfm and will install the latest stable package(3.1.0 currently).

@bchewy
Copy link
Author

bchewy commented Jan 3, 2020

Thanks @deepchoudhery. I was trying to figure this out for several days. It would be helpful if this was included in the scaffolding documentation.

@bchewy bchewy closed this as completed Jan 3, 2020
@deepchoudhery
Copy link
Contributor

Yes, we have a documentation update coming soon.

Thanks.

@hodzanassredin
Copy link

I have "No code generators found with the name 'identity'" using .net core 3.1 and Microsoft.VisualStudio.Web.CodeGeneration.Design 3.1.3(all other packages are 3.1.5).
Is there any way to edit Identity pages manually? Like download pages and put them into a project folder?

@deepchoudhery
Copy link
Contributor

@hodzanassredin Would you mind opening a separate issue and we can discuss options there.
Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants