Amar Anondo
Amar Anondo

Reputation: 752

How to get rid of this problem ( On adding a nuget packages from VSCode it says terminated with exit code: 1.)?

When I trying to add Nuget Packages by Nuget gallery extension from VS Code. It doesn't install the NuGet package.

Executing task: dotnet add /home/[user]/Public/Projects/yogihosting.com/Identity/Identity/Identity.csproj package Microsoft.AspNetCore.Identity.EntityFrameworkCore -v 5.0.6 -s https://api.nuget.org/v3/index.json <

Determining projects to restore... Writing /tmp/tmpIIHQRz.tmp info : Adding PackageReference for package 'Microsoft.AspNetCore.Identity.EntityFrameworkCore' into project '/home/[user]/Public/Projects/yogihosting.com/Identity/Identity/Identity.csproj'. info : Restoring packages for /home/[user]/Public/Projects/yogihosting.com/Identity/Identity/Identity.csproj... error: Unable to load the service index for source https://api.nuget.org/v3/index.json. error: The SSL connection could not be established, see inner exception. error: The remote certificate is invalid because of errors in the certificate chain: UntrustedRoot

Usage: NuGet.CommandLine.XPlat.dll package add [options]

Options: -h|--help Show help information --force-english-output Forces the application to run using an invariant, English-based culture. --package Id of the package to be added. --version Version of the package to be added. -d|--dg-file Path to the dependency graph file to be used to restore preview and compatibility check. -p|--project Path to the project file. -f|--framework Frameworks for which the package reference should be added. -n|--no-restore Do not perform restore preview and compatibility check. The added package reference will be unconditional. -s|--source Specifies NuGet package sources to use during the restore. --package-directory Directory to restore packages in. --interactive Allow the command to block and require manual action for operations like authentication. --prerelease Allows prerelease packages to be installed. The terminal process "/bin/bash '-c', 'dotnet add /home/[user]/Public/Projects/yogihosting.com/Identity/Identity/Identity.csproj package Microsoft.AspNetCore.Identity.EntityFrameworkCore -v 5.0.6 -s https://api.nuget.org/v3/index.json'" terminated with exit code: 1.

Terminal will be reused by tasks, press any key to close it.

How can I get rid of this problem?

https://api.nuget.org/v3/index.json shows:#

enter image description here

Note: I'm using Ubuntu.

Upvotes: 2

Views: 820

Answers (1)

Amar Anondo
Amar Anondo

Reputation: 752

We may solve this issue by one of following process.

  • copy project to another folder or create new project to another destination.

It may cause, our file or folder is corrupted.

  • Reinstalling our software(s) like IDE or dotnet or both.

It may cause not to be installed correctly.

  • The final is so funny. Re-install your OS and then other softwares.

Upvotes: 1

Related Questions