CodexBloom - Programming Q&A Platform

Visual Studio 2022 - implementing NuGet Package Version Conflicts in .NET Core Project

👀 Views: 11 đŸ’Ŧ Answers: 1 📅 Created: 2025-06-12
nuget visual-studio-2022 dotnet-core C#

This might be a silly question, but I'm sure I'm missing something obvious here, but I am working with a frustrating scenario with my .NET Core project in Visual Studio 2022..... Recently, I attempted to add a new NuGet package, but I keep getting the following behavior message: `NU1101: Unable to find package [PackageName]. No packages exist with this id in source(s): NuGet.org`. I've checked my NuGet sources and confirmed that `https://api.nuget.org/v3/index.json` is included. I've also tried clearing the NuGet cache using the command `dotnet nuget locals all --clear`. However, the behavior continues. In my `*.csproj` file, I have specified multiple package references: ```xml <ItemGroup> <PackageReference Include="Newtonsoft.Json" Version="13.0.1" /> <PackageReference Include="SomeOtherPackage" Version="2.0.0" /> </ItemGroup> ``` I suspect there may be a conflict between these packages, but I don't know how to resolve it. When I run `dotnet restore`, I occasionally see warnings related to version conflicts, like `Warning NU1603: SomePackage depends on SomeOtherPackage (>= 2.0.0) but SomeOtherPackage 1.0.0 was resolved`. I've tried manually adjusting the versions and even updating all packages using the NuGet Package Manager in Visual Studio, but still no luck. My `global.json` file specifies the SDK version as `"version": "7.0.100"`, and I'm running the project on Windows 10 with .NET Core 7.0. Also, when I try to build the project, I get warnings like `CS1701: Assuming assembly reference 'SomeAssembly' used by 'YourProject' matches identity 'SomeAssembly' of 'SomeAssembly' because it was not found`. Does anyone have insights on how to resolve these package version conflicts or the `NU1101` behavior? Any help would be greatly appreciated! Am I missing something obvious? This is part of a larger CLI tool I'm building.