I'm using Visual Studio Code to build a class library with .NET 5 and Entity Framework Core.
However, I can't make reference to Entity Framework Core and I keep getting errors as if it doesn't exist.
This is the project file:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="5.0.7" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="5.0.7" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="5.0.7" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="5.0.7" />
</ItemGroup>
</Project>
All the package reference were included using dotnet add package
These are the attempts I already made:
- Restart Omni sharp
- Restore the packages (
dotnet package restore) - Use a lower version of Entity Framework Core (5.0.0)
The specific problem and error message is here and was here all the time, so no other intelligent editor may close this question again:
The result continues to be the same, I get an error message on the using telling the EntityFrameworkCore namespace doesn't exist in the Microsoft namespace. However, the IntelliSense shows EntityFrameworkCore.
What else could I try?