Octopack 3.4.6 not generating artifacts

I spent a couple hours yesterday setting up a new CI build in TeamCity and a new project in Octopus Deploy. For the life of me I could not get the build to generate a nuget package artifact. After some sleep and new ideas, I looked to see what our previous projects version of Octopack was. I rolled back to OctoPack 3.4.1 and artifacts were built without any other TeamCity changes. I am putting this here in case someone else runs into this. TeamCity was reporting the nuget package create step a success even though nothing was being generated.

Hi Mike,

Thanks for reaching out! Is there any chance you can send us one of your TC build logs running Octopack 3.4.6 so we can check this out? If you don’t want to share this in this public topic, feel free to email it to support@Octopus.com

Also please let me know which version of TC you are running.

Thanks,
Dalmiro

I have sent an email to the support address with the requested information.

Hi Mike,

Thanks for sending that info. Also deep apologies for the delay here. I took the time to setup the same version of TC and Octopack as you, but in my case it worked as expected.

I’m starting to think that maybe Octopack wasn’t properly installed on your project. It is not that uncommon to Install it from the VS nuget manager, but then forget to commit all the actual changes that come with it into Source Control. To rule out this posibility, could you please uninstall the whole Octopack package from your solution, and then re-install it? Once you do that, make sure you commit all the changes that the installation created to Source Control. I’m particularly interested in the following piece being added to your project’s csproj file:

<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
  <Import Project="..\packages\OctoPack.3.4.6\tools\OctoPack.targets" Condition="Exists('..\packages\OctoPack.3.4.6\tools\OctoPack.targets')" />
  <Target Name="EnsureOctoPackImported" BeforeTargets="BeforeBuild" Condition="'$(OctoPackImported)' == ''">
    <Error Condition="!Exists('..\packages\OctoPack.3.4.6\tools\OctoPack.targets') And ('$(RunOctoPack)' != '' And $(RunOctoPack))" Text="You are trying to build with OctoPack, but the NuGet targets file that OctoPack depends on is not available on this computer. This is probably because the OctoPack package has not been committed to source control, or NuGet Package Restore is not enabled. Please enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=317567." HelpKeyword="BCLBUILD2001" />
    <Error Condition="Exists('..\packages\OctoPack.3.4.6\tools\OctoPack.targets') And ('$(RunOctoPack)' != '' And $(RunOctoPack))" Text="OctoPack cannot be run because NuGet packages were restored prior to the build running, and the targets file was unavailable when the build started. Please build the project again to include these packages in the build. You may also need to make sure that your build server does not delete packages prior to each build. For more information, see http://go.microsoft.com/fwlink/?LinkID=317568." HelpKeyword="BCLBUILD2002" />
  </Target>

Regards,
Dalmiro

I uninstalled OctoPack 3.4.1 and installed the latest build, 3.4.6. After
committing the project, TeamCity built the solution and generated the nuget
package. I am not sure what happened the first several times I tried
before. Here is the section from my csproj. file.





Mike Dunham

Software Developer II

Phone: 913-309-4520

Fax: 1-855-895-4520

Email: mdunham1@grantham.edu myemail@grantham.edu

[image: Inline image 1]

   Online.* But not alone*.*TM*

Know someone who should hear about Grantham? Refer a Friend
http://grantham.edu/refer-a-friend!

image.png

Woohoo \o/

Your .csproj looks as expected now.

Cheers!
Dalmiro