c# - In Linux, when I use nuget pack, it raise "Cannot create a package" -
here [full code](https://github.com/roroco/nuget-pack-raise-cannot-create-err), use following code:
//ro/dep/testnuget.cs namespace dep { public class testnuget { } }
and following dep.nuspec
<?xml version="1.0"?> <package > <metadata> <id>ro.dep</id> <version>1.0</version> <title>dep</title> <authors>roroco</authors> <owners>roroco</owners> <licenseurl>http://license_url_here_or_delete_this_line</licenseurl> <projecturl>http://project_url_here_or_delete_this_line</projecturl> <iconurl>http://icon_url_here_or_delete_this_line</iconurl> <requirelicenseacceptance>false</requirelicenseacceptance> <description>prpr</description> <releasenotes>summary of changes made in release of package.</releasenotes> <copyright>copyright 2017</copyright> <tags>tag1 tag2</tags> </metadata> </package>
when following , raise err:
roroco@roroco ~/downloads/test/cs/create-nuget-dep-and-use-it/dep $ nuget pack -verbosity detailed dep.nuspec attempting build package 'dep.nuspec'. system.invalidoperationexception: cannot create package has no dependencies nor content. @ nuget.packagebuilder.save (system.io.stream stream) [0x0005b] in <0800978c21b14124ab3d9821cb98ed45>:0 @ nuget.commands.packcommand.buildpackage (nuget.packagebuilder builder, system.string outputpath) [0x00088] in <e3902586c3ab4cf69b6ed7a8d575962f>:0 @ nuget.commands.packcommand.buildfromnuspec (system.string path) [0x00054] in <e3902586c3ab4cf69b6ed7a8d575962f>:0 @ nuget.commands.packcommand.buildpackage (system.string path) [0x00013] in <e3902586c3ab4cf69b6ed7a8d575962f>:0 @ nuget.commands.packcommand.executecommand () [0x000a5] in <e3902586c3ab4cf69b6ed7a8d575962f>:0 @ nuget.commands.command.execute () [0x000ca] in <e3902586c3ab4cf69b6ed7a8d575962f>:0 @ nuget.program.main (system.string[] args) [0x0018b] in <e3902586c3ab4cf69b6ed7a8d575962f>:0
here env:
roroco@roroco ~/downloads/test/cs/create-nuget-dep-and-use-it/dep $ lsb_release -a no lsb modules available. distributor id: linuxmint description: linux mint 18 sarah release: 18 codename: sarah nuget version: 2.12.0.0
i find solution, sudo apt install nuget -y
install nuget 2, when download latest nuget.exe(4.1.0), , run mono path/to/nuget.exe pack
, work
Comments
Post a Comment