dotnet-outdated: Errors when projects target .NET 5

I’m using dotnet-outdated v2.11.0 and after updating the TFM of my projects to net5.0 and running dotnet outdated to analyze the packages to migrate, I’m getting the errors below:

Errors occurred while analyzing dependencies for some of your projects. Are you sure you can connect to all your configured NuGet servers?

Unable to find DOTNET_HOST_PATH environment variable. If you use credential providers for your NuGet sources you need to have this set to the path to the `dotnet` executable.

I have a nuget.config at the root the repo pointing to nuget.org exclusively thus I don’t think it’s the case of not being able to connect to nuget servers.

DOTNET_HOST_PATH is indeed not defined (not sure why… Probably something missing in the .NET 5 SDK install process).

My nuget.config:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <packageSources>
    <clear />
    <add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
  </packageSources>
  <disabledPackageSources>
    <clear />
  </disabledPackageSources>
  <fallbackPackageFolders>
    <clear />
  </fallbackPackageFolders>
</configuration>

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 1
  • Comments: 26 (11 by maintainers)

Most upvoted comments

Ah! Ok, the penny has dropped.

So when you run dotnet outdated --version you see 2.11...., this is the original tool that was abandoned and de-listed from nuget.org.

This repository is the official continuation of that project, however has a different nuget id.

In order to have the latest version which should not have this issue please run the following:

dotnet tool uninstall --global dotnet-outdated
dotnet tool install --global dotnet-outdated-tool

As a consumer of this tool, this sucks, please accept my appologies. If you still have this issue then please let us know.

It’s happening again with .NET 7.0 RTM. I’m using V 4.3.0.

@slang25 Ah, perfect! That explains it. Uninstalling the outdated dotnet-outdated 😄 and installing the new one resolved the issue. Thank you so much for the help troubleshooting it!

ps: As a suggestion, it would be nice if @jerriep could transfer the ownership of the old nuget package to the dotnet-outdated organization on nuget.org to allow you to do one last release of a tool that just prints the instructions above on the Console to guide devs on moving to the new one.

I’ve also just release a new version, 3.1.0, that targets .NET 5. That might also be a confounding factor. But if you have any more issues @weitzhandler please raise an issue.

I have now done som emore investigations and solved the problem, this is how.

When running dotnet list package --outdated I got the following warning The plugin credential provider could not acquire credentials. Authentication may require manual action. Consider re-running the command with --interactive for dotnet, /p:NuGetInteractive=“true” for MSBuild or removing the -NonInteractive switch for NuGet.

After running dotnet list package --outdated --interactive and logging in, dotnet-outdated started worked again.

If possible, it would be nice if dotnet-outdated could surface this information to me in some way.

@slang25 all good now on 4.3.2. thanks for the quick update!

v4.3.1 and v4.3.0 both seem to have issues with .NET 7, reverting to v4.2.0 seems to be a temporary workaround.

Thanks @augustoproiete 😃, for comparison mine is:

Registered Sources:
  1.  nuget.org [Enabled]
      https://api.nuget.org/v3/index.json
  2.  Microsoft Visual Studio Offline Packages [Enabled]
      C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\

I’ll disable the offline cache and see if I get the same 🤞

C:\augustoproiete>dotnet nuget list source
Registered Sources:
  1.  nuget.org [Enabled]
      https://api.nuget.org/v3/index.json

C:\augustoproiete>

I’m unable to replicate the issue with the csprojs or nuget.config from above. Could you try setting DOTNET_HOST_PATH (see here) and see if that works around this issue?

Ran into the same problem when migrating to .net 5

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <TargetFramework>net5.0</TargetFramework>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="EFCore.NamingConventions" Version="1.1.0" />
    <PackageReference Include="FluentValidation" Version="9.3.0" />
    <PackageReference Include="MediatR" Version="9.0.0" />
    <PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="3.1.10" />
    <PackageReference Include="Microsoft.AspNetCore.Mvc" Version="2.2.0" />
    <PackageReference Include="Microsoft.AspNetCore.Mvc.Versioning" Version="4.2.0" />
    <PackageReference Include="Microsoft.EntityFrameworkCore" Version="5.0.0" />
    <PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="5.0.0" />
    <PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="5.0.0">
      <PrivateAssets>all</PrivateAssets>
      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
    </PackageReference>
    <PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="3.1.4" />
    <PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL.Design" Version="1.1.0" />
  </ItemGroup>
</Project>

image