I have a simple compiled library (compiled with very different TFs) that I want to provide for consumers via nugets.For this purpose I want to use nuget spec -a {libraryPath}
command to create nuspec (and then nuget pack
to create an actual nuget).
Apperently nuget spec
command (version without arguments and with -a
) doesn't generate a valid/filled nuspec file and instead always creates just an empty template.
So I have 2 questions:
What's the difference between
nuget spec
andnuget spec -a {libraryPath}
? As I understand in both of cases, the only generated output is empty nuspec file?Sometimes
nuget spec -a {libraryPath}
works well, but in some cases it throws error like:c:\test>nuget spec -a ConsoleApp1.dllCould not load file or assembly 'file:///c:\test\ConsoleApp1.dll' or one of its dependencies. The system cannot find the file specified.
where ConsoleApp1.dll
is output from consoleapp project with <TargetFramework>net6.0</TargetFramework>
:
or:
c:\test>nuget spec -a SuperTest1.dll Could not load file or assembly 'System.Runtime, Version=5.0.0.0, Culture=neutral, PublicKeyToken=..' or one of its dependencies. The system cannot find the file specified.
where SuperTest.dll
is output from classlibrary project (empty) with <TargetFramework>netcoreapp3.1</TargetFramework>
How to fix such errors?