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

Leonard Salamacha 20 Reputation points
2023-11-27T04:59:20.13+00:00

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?
Developer technologies | Windows Presentation Foundation
Developer technologies | ASP.NET | ASP.NET Core
Developer technologies | .NET | Other
SQL Server | Other
Developer technologies | C#
0 comments No comments
{count} votes

Accepted answer
  1. Bruce (SqlWork.com) 78,236 Reputation points Volunteer Moderator
    2023-11-27T16:56:57.73+00:00

    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 48,681 Reputation points Microsoft External Staff
    2023-11-27T09:05:26.9933333+00:00

    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.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.