We use an internal Artifactory NuGet feed inside our organization.
Here is my NuGet.Config:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="ArtifactoryNuGetV3"
value="http://ArtifactoryNuGetV3.com/api/nuget/v3/nuget"
protocolVersion="3"
allowInsecureConnections="True"
disableTLSCertificateValidation="True" />
</packageSources>
<packageRestore>
<add key="enabled" value="True" />
<add key="automatic" value="True" />
</packageRestore>
<bindingRedirects>
<add key="skip" value="False" />
</bindingRedirects>
<packageManagement>
<add key="format" value="0" />
<add key="disabled" value="False" />
</packageManagement>
</configuration>
When I run:
dotnet restore --configfile [...\NuGet.Config]
I get:
error NU1102: Unable to find package Microsoft.Extensions.Configuration.Abstractions with version (>= 9.0.0)
error NU1102: - Found 112 version(s) in ArtifactoryNuGetV3 [ Nearest version: 8.0.0-preview.6.23329.7 ]
Key points:
- All missing packages are >= 9.0.0
- My project does not reference these packages directly
- The project’s target framework is .NET 6.0
- These packages do exist in our Artifactory NuGet feed (confirmed)
Why is dotnet restore trying to resolve .NET 9 packages in a .NET 6 project, and why can’t it find them even though they exist in Artifactory? How can I fix this?
do exist in our Artifactory NuGet feed (confirmed)how? The error says it found 112 versions in Artifactory with the latest being8.0.0-preview.6.23329.7- not just old, but a preview too. Does the real URL point to the wrong Artifactory registry perhaps? Or the URL points to an older project's registry?The project’s target framework is .NET 6.0but you're trying to use v9 Microsoft.Extension packages? WHY? .NET 6 went out of support 4 years ago and the v9 libraries don't support it directly. The last version that did was 8.0. Are you trying to install newer libraries to an old project? That will lead to compatibility issues.6.*versions, released in 2024.