title: Cannot register IRelationalTypeMappingSource
body: <p>System.InvalidOperationException: 'The database provider attempted to register an implementation of the 'IRelationalTypeMappingSource' service. This is not a service defined by Entity Framework and as such must be registered as a provider-specific service using the 'TryAddProviderSpecificServices' method.'</p>
  <p>This is the exception when I run page with DbContext in.</p>
  <p>The website is Razor Pages.</p>
  <p>Website was working well a I did not change anything a now this happened.</p>
  <p>Here is .csproj</p>
  <pre><code>&lt;Project Sdk=&quot;Microsoft.NET.Sdk.Web&quot;&gt;
  
    &lt;PropertyGroup&gt;
      &lt;TargetFramework&gt;netcoreapp3.1&lt;/TargetFramework&gt;
    &lt;/PropertyGroup&gt;
  
    &lt;ItemGroup&gt;
      &lt;PackageReference Include=&quot;Microsoft.Bcl.AsyncInterfaces&quot; Version=&quot;1.0.0&quot; /&gt;
      &lt;PackageReference Include=&quot;Microsoft.EntityFrameworkCore&quot; Version=&quot;5.0.0&quot; /&gt;
      &lt;PackageReference Include=&quot;Microsoft.EntityFrameworkCore.SqlServer&quot; Version=&quot;3.1.10&quot; /&gt;
      &lt;PackageReference Include=&quot;Microsoft.EntityFrameworkCore.Tools&quot; Version=&quot;3.1.10&quot;&gt;
        &lt;PrivateAssets&gt;all&lt;/PrivateAssets&gt;
        &lt;IncludeAssets&gt;runtime; build; native; contentfiles; analyzers; buildtransitive&lt;/IncludeAssets&gt;
      &lt;/PackageReference&gt;
      &lt;PackageReference Include=&quot;Microsoft.VisualStudio.Web.CodeGeneration.Design&quot; Version=&quot;3.1.4&quot; /&gt;
      &lt;PackageReference Include=&quot;Microsoft.Windows.Compatibility&quot; Version=&quot;5.0.0&quot; /&gt;
    &lt;/ItemGroup&gt;
  
  &lt;/Project&gt;
  </code></pre>
  <p>Does anyone know how to fix this issue?</p>