Forum General

Support (or recommended workflow) for exporting nuget package to upload to nuget.org?

Hey, I am distributing a xamarin package on nuget.org. Currently I develop on a mac, but have to spin up a windows VM to run the nuget package command so that I can upload it to nuget.org.

Does anybody know a better way?

Tagged:

Best Answer

Answers

  • WindelWindel USMember ✭✭
    edited June 2015

    When I try to package a nuspec file in a nuspecs subfolder, I get this:

    localhost:nuspecs windel$ nuget pack MyPackage.nuspec
    Attempting to build package from 'MyPackage.nuspec'.
    Directory '/Users/windel/Projects/MyPackage/nuspecs/..\' not found.

    My nuspec contains the line:

    file src="..\bin\Release\MyPackage.dll" target ="lib\portable-net4+sl5+netcore45+wpa81+wp8+MonoAndroid1+MonoTouch1\MyPackage.dll"

  • EdwardFleming.1857EdwardFleming.1857 USMember ✭✭

    flip \ into /.

    I think that's the problem.

    I can confirm that it does work, but uses windows style directory delimiters. Also, the nuget docs mention you can just put stuff in a lib folder and it will automatically be copied in.. this does not work, you need to explicitly list everything in tags.

  • mattwardmattward GBMember Xamurai

    @Windel - Edward is correct. Change the directory separators to forward slashes in your .nuspec file and nuget pack should then work.

  • WindelWindel USMember ✭✭

    I changed \ into /

    $ cd nuspecs
    $ nuget pack MyPackage.nuspec
    Attempting to build package from 'MyPackage.nuspec'.
    Cannot create a package that has no dependencies nor content.

    My nuspec contains the line:

    file src="../bin/Release/MyPackage.dll" target ="lib/portable-net4+sl5+netcore45+wpa81+wp8+MonoAndroid1+MonoTouch1/MyPackage.dll"

    I cannot get relative paths with ".." to work. Paths without ".." work.

    NuGet Version: 2.8.1.0

  • mattwardmattward GBMember Xamurai
    edited June 2015

    I think that is a bug in NuGet on mono.

    If you add the basepath parameter to your nuget pack command line it should workaround the problem:

    nuget pack MyPackage.nuspec -BasePath ./
    

    Also this may have been fixed in a more recent version of NuGet.

Sign In or Register to comment.