OctoPack error about replacement token

Hi David

I think a screenshare might be our best option at this point. I’m stumped.

I’ll send you email.

Damian

Has there been an update on this? Toggling “RunOctoPack” seems to work and the package is placed in the location specified in “OctoPackPublishPackageToFileShare”, once I introduce replacement tokens the MSBuild fails with the error:

“OctoPack error OCTONUGET: The replacement token ‘mytitle’ has no value.”

Here is a copy of the target step I am using:

Here is the sample nuspec file I am working with:

<?xml version="1.0"?> Test.Web $mytitle$ $myversion$ $myname$ Your name http://yourcompany.com http://yourcompany.com false A sample project This release contains the following changes...

Thank you

Hi Gordon

OctoPack will generate a nuspec file if there isn’t one there, but if you put in a file, we won’t touch it. So we won’t replace tokens, which means that nuspec isn’t valid.

Try just removing the nuspec and let OctoPack do the work (based on convention) and you should be good.

Damian

Hi Damian,

Thank you, that was my issue!

Gordon

Hi,

I have the same issue, but i need to create a nuspec file as the nuget isn’t including a build generated file project.wsp.

Are you saying that in this case i can’t use tokens?

Michael

Hi Michael

Yes that’s correct. If you have a Nuspec file we won’t generate one, so you need to have a valid Nuspec file.

Damian

Ok. Thanks.

Is there any way to include an additional file type in the files without creating a nuspec file?

No sorry Michael.

The idea of Octopack is to make nuspec files really easy for the 99% of people based on project convention. Creating a nuspec file isn’t hard but OctoPack removes some friction for most people with simple cases.

If you do something extra then you’ll need to create one. Sorry to be the bearer of bad news…

Damian

Unfortunately SharePoint falls in to the 1% and the only build output is a single .WSP file. I tried a custom nuspec file but got the exception:

“Cannot create a package that has no dependencies nor content.

There was an error calling NuGet. Please see the output above for more details. Command line: ‘C:\a\bcc65440\CLIENT\Dev\Company.CLIENT.PROJECT\packages\OctoPack.3.0.42\tools\NuGet.exe’ pack “C:\a\bcc65440\CLIENT\Dev\Company.CLIENT.PROJECT\Company.CLIENT.PROJECT\Company.CLIENT.PROJECT\obj\octopacking\Company.CLIENT.PROJECT.nuspec” -NoPackageAnalysis -BasePath “C:\a\bcc65440\CLIENT\Dev\Company.CLIENT.PROJECT\Company.CLIENT.PROJECT\Company.CLIENT.PROJECT” -OutputDirectory “C:\a\bcc65440\CLIENT\Dev\Company.CLIENT.PROJECT\Company.CLIENT.PROJECT\Company.CLIENT.PROJECT\obj\octopacked” -Version 1.0.0.0

System.Exception: There was an error calling NuGet. Please see the output above for more details. Command line: ‘C:\a\bcc65440\CLIENT\Dev\Company.CLIENT.PROJECT\packages\OctoPack.3.0.42\tools\NuGet.exe’ pack “C:\a\bcc65440\CLIENT\Dev\Company.CLIENT.PROJECT\Company.CLIENT.PROJECT\Company.CLIENT.PROJECT\obj\octopacking\Company.CLIENT.PROJECT.nuspec” -NoPackageAnalysis -BasePath “C:\a\bcc65440\CLIENT\Dev\Company.CLIENT.PROJECT\Company.CLIENT.PROJECT\Company.CLIENT.PROJECT” -OutputDirectory “C:\a\bcc65440\CLIENT\Dev\Company.CLIENT.PROJECT\Company.CLIENT.PROJECT\Company.CLIENT.PROJECT\obj\octopacked” -Version 1.0.0.0
at OctoPack.Tasks.CreateOctoPackPackage.RunNuGet(String specFilePath, String octopacking, String octopacked, String projectDirectory) in y:\work\46cfb6001f03d701\source\OctoPack.Tasks\CreateOctoPackPackage.cs:line 551
at OctoPack.Tasks.CreateOctoPackPackage.Execute() in y:\work\46cfb6001f03d701\source\OctoPack.Tasks\CreateOctoPackPackage.cs:line 196

Michael

Hi Michael

Looks like you nuspec file isn’t quite right, if you post it here we can help.

Damian

File attached. Names have been replaced, but do match the csproj name

BrightStarr.AAM.MLD.nuspec (661 Bytes)

Hi Michael

Sorry for the delay. I had a look at that, I think your problem is that the line for the wsp doesn’t specify the path. You have which would look in the base path. I’m assuming that file gets place in a bin or some other output path ?

You could go to it directly or put a directory wildcard in . Play around with those options and see how you go.

Regards

Damian

I’m having the same issue where the generated nuspec has an $id$ value in it that apparently is not being replaced. I am passing a suffix for the id via the MSBuild command line arguments, but still having an issue. Thoughts?

Hi Norman,

OctoPack does not replace any values in an existing .nuspec file, when OctoPack generates it’s .nuspec file it populates with the following details https://github.com/OctopusDeploy/OctoPack/blob/master/source/OctoPack.Tasks/CreateOctoPackPackage.cs#L265-L273.

Do you have a .nuspec file already in your project that your are running OctoPack on?

Thank you,
Henrik

I am also running into this issue. I have a custom nuspec file that utilizes replacement tokens. The following article makes it seem like these tokens can be assigned values by using /p:OctoPackNuGetProperties from the msbuild command line. Is this correct? http://docs.octopusdeploy.com/display/OD/Using+OctoPack

Hi Eric,

Yes this is correct.

Thanks,
Henrik