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): http://help.octopusdeploy.com/discussions/questions/3579-octopus-deploy-with-aspnet-vnext

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 asp.net 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 3.0.24.0.

EDIT: just found this issue on Github: https://github.com/OctopusDeploy/Issues/issues/1483
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.

Paul

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?

JP

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
    }
}

Cheers,
Shane

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.