How to get Octopack to use a custom .nuspec file?

The documentation seems really incomplete. All he says is that you can use your own .nuspec file, but it does not mention where you should put it, or how to use octopack to use it.

http://docs.octopusdeploy.com/display/OD/Using+OctoPack

I tried calling the .nuspec file the same as my solution is named and has it in the same directory. This did not work.

I tried modifying the .nuspec file that Octopack generates, but these changes are simply overwritten every time I run it.

All I try is just a shot in the dark.

Has anyone got this to work?

+8
nuspec octopus-deploy
source share
4 answers

blerg.

I am a mannequin.

The .nuspec file must be in the same directory as the .csproj file. This really makes sense as it allows you to have a different nuspec file for each project in your solution.

Hope this post helps someone else.

+4
source share

If you want to use a custom nuspec file (something other than your.project.name.nuspec , there is the msbuild OctoPackNuSpecFileName property through which you can specify your nuspec file, for example:

 msbuild yoursolution.sln /p:RunOctoPack=true p:OctoPackNuSpecFileName=Dev.nuspec 
+7
source share

Another way to use a custom or conditional .nuspec file with OctoPack is to add a PropertyGroup to your .csproj file, for example:

 <PropertyGroup> <RunOctoPack>true</RunOctoPack> </PropertyGroup> <PropertyGroup> <OctoPackNuSpecFileName Condition="'$(Configuration)' == 'Release'">MyApp.nuspec</OctoPackNuSpecFileName> <OctoPackNuSpecFileName Condition="'$(Configuration)' != 'Release'">MyApp.Debug.nuspec</OctoPackNuSpecFileName> </PropertyGroup> 

Put the files MyApp.nuspec and MyApp.Debug.nuspec in the same directory as your .csproj file, and you are good to go.

+4
source share

Please note: you do not need to have NuSpec, since OctoPack will generate "on the fly" (based on the project file) if it does not exist - this is what you experienced.

Of course, if you want to configure the NuGet package, NuSpec is required. Check out the OctoPack source here: https://github.com/OctopusDeploy/OctoPack , and you can see for yourself how OctoPack works with NuSpec.

+2
source share

All Articles