No suitable constructor was found for entity type 'FilterDescriptor'

Joseph Cambron 0 Reputation points
2023-04-21T12:59:02.4+00:00

I have Visual Studio 2022 with a .NET 7 API project in it. I have been building out a set of models and having EntityFramwork build the database in Microsoft Sql Server. That has been going great. Today I added a .NET 7 Web App (MVC) to the solution and now Add-Migration throws this error. This doesn't make sense to me because I don't have a 'FilterDescriptor' class or FilterDescriptor method anywhere in my project. This only started after adding the MVC project. I can remove the MCV project and it works again without a problem. Does anyone have any ideas on how to fix this? No suitable constructor was found for entity type 'FilterDescriptor'. The following constructors had parameters that could not be bound to properties of the entity type: Cannot bind 'filter', 'filterScope' in 'FilterDescriptor(IFilterMetadata filter, int filterScope)' Note that only mapped properties can be bound to constructor parameters. Navigations to related entities, including references to owned types, cannot be bound. API.csproj <Project Sdk="Microsoft.NET.Sdk.Web"> <PropertyGroup> <TargetFramework>net7.0</TargetFramework> <Nullable>enable</Nullable> <ImplicitUsings>enable</ImplicitUsings> </PropertyGroup> <ItemGroup> <Compile Remove="Models\ApplicationUser.cs" /> </ItemGroup> <ItemGroup> <PackageReference Include="BCrypt.Net-Next" Version="4.0.3" /> <PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="7.0.2" /> <PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="7.0.2" /> <PackageReference Include="Microsoft.AspNetCore.Http" Version="2.2.0" /> <PackageReference Include="Microsoft.AspNetCore.Identity.UI" Version="7.0.2" /> <PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="7.0.2" /> <PackageReference Include="Microsoft.EntityFrameworkCore" Version="7.0.2" /> <PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="7.0.2"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> </PackageReference> <PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="7.0.2" /> <PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="7.0.2"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> </PackageReference> <PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="7.0.3" /> <PackageReference Include="Swashbuckle.AspNetCore" Version="6.4.0" /> <PackageReference Include="Swashbuckle.AspNetCore.Filters" Version="7.0.6" /> </ItemGroup> </Project> MVC.csproj <Project Sdk="Microsoft.NET.Sdk.Web"> <PropertyGroup> <TargetFramework>net7.0</TargetFramework> <Nullable>enable</Nullable> <ImplicitUsings>enable</ImplicitUsings> </PropertyGroup> </Project>

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
725 questions
ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,382 questions
ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
3,410 questions
ASP.NET API
ASP.NET API
ASP.NET: A set of technologies in the .NET Framework for building web applications and XML web services.API: A software intermediary that allows two applications to interact with each other.
317 questions
{count} votes