1

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?

10
  • 1
    do exist in our Artifactory NuGet feed (confirmed) how? The error says it found 112 versions in Artifactory with the latest being 8.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? Commented Nov 25 at 12:09
  • 1
    In any case this is specific to your company's environment. We can't guess how Artifactory is set up, whether there are separate registries per project, whether you have separate dev, staging and production registries, what's loaded into each of them. Commented Nov 25 at 12:11
  • 1
    The project’s target framework is .NET 6.0 but 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. Commented Nov 25 at 12:19
  • 1
    Perhaps Artifactory was configured to not serve versions after 2023(ish) to that specific project? 6.0.1 was the last of the 6.* versions, released in 2024. Commented Nov 25 at 12:25
  • 1
    Again, .NET 6 reached EOL a long time ago. The oldest supported version is .NET 9 and many packages have dropped support for .NET 6 already. You're probably tried to use (or upgrade) a package that requires the 9.0 versions of the Microsoft.Extensions libraries. That could be a shared company NuGet that started using the v9 libraries, without realizing Artifactory was frozen to pre-8 versions. The real solution here is to upgrade to .NET 8 at least. It's over a year since .NET 6 reached End Of Life. Version mixups like this will only get worse now that .NET 10 came out Commented Nov 25 at 13:03

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.