Error at Add-Migration CreateIdentitySchema

Dean Everhart 1,536 Reputation points
2023-02-03T16:33:09.2233333+00:00

Error:

...The type or namespace name 'Areas' does not exist in the namespace 'Authentication' (are you missing an assembly reference?)

Tutorial

https://learn.microsoft.com/en-us/aspnet/core/security/authentication/scaffold-identity?view=aspnetcore-6.0&tabs=visual-studio#scaffold-identity-into-a-razor-project-with-authorization

Directions from tutorial

Migrations

The generated Identity database code requires Entity Framework Core Migrations. Create a migration and update the database. For example, run the following commands:

Install-Package Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore 
Add-Migration CreateIdentitySchema 
Update-Database

Step

Add-Migration CreateIdentitySchema 

Subject of error on build

Authentication.Areas.Identity.Pages._ViewImports.cshtml

@using Microsoft.AspNetCore.Identity
@using Authentication.
@using Authentication.
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
 

Error on build

Build started...

1>------ Build started: Project: Authentication, Configuration: Debug Any CPU ------

1>C:\Users\User1\Desktop\Tech\Authentication\Authentication\Authentication - Copy\Authentication\Areas\Identity\Pages_ViewImports.cshtml(2,22,2,27): error CS0234: The type or namespace name 'Areas' does not exist in the namespace 'Authentication' (are you missing an assembly reference?)

1>C:\Users\User1\Desktop\Tech\Authentication\Authentication\Authentication - Copy\Authentication\Areas\Identity\Pages_ViewImports.cshtml(3,22,3,27): error CS0234: The type or namespace name 'Areas' does not exist in the namespace 'Authentication' (are you missing an assembly reference?)

1>C:\Users\User1\Desktop\Tech\Authentication\Authentication\Authentication - Copy\Authentication\Areas\Identity\Pages\Account_ViewImports.cshtml(1,22,1,27): error CS0234: The type or namespace name 'Areas' does not exist in the namespace 'Authentication' (are you missing an assembly reference?)

1>C:\Users\User1\Desktop\Tech\Authentication\Authentication\Authentication - Copy\Authentication\Areas\Identity\Pages\Account\Manage_ViewImports.cshtml(1,22,1,27): error CS0234: The type or namespace name 'Areas' does not exist in the namespace 'Authentication' (are you missing an assembly reference?)

1>C:\Users\User1\Desktop\Tech\Authentication\Authentication\Authentication - Copy\Authentication\Areas\Identity\Pages_ViewImports.cshtml(2,22,2,27): error CS0234: The type or namespace name 'Areas' does not exist in the namespace 'Authentication' (are you missing an assembly reference?)

1>C:\Users\User1\Desktop\Tech\Authentication\Authentication\Authentication - Copy\Authentication\Areas\Identity\Pages_ViewImports.cshtml(3,22,3,27): error CS0234: The type or namespace name 'Areas' does not exist in the namespace 'Authentication' (are you missing an assembly reference?)

1>C:\Users\User1\Desktop\Tech\Authentication\Authentication\Authentication - Copy\Authentication\Areas\Identity\Pages\Account_ViewImports.cshtml(1,22,1,27): error CS0234: The type or namespace name 'Areas' does not exist in the namespace 'Authentication' (are you missing an assembly reference?)

1>C:\Users\User1\Desktop\Tech\Authentication\Authentication\Authentication - Copy\Authentication\Areas\Identity\Pages\Account\Manage_ViewImports.cshtml(1,22,1,27): error CS0234: The type or namespace name 'Areas' does not exist in the namespace 'Authentication' (are you missing an assembly reference?)

1>C:\Users\User1\Desktop\Tech\Authentication\Authentication\Authentication - Copy\Authentication\Areas\Identity\Pages_ViewImports.cshtml(2,22,2,27): error CS0234: The type or namespace name 'Areas' does not exist in the namespace 'Authentication' (are you missing an assembly reference?)

1>C:\Users\User1\Desktop\Tech\Authentication\Authentication\Authentication - Copy\Authentication\Areas\Identity\Pages_ViewImports.cshtml(3,22,3,27): error CS0234: The type or namespace name 'Areas' does not exist in the namespace 'Authentication' (are you missing an assembly reference?)

1>C:\Users\User1\Desktop\Tech\Authentication\Authentication\Authentication - Copy\Authentication\Areas\Identity\Pages\Account_ViewImports.cshtml(1,22,1,27): error CS0234: The type or namespace name 'Areas' does not exist in the namespace 'Authentication' (are you missing an assembly reference?)

1>C:\Users\User1\Desktop\Tech\Authentication\Authentication\Authentication - Copy\Authentication\Areas\Identity\Pages_ViewImports.cshtml(2,22,2,27): error CS0234: The type or namespace name 'Areas' does not exist in the namespace 'Authentication' (are you missing an assembly reference?)

1>C:\Users\User1\Desktop\Tech\Authentication\Authentication\Authentication - Copy\Authentication\Areas\Identity\Pages_ViewImports.cshtml(3,22,3,27): error CS0234: The type or namespace name 'Areas' does not exist in the namespace 'Authentication' (are you missing an assembly reference?)

1>C:\Users\User1\Desktop\Tech\Authentication\Authentication\Authentication - Copy\Authentication\Areas\Identity\Pages_ViewImports.cshtml(2,22,2,27): error CS0234: The type or namespace name 'Areas' does not exist in the namespace 'Authentication' (are you missing an assembly reference?)

1>C:\Users\User1\Desktop\Tech\Authentication\Authentication\Authentication - Copy\Authentication\Areas\Identity\Pages_ViewImports.cshtml(3,22,3,27): error CS0234: The type or namespace name 'Areas' does not exist in the namespace 'Authentication' (are you missing an assembly reference?)

1>C:\Users\User1\Desktop\Tech\Authentication\Authentication\Authentication - Copy\Authentication\Areas\Identity\Pages_ViewImports.cshtml(2,22,2,27): error CS0234: The type or namespace name 'Areas' does not exist in the namespace 'Authentication' (are you missing an assembly reference?)

1>C:\Users\User1\Desktop\Tech\Authentication\Authentication\Authentication - Copy\Authentication\Areas\Identity\Pages_ViewImports.cshtml(3,22,3,27): error CS0234: The type or namespace name 'Areas' does not exist in the namespace 'Authentication' (are you missing an assembly reference?)

1>Done building project "Authentication.csproj" -- FAILED.

========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

========== Elapsed 00:00.696 ==========

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,400 questions
ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
3,417 questions
{count} votes