Search code examples
.net-corenugetnuget-package

SqlServerValueGenerationStrategy does not exist


When i try to run the project it gives the following error due to lack of package

The name 'SqlServerValueGenerationStrategy' does not exist in the current context   

I tried installing Microsoft.EntityFrameworkCore.SqlServer but visual studio acts like it wasnt installed.

Its look like installed and defined at my .csproj file.

<Project Sdk="Microsoft.NET.Sdk.Web">
    <PropertyGroup>
    <TargetFramework>netcoreapp3.1</TargetFramework>
    <CopyRefAssembliesToPublishDirectory>false</CopyRefAssembliesToPublishDirectory>
    </PropertyGroup>
    <ItemGroup>
      <PackageReference Include="MailKit" Version="2.11.1" />
      <PackageReference Include="Microsoft.AspNetCore.Identity" Version="2.2.0" />
      <PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="3.1.5" />
      <PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="3.1.15" />
      <PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="3.1.15" />
      <PackageReference Include="NLog.Extensions.Logging" Version="1.6.0" />
      <PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="3.1.4" />
      <PackageReference Include="Microsoft.Bcl.HashCode" Version="1.1.1" />
      <PackageReference Include="Microsoft.EntityFrameworkCore" Version="3.1.15" />
      <PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="3.1.15">
          <PrivateAssets>all</PrivateAssets>
          <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
      </PackageReference>
      <PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="3.1.15">
          <PrivateAssets>all</PrivateAssets>
          <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
      </PackageReference>
      <PackageReference Include="Microsoft.Extensions.Identity.Core" Version="3.1.15" />
      <PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration" Version="3.1.5" />
      <PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="3.1.5" />
      <PackageReference Include="Microsoft.VisualStudio.Web.CodeGenerators.Mvc" Version="3.1.5" />
      <PackageReference Include="NLog" Version="4.6.7" />
      <PackageReference Include="NLog.Web.AspNetCore" Version="4.14.0" />
      <PackageReference Include="Novell.Directory.Ldap.NETStandard" Version="3.6.0" />
    </ItemGroup>
    <ItemGroup>
        <Content Update="nlog.config" CopyToOutputDirectory="PreserveNewest" />
    </ItemGroup>
</Project>

Do you have any ideas to help?

Error image

Thanks for your help, I can't move forward.


Solution

  • Deleting and re-installing all of the packages just solved my problem.