Create octopack fails due too long path

Hello,

We´re creating an Octopack of .Net framework web app, with msbuild and octopack, but it’s failing due to “too long path error”. The error it’s thrown when msbuild starts to create the octopac, the error came from the nuget.exe inside the octopack nuget package, we’re using last octopack nuget version.

It seems from the version 4.8 nuget.exe supports long paths NuGet CLI Long Path Support | Microsoft Docs, but the octopack nuget have the nuget.exe version 3.5 inside

Due to external reason we can’t shorter the long paths. How can we pack our .net framework web app with long folders name?

Thanks

HI @cpmarc,

Thank you for contacting Octopus Support.

One alternative would be to move to the pack function of the Octopus CLI instead. You may view our documentation and implementation guide on this here.

Let me know if this solution is acceptable for your use case at your earliest convenience.

Best Regards,
Donny

Hello @donny.bell ,

Thanks for your response, we’ve check it. But we also include in the octopack other files a part from the binaries of the web app taking advantage of the nuspec “<file src=” mechanism .

How can we include files that are not binaries one?

With a script copying the files to the publish build folder? Is there something similar of the nuspec mechanism but for the Octopus cli to avoid having to copy the files with scripts?

Thanks!

Hi @cpmarc,

Thank you for getting back to me.

Here we have a list of commands available for this function. You may specify additional files via the --include=VALUE switch.

Let me know if you have any additional questions.

Best Regards,
Donny

Hi @donny.bell ,

It looks promisings, just a final question. I’ve done some runs with the --include parameter but if say "–include .\views* it’s copying the content of the folder to the root of nuget package. What I would like it’s in the nuget has the folder views with its content. Do you know how can I do it?

It would be the equivalent of the target in the nuspec file when creating a octopack from the msbuild

<file src=".\Views\**\*.*" target="Views" />

Thanks!

Hi @cpmarc,

Thank you for getting back to me. I apologize for the delay in getting you a response on this.

I did test this and was able to pull the target folder in like you are asking in my test environment. Here is what I did:

octo pack --id="TestOctoPack" --format="zip" --version="1.0.0" --basePath="C:\Root\Folder\Here" --include=".\FolderInsideRootFolder\**\*.*"

This packaged the FolderInsideRootFolder, including this folder in the .ZIP file I created along with the contents.

Let me know if that is what you are looking for or if I’m misunderstanding your question.

Best Regards,
Donny

Hello @donny.bell ,
Finally we will do an script to move the files/folders we need before creating the octopack.

But just to let you know, We’re using the octo cli to creare the package in nupkg format. Executing the same command just changing the format, the resultant package it’s completely different. I would expect just changing the format the content of the output package to be the same.

I attached an screenshot of the result

Hi @cpmarc,

Thank you for getting back to me.

I was able to reproduce this behavior. I created a GitHub issue for this here.

Unfortunately, the only workaround I could find would be to include an additional folder level with the same name.

Example:
C:\Root\Folder\Here\FolderInsideRootFolder\FolderInsideRootFolder should work as expected for the following octo pack command:

octo pack --id="TestOctoPack" --format="nupkg" --version="1.0.0" --basePath="C:\Root\Folder\Here" --include=".\FolderInsideRootFolder\**\*.*"

Otherwise, it may be worth looking toward outside packaging tools with more robust features to perform this function in your pipeline.

If you have any additional questions, please don’t hesitate to ask.

Best Regards,
Donny

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.