Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does Scaffolding Identity for .NET Core 3.1 and .NET 5 in Visual Studio 2019 16.9.5 fail?

I'm trying to generate Identity Account\Login and Account\Register pages in a new project. I've tried both .NET Core 3.1 and .NET 5; in both cases, even when it's a new project, I receive the following error message:

enter image description here

An incredibly helpful error message, as you can tell. Does anybody know what can cause this with .NET Core 3.1 or .NET 5 projects and how to fix it? I've got VS2019 v16.9.5 installed, Microsoft's IdentityServer v.5.0.6, EntityFrameworkCore v.5.0.6, Identity.UI v5.0.6, and CodeGeneration.Design v.5.0.2 all installed for my .NET 5 project, and whatever the default versions of those packages for the new .NET Core 3.1 project. Both projects fail to correctly scaffold the needed files.

like image 753
KSwift87 Avatar asked May 12 '21 23:05

KSwift87


People also ask

What is scaffolding .NET core?

Scaffolding in ASP.NET Core is a technique used to generate code at design time to support a number of common application scenarios when working with Entity Framework Core. The code generation tool is available as a Nuget package.

Does Visual Studio 2019 include .NET core?

NET Core 3.1 projects. For information on what's new in Visual Studio version 16.4, see What's New in Visual Studio 2019 version 16.4. Visual Studio for Mac also supports and includes . NET Core 3.1 in Visual Studio for Mac 8.4.


1 Answers

I ran into this yesterday.

What I had to do was install version 3.1.13 of Microsoft.AspNetCore.ApiAuthorization.IdentityServer and then Microsoft.AspNetCore.Identity.UI and after that, the scaffolding worked in VS2019

All of my AspCoreNet packages were set to 3.1.15 previously.

like image 98
JamieD77 Avatar answered Sep 21 '22 08:09

JamieD77