Unable to create Area in ASP.NET Core 6 MVC framework

I am working with a project where I am using ASP.NET Core 6 MVC. I am trying to add new scaffolded item which is an MVC Area. But I keep getting an error.

  • Here is link to GitHub for this project: click

Here are 2 relevant screenshots:

enter image description here

enter image description here

How can I solve this problem?

Note: this may be an important factor for this problem:

Error NU1202 Package System.Threading 4.3.0 is not compatible with net6.0 (.NETCoreApp,Version=v6.0). Package System.Threading 4.3.0 supports: monoandroid10 (MonoAndroid,Version=v1.0)

Solution 1:

After downloaded your project. I add this line

.AddRazorRuntimeCompilation();

in Program.cs file. And I also install the Packages like yours , and It works fine.

My test steps

  1. Delete .vs, bin, obj folder.

  2. Open the project

  3. Install the packages

    enter image description here

  4. Run the app, and works fine

Suggestion

  1. Delete the 3 folder mentioned above.

  2. Upgrade your vs2022 to the lastest version