Creating Nuget package with PublishProfile

Hi all,

We have added OctoPack to few our projects that need packaging (Main website and one additional website this a library project). The problem is that during build process second website is build dynamically using publishing profile located in MainWebsite/Properties/PublishProfiles/FileSysPackaging.pubxml. In publish profile some compiled folders and files copied to secondary website. So we get that Nuget package produced by OctoPack for secondary website doesn’t contain files and folders that are expected, since he is ignoring publishing profile. So are there any ways for Nuget or OctoPack to honor our publishing profile? That are possible solutions for this problem?

Best regards,
Volodymyr

Hi Volodymyr,

Thanks for reaching out. I’m afraid Octopack won’t be able to work in this scenario. The best solution for this would be to setup a separate NuGet step to pack your application from a specific directory once all the necessary files were built.

Regards,

Dalmiro

Hi Dalmiro,

Thanks, I was afraid we will need to use Nuget for this. Could you please provide some example or something, I not very familiar how this is possible via Nuget. So basically we need to get files from NuGet package for main website and then create new Nuget package based on dll from first package, or what are the correct steps. We are using TeamCity to build and package those websites

Best Regards,
Volodymyr

Hi Volodymyr,

No need to be afraid of NuGet! Specially if you are using TeamCity, as it has built-in steps to Pack and Publish (see attached screenshot).

On the Pack step you will tell Nuget “I want you to pack everything that’s in [this] folder into a Nuget package”

On the Publish step you’ll tell Nuget “Push [this] package to my nuget feed”

TeamCity has very good documentation for both steps:

https://confluence.jetbrains.com/display/TCD8/NuGet+Pack
https://confluence.jetbrains.com/display/TCD8/NuGet+Publish

Regards,

Dalmiro