Some weeks before i encountered similar problem of scaffolding error and got the solution. What am i trying is controllers>add>new scaffolded item >MVC controller with views , using entity framework
Link:-
But the thing is I'm facing that problem again.
My cproj file :
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Compile Remove="Migrations\20200625063143_user_table_added_for_access_control.cs" />
<Compile Remove="Migrations\20200625063143_user_table_added_for_access_control.Designer.cs" />
<Compile Remove="Migrations\20200625070609_test.cs" />
<Compile Remove="Migrations\20200625070609_test.Designer.cs" />
<Compile Remove="Migrations\20200701100225_datatype_changed_to_long_of_assetno_in_both_table.cs" />
<Compile Remove="Migrations\20200701100225_datatype_changed_to_long_of_assetno_in_both_table.Designer.cs" />
<Compile Remove="Migrations\20200730114532_hasShiftingRequest_field_added_in_pc.cs" />
<Compile Remove="Migrations\20200730114532_hasShiftingRequest_field_added_in_pc.Designer.cs" />
<Compile Remove="Migrations\20200731033230_hasShiftingRequest_field_added_in_pc.cs" />
<Compile Remove="Migrations\20200731033230_hasShiftingRequest_field_added_in_pc.Designer.cs" />
<Compile Remove="Migrations\20200917095552_trial.cs" />
<Compile Remove="Migrations\20200917095552_trial.Designer.cs" />
<Compile Remove="Migrations\20201208042418_test.cs" />
<Compile Remove="Migrations\20201208042418_test.Designer.cs" />
<Compile Remove="Migrations\20201208054030_User_table_mapped_with_laptop_and_desktop.cs" />
<Compile Remove="Migrations\20201208054030_User_table_mapped_with_laptop_and_desktop.Designer.cs" />
</ItemGroup>
<ItemGroup>
<Content Remove="Views\AssetDataLaptops\Delete.cshtml" />
<Content Remove="Views\AssetDataPcs\Delete.cshtml" />
<Content Remove="Views\AssetShiftings\Delete.cshtml" />
<Content Remove="Views\AssetShiftings\Details.cshtml" />
<Content Remove="Views\AssetShiftings\Edit.cshtml" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="bootstrap" Version="4.6.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="3.1.4" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="3.1.4" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="3.1.4" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="3.1.4" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="3.1.4">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration" Version="3.1.4" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="3.1.4" />
<PackageReference Include="System.DirectoryServices" Version="5.0.0" />
<PackageReference Include="System.DirectoryServices.AccountManagement" Version="5.0.0" />
<PackageReference Include="System.Management" Version="5.0.0" />
</ItemGroup>
<ItemGroup>
<Folder Include="LocationReports\" />
</ItemGroup>
</Project>
Note :-
I have tried....
-clean and rebuild
-updating all packages
-clear nuget cache
-delete .vs folder and open project and clean/rebuild
-disabling offline nuget package source
-add "https://api.nuget.org/v3/index.json" in nuget package sources
-downgraded all package to 3.1.4 and made same version