NuGet Error NU5018

Invalid assembly reference 'xunit.dll'. Ensure that a file named 'xunit.dll' exists in the lib directory.

Issue

The nuspec file used to create the NuGet pack operation contained references that do not exist in the .\lib folder in the project directory.

Solution

Please ensure that any referenced assemblies are placed inside .\lib folder which is in the same folder as the nuspec file used to create the package.