I have a worker role that contains a reference to a few nuget packages that drop a few needed runtime files as a post-build step to the project bin folder.
The problem I'm facing is that these files are not being copied over to the published worker role as they are not tracked by the worker role .csproj
Worker role .csproj:
...
<Import Project="[path-to-nupkg]\build\package.targets" Condition="Exists('[path-to-nupkg]\build\package.targets')" />
package.targets copy post-build resources, so after build the worker role bin folder includes:
MyWorkerRole.dll
resource.txt
Resources\another_resource.txt
However, when packaging the worker role for deployment the WorkerRole.cspkg contains only MyWorkerRole.dll
.
I tried to follow Dynamically Add Content to Windows Azure Application Roles by adding the following to my .ccproj:
<Target Name="BeforeAddRoleContent">
<ItemGroup>
<AzureRoleContent Include="Resources\*">
<RoleName>MyWorkerRole</RoleName>
</AzureRoleContent>
</ItemGroup>
</Target>
But the folder is not dropped and I don't get any error during packaging.
Edit: It was suggested I'll try using Role Content Folders, but the problem in my case is that the resources are coming from a Nuget package. So not available until at least build time (actually being dropped as a post-build task).