Cant get microsoft.EntityFrameworkCore.SqlServer V8.0.0 to Load without error

Leonard Salamacha 20 Reputation points

I have open a new project wpf in Visual Studio. I wanted to use the latest services. (.net 8, EntityFramework 6, Sqlserver).

However, no matter what I tried I get an error.

Here is what I have done.

  1. Opened Visual Studio 2020.
  2. Create a new project.
  3. Template WPF Application with .net 8
  4. All OK to this point then when I get the newget package Microsoft.EntityFrameworkCore.SqlServer V8.0.0 I get the error as per the attached screenshot.Screenshot 2023-11-27 132530
  5. What am I doing wrong?
Microsoft Technologies based on the .NET software framework.
3,605 questions
Windows Presentation Foundation
Windows Presentation Foundation
A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
2,709 questions
A set of technologies in the .NET Framework for building web applications and XML web services.
4,371 questions
SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
13,289 questions
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,610 questions
0 comments No comments
{count} votes

Accepted answer
  1. Bruce ( 61,026 Reputation points

    as vs 2020 does not support .net 8 projects, most likely you created a 4.8 project, which will not support EF core. to create a dotnet 8 WPF app. install .net 8, create a folder for the project then:

    dotnet new wpf
    dotnet add package Microsoft.EntityFrameworkCore.Sq|Server
    dotnet restore

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Hui Liu-MSFT 47,331 Reputation points Microsoft Vendor

    Hi,@Leonard Salamacha. Welcome to Microsoft Q&A Forum.

    First of all, you are currently using Visual Studio 2020. You could update your Visual Studio to a version that can use .NET 8. For more you can refer to Version requirements for .NET 8 SDK .

    Visual Studio 2022 Preview with the .NET desktop development workload installed. The .NET 8 SDK is automatically installed when you select this workload.

    It is recommended that you right-click your project name and select Properties to confirm whether the Target Platform of your project is .NET 8.

    Then you could try to see if you can successfully add nuget package Microsoft.EntityFrameworkCore.SqlServer V8.0.0 .

    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.