1

Last week I followed this AWS tutorial to set up my dotnet CLI to use AWS Code Artifact with the Credential Provider. This can be done with 3 commands:

  1. dotnet tool install -g AWS.CodeArtifact.NuGet.CredentialProvider
  2. dotnet codeartifact-creds install
  3. dotnet codeartifact-creds configure set profile profile_name

This all worked as expected and I was able to publish packages to AWS CodeArtifact from the dotnet CLI.

However today when I try to use the codeartifact-creds command I get an error suggesting that dotnet doesnt know about the command:

Could not execute because the specified command or file was not found.
Possible reasons for this include:
  * You misspelled a built-in dotnet command.
  * You intended to execute a .NET program, but dotnet-codeartifact-creds does not exist.
  * You intended to run a global tool, but a dotnet-prefixed executable with this name could not be found on the PATH.

Any help on fixing this and being able to use the tool would be appriciated.


What I've tried:

  • Restarting my machine
  • Remove tool via CLI dotnet tool uninstall AWS.CodeArtifact.NuGet.CredentialProvider, then reinstall using the 3 command above
  • Remove tool manually by deleting from %home%/.dotnet/tools then reinstalling

Worth mentioning:

  • I'm running Debian in a WSL2 environment on Windows 10
  • The only thing that changed since this last worked (AFAIK) was that I restarted my machine, nothing else.
  • I have both dotnet core 3.1 and 5 SDKs installed
devklick
  • 2,000
  • 3
  • 30
  • 47

1 Answers1

3

The problem was that the path to the dotnet tools folder was no longer included in my $PATH variable after a reboot.

Updating the $PATH variable to include the dotnet tools folder (%home%/.dotnet/tools) fixes the issue.

devklick
  • 2,000
  • 3
  • 30
  • 47