CodexBloom - Programming Q&A Platform

Visual Studio 2022 - NuGet Package Restore scenarios with 'how to to find package' scenarios

👀 Views: 407 đŸ’Ŧ Answers: 1 📅 Created: 2025-06-03
visual-studio nuget aspnet-core C#

I'm relatively new to this, so bear with me. I'm currently working with an scenario with restoring NuGet packages in Visual Studio 2022 for my ASP.NET Core 6.0 project. When I attempt to build my solution, I get the following behavior message: `Unable to find package MyPackage v1.0.0. No packages exist with this id in source(s): nuget.org`. I have already verified that the package exists on nuget.org and that I can install it using the Package Manager Console with the command `Install-Package MyPackage`. I've checked the NuGet.config file and it looks fine: ```xml <?xml version="1.0" encoding="utf-8"?> <configuration> <packageSources> <clear /> <add key="nuget.org" value="https://api.nuget.org/v3/index.json" /> </packageSources> </configuration> ``` I've also tried: 1. Clearing the NuGet cache using `dotnet nuget locals all --clear`. 2. Ensuring that the solution's target framework is properly set to .NET 6.0. 3. Rebuilding the project after a full clean. 4. Checking for any network issues that might prevent access to nuget.org. Despite these attempts, I still encounter the same behavior. Is there something I'm missing regarding the configuration, or could it be an scenario specific to Visual Studio 2022? Any guidance would be greatly appreciated! My development environment is Windows.