When does OctoPack create a nuspec file?

Using OctoPack mentions

Nuspec file describes the contents of your NuGet package. OctoPack automatically creates one if you didn't provide one, guessing some parameters from your project.

I ran msbuild with the flag set /p:RunOctoPack=true

and expected to see a .nuspec file in the project directory, but it is not in the project directory or in the output directory under / bin.

At what point is the .nuspec generated? Is this generated and saved, or is it on the fly if no .nuspec override exists?

+3


source to share


2 answers


It is generally best to create a NuSpec file at the root of your project where OctoPack is installed. To create a NuSpec file from the command line, just use nuget.exe:

C:\temp\nuget.exe spec c:\path-to-project\solution\project\myproj.csproj

      

This will create a myproj.csproj.nuspec file in the folder. You can edit the template however you like. Make sure to add NuSpec to Visual Studio so that when TFS (or whatever CI you use) does the build, the NuSpec is copied and when OctoPack is fired, the NuSpec already exists.



However, OctoPack will generate NuSpec on the fly if it doesn't find one. You can view the source on GitHub (line 234 defines the GetOrCreateNuSpecFile () method):

https://github.com/OctopusDeploy/OctoPack/blob/4b55bf0baa4d96cb7c2093cb234babc19a7d66f4/source/OctoPack.Tasks/CreateOctoPackPackage.cs#L234

As I said, your best bet is to create a NuSpec file in your solution / project. For projects that are not web applications in Visual Studio, there is little work to be done to optimize your packages for different projects (services, database scripts, MSI, SSRS, etc.).

+7


source


For me it was automatically generated in this directory D: \ TeamCity \ buildAgent \ works \ a2ef8561a97cb751 \ OBJ \ octopacking \ MyProject.nuspec



-1


source







All Articles