Copy Always file being packed into wrong nuget package


We have 3 octopack projects within our solution file, 2 are windows services and another is an api. The 2 windows services have a Deploy.ps1 file to install them after the package has been installed on our different environments. We’ve just started having an issue where the Deploy.ps1 file for 1 of the services is now appearing in the nuget package for all 3 of the packages, thus making the install fail (and giving warnings on the api).

Any idea what could be causing this? I’ve checked locally and the files all go into the correct folders there.

Seems to suddenly be working now. We did nothing and it stopped working and then did nothing to fix it. Very odd.

Hi Sam,

Thanks for reaching out.

I’m gonna assume you are using Octopack to pack your projects. Let me know if that’s not the case.

Octopack basically reads the csproj of your projects at buildtime to decide if a file goes or not inside of the package. The first thing I’d check is if this Deploy.ps1 is being declares as “Copy Always” on the Project’s csproj file.

Let me know how that goes


Hi Dalmiro,

Yes we are using Octopack for this and yes “Copy Always” is set to Deploy.ps1 on the csproj file, it has been working perfectly for months and thern suddenly just stopped without me changing anything. Thankfully it seems to have fixed itself overnight, the ps1 file is still being copied to the API project randomly, however this only produces a warning which im happy to live with for now.

If it starts happening again I will have to come back to you.