So I feel like I have come to the end of the rope here, but hoping someone knows more than I do here. I have some Typescript
files, though that is mostly irrelevant as I am having this problem with all content files.
I am able to generate a nuget
, or more precisely dotnet pack
, nuget package that includes my content files in the package by using this in the .csproj
of my parent
project:
<ItemGroup>
<Content Include="Scripts\Utility.ts">
<Pack>true</Pack>
<PackagePath>contentFiles\Scripts\;content\Scripts</PackagePath>
</Content>
</ItemGroup>
I can browse the generated .nupkg
and see that indeed the file was added to the package in both the content\Scripts
and contentFiles\Scripts
locations
The problem is that whenver I consume this package in my 'child' project, that Typescript
never gets copied into any folder of the child
project, though I can see it extracted in the .nuget\packages\parent\...
folders.
At first I thought it was something with my initial settings in the parent
project, and it may be, but after trying what seems like everything in the book, that fails to copy the content files to the child
project. I then tried going the dark path of trying to use Init.ps1
in the tools
folder of my package, and though it was impossible to debug, it also seemed to run sporatically (I completely unistalled and reinstalled the package and it still failed to run most of the time.) This could be the way but I don't know why I can't get it to output to the Package Manager Console
... maybe there's still hope with Init.ps1
but I can't seem to figure it out. Finally I see some potential with a nuget .targets
file but I can's seem to grasp how to use it for my purpose either! I would love some feedback as to how to get this done.