System.Data.SqlClient conflict between versions

zequion 111 Reputation points
2024-05-09T04:28:33.6166667+00:00

In a Dll project in C# .Net Framework 4.8 with the latest version of VS I have installed the Nuget package System.Data.SqlClient 4.8.6 but when checking it in the solution explorer, "References", "Properties" appears as 4.6.1.6 and that is causing a conflict between versions because I use the same Dll in .Net 8

.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,441 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Jiachen Li-MSFT 26,921 Reputation points Microsoft Vendor
    2024-05-09T07:03:05.33+00:00

    Hi @zequion ,

    Please try the following steps.

    1. Clear NuGet Cache: Sometimes, NuGet caches packages locally. Clearing the NuGet cache can help resolve any caching issues. You can do this by going to Tools > Options > NuGet Package Manager > General, and clicking on "Clear All NuGet Cache(s)".
    2. Check Project File: Open your .csproj file and check if the correct version of System.Data.SqlClient is specified there. Sometimes, the project file might have a different version specified, which could cause conflicts.
    3. Update Package Manually: If the NuGet package manager is not updating the reference correctly, you can try manually updating the package reference in your project file. You can do this by editing the .csproj file and updating the version number of System.Data.SqlClient to 4.8.6.

    Best Regards.

    Jiachen Li


    If the answer is helpful, please click "Accept Answer" and upvote it.

    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.