Deploying an ASP.NET 5 application fails since nuspecs aren't extracted

While deploying an ASP.NET 5 application the deployment fails to extract folders with nuspec files in them.
ASP.NET 5 has two of these (Microsoft.AspNet.Server.IIS and Microsoft.CodeAnalysis.Analyzers).
These nuspecs are needed to be able to run our app and it fails to resolve the dependencies.
First I already had the issue that they weren’t included in the package creation so I manually had to create one using a normal zip tool.
Even when it is in the zip file, it still won’t be extracted, even though the package at C:\Octopus\Packages does actually have the needed folders and files in it.
This seems to contradict the following line from the documentation:
“Before you can deploy an application using Octopus, you will need to bundle all of the executables, DLL’s, configuration files, installation scripts, and anything else the application needs to run into a package.”

Obviously it is quite an annoying step to introduce to still manually have to insert these nuspecs after every deployment.

Related issue (no response and quite old):

In case it is needed I have a working application when the package is manually extracted.

As far as I know this problem will exist for almost all 5 applications since they will all depend on these packages.

Hope anyone can help. Obviously I can introduce manual steps here, or automate something like a rename of the files but that doesn’t seem to be preferable for anyone.

I am running Octopus

EDIT: just found this issue on Github:
Somehow setting this as a variable with true as value (guess) didn’t work (SpecialVariables.Tentacle.Agent.HandleDeploymentAsZip)

Hi Jp,

Thanks for getting in touch! At the moment we’ve been using custom scripts to rename the .nuspecs prior to packaging, and to revert the names after they are unpacked. There are a few ways ASP.NET vNext applications can be deployed, and we’re currently planning the best ways to make them work with Octopus, but since vNext isn’t quite stable yet we haven’t gone too far into it.


Hi Paul,

Thanks for the insight.

Is it possible to share those script so I don’t have to reinvent the wheel, and also other people can relatively easy get started, or are we talking total custom scripts?


Hi JP,

Going from nuspec to nuspek:

Get-ChildItem -File -Recurse | % { Rename-Item -Path $_.PSPath -NewName $_.Name.replace(".nuspec",".nuspek")}

And then back again:

$files = Get-ChildItem -Recurse -Include *.nuspek
foreach ($file in $files)
    $newName = $file.Name.replace(".nuspek",".nuspec")
    If(!(Test-Path $newName))
        Rename-Item -NewName $newName -LiteralPath $file.FullName


Awesome, thanks a lot guys!

I’m looking forward to the moment where this is all nicely integrated but for now it works perfectly with these extra manual steps.