Edit

Share via


NuGet Error NU5037

The package is missing the required nuspec file.

Issue

Restore fails when the nuspec file is missing from the package on the feed, or from the global packages folder of the package.

Scenario 1

nuspec file is missing from the package (nupkg) file.

Solution

Contact the package author.

Scenario 2

Restore fails for a project managed with the PackageReference format. For example:

The package is missing the required nuspec file. Path: C:...nuget\packages\x\1.0.0.'x' represents package name and '1.0.0' represents package version.

Solution

Delete the package folder specified in the error message and run the restore again. For example:

Consider sample error message specified in the above section.
Delete the package folder '1.0.0' from 'C:\.\.\.nuget\packages\x' directory and run the restore again.

Scenario 3

Restore fails for a project managed with the packages.config format.

Solution

Identifying the package with missing nuspec file requires manual probing of dependencies. Delete corrupted package folder or entire solution packages folder if the package with missing nuspec file is unknown and run the restore again.