Aspnetcore: Can't add new Identity Scaffolded item to project

Created on 15 Sep 2020  ·  8Comments  ·  Source: dotnet/aspnetcore

Describe the bug

I cannot add new Identity Scaffolded item in Asp .Net 5 RC1 MVC Project

To Reproduce

1- Open visual studio preview edition last update
2- Create new Asp .Net Core (.Net 5 Rc1) MVC project
3- In solution explorer right click on the project name
4- Got to Add-> New Scaffolded Item
5- Choose Identity and click on add button
6- choose what ever you want and go through process but at the end it will show the error message

Exceptions (if any)

It can be seen in the image below

image

Further technical details

  • ASP.NET Core version (dotnet-sdk-5.0.100-rc.1.20452.10-win-x64)
  • this warning is present
    Severity Code Description Project File Line Suppression State
    Warning NU1603 Microsoft.VisualStudio.Web.CodeGeneration 5.0.0-rc.1.20453.2 depends on Microsoft.Extensions.DependencyInjection (>= 5.0.0-rc.1.20451.2) but Microsoft.Extensions.DependencyInjection 5.0.0-rc.1.20451.2 was not found. An approximate best match of Microsoft.Extensions.DependencyInjection 5.0.0-rc.1.20451.14 was resolved. net5_preview01 C:QProjects_identitynet5_preview01net5_preview01net5_preview01.csproj 1
  • The IDE (VS / VS Code/ VS4Mac) you're running on, and it's version
External area-identity

All 8 comments

Thanks for contacting us.
@HaoK can you get details about what is going wrong here or should this go to the scaffolding folks in VS?

@deepchoudhery @vijayrkn do you have any ideas what could be causing this?

@HaoK - Looks like we need to update the scaffolding dependency to the latest version. We got another report of this as well. @deepchoudhery - Can you please take care of this.

Sorry that I'm responding after 6 days, What info I can provide?
It happened in the Visual studio but it is because of the Scaffolding dependency
@mkArtakMSFT

I had this problem with preview 8 and it is still happening in RC1
I did add info to reproduce it
@HaoK

@xocodedev What VS version are you using?

Visual Studio 2019 Preview edition

It seems the issue is resolved in the last Visual Studio update.
Thank you for your accompanying me in this matter

What's the workaround for this in the Console? I'm getting:

error NU1603: Microsoft.VisualStudio.Web.CodeGeneration 5.0.0-rc.1.20453.2 depends on Microsoft.Extensions.DependencyInjection (>= 5.0.0-rc.1.20451.2) but Microsoft.Extensions.DependencyInjection 5.0.0-rc.1.20451.2 was not found. An approximate best match of Microsoft.Extensions.DependencyInjection 5.0.0-rc.1.20451.14 was resolved.

Here's my project file:

    <ItemGroup>
        <PackageReference Include="Ardalis.ListStartupServices" Version="1.1.3" />
        <PackageReference Include="Autofac" Version="5.2.0" />
        <PackageReference Include="Autofac.Extensions.DependencyInjection" Version="6.0.0" />
        <PackageReference Include="Dapper" Version="2.0.35" />
        <PackageReference Include="MediatR" Version="8.1.0" />
        <PackageReference Include="MediatR.Extensions.Microsoft.DependencyInjection" Version="8.1.0" />
        <PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="5.0.0-rc.1.*" />
        <PackageReference Include="Microsoft.Extensions.Logging.AzureAppServices" Version="5.0.0-rc.1.*" />
        <PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="5.0.0-rc.1.*" />
        <PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="5.0.0-rc.1.*" />
        <PackageReference Include="Microsoft.AspNetCore.Identity.UI" Version="5.0.0-rc.1.*" />
        <PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="5.0.0-rc.1.*" />
        <PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="5.0.0-rc.1.*" />
        <PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="5.0.0-rc.1.*" />
        <PackageReference Include="Microsoft.Web.LibraryManager.Build" Version="2.0.96" />
        <!-- Added to fix this: https://github.com/aspnet/Scaffolding/issues/834 -->
        <PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="3.7.0" />
        <PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
        <PackageReference Include="Sendgrid" Version="9.12.6" />
        <PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0-rc.1.*" />
        <PackageReference Include="Swashbuckle.AspNetCore" Version="5.0.0" />
        <PackageReference Include="Swashbuckle.AspNetCore.Swagger" Version="5.0.0" />
        <PackageReference Include="TagHelperSamples.Authorization" Version="3.0.56" />
        <PackageReference Include="Westwind.AspNetCore.Markdown" Version="3.2.4" />
        <PackageReference Include="WindowsAzure.Storage" Version="9.3.3" />

    </ItemGroup>

Thanks!

Was this page helpful?
0 / 5 - 0 ratings