How to add a folder to a nuspec file

后端 未结 1 2014
温柔的废话
温柔的废话 2020-12-15 17:17

So I\'m actually trying to package up a web site project (not web application so no csproj file) into a NuGet package ready for Octopus to consume but am running into one br

1条回答
  •  轮回少年
    2020-12-15 17:43

    I don't know OctoPack, but with nuget.exe, packaging is done in two steps:

    1. Either create a .nuspec manually, or generate one from a .csproj or existing assembly (see nuget spec in the docs).
    2. Call nuget pack with the .nuspec created in the previous step as a parameter.

    Since you don't have a .csproj lying around, you're stuck creating the .nuspec manually (or with a GUI tool like NuGet Package Explorer).

    You can read all about how to create a .nuspec file in the Nuspec Reference, specifically the section about Specifying Files to Include in the Package.

    If you want to include a folder (recursively?) in the package, you need to add something like this to the XML:

    
       
    
    

    This will take all the files and (recursive) sub-folders of the bin\Release folder and put them in the content folder of the NuGet package.

    I have no idea what format OctopusDeploy expects in the packages, but that's how you include a folder in the package.

    EDIT: There seems to be some documentation on this in the OctoPack README.

    0 讨论(0)
提交回复
热议问题