OctoPack web application, assemblies from bin not included

Hello,

So I have several required assemblies included in packages.config (specifically Microsoft.Data.Edm) - however they aren’t included in my .nupkg build by octopack. If I do a nuget.exe pack, it is included. I know you can explicitly declare a files list, but for a relatively large web application that requires a lot of manual work and it really feels like I’m missing something. Any thoughts here?

Thanks,
-Adam

After further testing, running both octo.exe pack and nuget.exe pack locally pack all required files into the .nupkg. This is being built by TeamCity - is there anything special I need to do there? I’m on TeamCity 8.1.3 right now.

Thanks,
-Adam

Hi Adam,

Thanks for getting in touch! Sorry about the delay in getting back to you. Please see my screenshot, you should just be able to set the file as Copy Location equal to true and it will be packed with the rest of the files.

Let me know how that goes!
Vanessa

VS_copylocaltrue.png

Hi Vanessa,

Thanks for the reply. Copy Local is set to true for all assemblies. Could this be an issue with the TeamCity plugin? Running octo.exe does correctly package the dll’s. Also running nuget pack does too - seems to only happen with TeamCity.

Thanks!

Hi Adam,

This information helps. So Octo.exe pack is indiscriminate in its packing and just grabs everything from a folder. Nuget pack is very similar without a NuSpec defined.
OctoPack works differently, it grabs output from MSBuild.
However you could have the best of both worlds. I know you mentioned you didnt want to define files as its a big project, but you only have to define the files not being included (which you can wildcard for a directory) and then include the other files with an added passed in variable.
If the files that aren’t being added are in a few specific locations, you can create a NuSpec in your project and add a variable to the build , and your extra files will be added. See the following documentation:

Let me know if this is a viable solution.
Vanessa

Hi Vanessa,

Again thanks for the reply. I called the support number and left a message, it is about this specific issue.

This might be an option - however it got me thinking. I have a post build event setup - would that interfere with OctoPack in any way?

I will try this option - obvioulsy it is not ideal as it must be maintained and will probably be forgotten, but it might work. Last time (I think it worked this way) I added a files element to the nuspec, only those files defined were copied. I’ll give this another shot.

Thanks,
-Adam

One quick thing, the documentation here is incorrect:

The msbuild command F:\Workspace\OctoFX\source>msbuild OctoFX.sln /t:Build /p:RunOctoPack=true /p:OctoPackPackageVersion=1.0.0.7 /p=OctoPackEnforceAddingFiles=true should have /p:OctoPackEnforceAddingFiles=true not /p=

Hi Adam,

A post bulid event should not interfere unless it has files you want to pack.
Thanks for the catch on that doco page, I’ve fixed it.

Vanessa

Hi Vanessa,

I have tried everything I can think of - the .nuspec section didn’t help. I really want to use the product and have a lot invested so far - is there another avenue for support? Possibly skype or something?

Thanks,
-Adam

One more thing to report - running msbuild from my dev PC with the arguments described in the article does resolve the issue and I get a .nupkg with all of the correct files.

Do you have any suggestions? I think this is more of a TeamCity/Octopack issue.

Thanks

Hi Adam,

When was your TC plugin last updated, it could have a really old version of OctoPack that does not include that parameter.

Vanessa

It is version 2.5.4.35 - I just installed it in the last week or so. I think that is the most current version?

Hi Adam,

Send me a screenshot where you included the build parameter in TC
Also does the TC build log include the command it is using for Octopack.

I’ve just confirmed that TC hooks into the source to get the version of OctoPack from your project, so if its working locally and committed correctly it should work.
If you provide the information above, ill track down if this is a bug or where its missing from.

Vanessa

Hi Adam,

I haven’t heard back about this. I assumed you probably went to bed! I’m about to do the same over this side of the globe. I’ll check for updates in the morning and see if we can get this resolved.

We do offer screen sharing sessions but I don’t have anything open until Thursday which is why I did not offer it before, but if you feel that is suitable and what is needed to resolve this issue please select a suitable time:
https://octopusdeploy.acuityscheduling.com/schedule.php

Thanks!
Vanessa

Thanks Vanessa, yup I went to bed and woke up a while ago to start working on it again :slight_smile: I am going to get you those screenshots and TeamCity build logs. I could not see the parameters passed in with the current build logs so I am digging into that a bit.

I will schedule - thank you very much!

Hi Vanessa,

I have successfully integrated teamcity/octopus for one of my project. I was stuck with an issue where the bin folders were not getting included in the nupkg package. Thanks to your suggestion/document , I used the tag in my nuspec file to resolve the issue. Now I am implementing octopus for another project. Here the problem is a bit differernt, for this project, I used the same method you suggested and the nupkg which is getting generated in the local machine contains all the necessary dlls(bin folder). But when I checked in the code in SVN and tried running it on teamcity , I encountered the same problem. The nupkg which is getting created in teamcity is much smaller in size as it is excluding the bin folder inside it. Any suggesions would be greatly appreaciated?

Thanks Raja

Hi Vanessa,

Thanks to your document, It worked for one project. But for another project , it is working fine in local machine but in teamcity, the nupkg package is excluding the bin folder. Any suggestions would be greatly appreciated?

Thanks…Raja

Hi Raja,

Can you attach the full build log from TeamCity?

Paul

Hi Paul,

Thanks for your response. Please find the attached full build log from TeamCity.
Have a Great New Year.

Thanks
Raja

Build_log_lrs.txt (91 KB)

Hi Raja,

It looks like you are calling OctoPack without calling it as part of MSBuild /t:Build or Rebuild. OctoPack hooks into the Build MSBuild target - the line “Written files: 0” shows that the build didn’t happen during that MSBuild call. Can you attach a copy of your build PowerShell script? You’ll need to change where you pass /p:RunOctoPack=true to also call /t:Build or similar.

Hope that helps!

Paul