Error "Nuspec File Does Not Exist In The Package"

How to resolve when following error occurs- Nuspec file does not exist in the package?

Issue Description

The issue may arise due to NuGet cache stored on local machines. It might stem from corrupted files or packages in the local NuGet cache.

This guidance provides steps to clear all NuGet cache and other solutions if problems continue.

Error

"Nuspec file does not exist in package. at NuGet.Packaging.PackageFolderReader.GetNuspecFile() at NuGet.Packaging.PackageReaderBase.GetNuspec() at NuGet.Protocol.LocalPackageFileCache.GetNuspec(String manifestPath, String expandedPath) at NuGet"

Resolution

Step 1. Clear Local Cache

  • Open Command Prompt.
  • Execute Dotnet nuget locals all --clear command.
  • Check for issue resolution.

1.png

Note: In order to execute this command ensure .NET Core SDK is installed on your machine, and its installation path is included in the system PATH environment variable.

Step 2. Remove Cached Files
If the issue persists after executing Step 1, manual deletion of NuGet cached files is advised.

  • Execute del %LOCALAPPDATA%\NuGet\Cache\*.nupkg command in the command prompt.

2.png

Step 3. Erase Content in .nuget Folder
The problem persists even after Step 2 suggests erasing the .nuget folder's content.

  • Locate the .nuget folder, typically at c:\users\\.nuget\.
  • Remove the "package" folder with this command: del c:\users\\.nuget\packages\*.

Note: After deleting the packages folder, the first run of processes triggered from Orchestrator could be slower than usual, as all dependencies will need to be downloaded again to the .nuget folder.