Anybody up for a little helping? I'm having issues...
# package-development
b
Anybody up for a little helping? I'm having issues after switching to the umbraco package template and dotnet pack. My files aren't being copied to App_Plugins after nuget install, any ideas? - Umbraco 10
k
Hi, do you have a .targets file ?
It also needs to be the same name as the package (e.g
my.super.package.nupkg
the targets file has to be called
my.super.package.targets
If you have nuget package explorer you can check the nuget package has the files in it
(you might have it in
/content/app_pluigns
- that doesn't matter as long as the targets also reflects that).
When you do a dotnet build - if the targets is firing you should see the "Copying..." message. you can use the path in that to confirm if the path has files (so the package will be in
%userprofile%/.nuget/packages
(e.g
C:\Users\kevin\.nuget\packages
)
Also worth noting that packages are cached ! - so if you build a v1.0.0-beta001 package then when you install it first time it will be stored in the nuget cache, if you rebuild it with the same version - and reinstall you won't be using your new package it will be using the one in the cache
So - add some version thing on each build while testing eg. i set the version to
1.0.0-beta001.20220624.1
and increment it while testing .
e.g
dotnet pack .\mypackage.csproj -c release -o ../output /p:version=1.0.0-beta001.20220624.1
(more drastic to clear the cache
dotnet nuget locals -c all
- but this clears all the nuget packages and will make the next build really slow)
b
Ok I'm going through this now, thank you for the pointers! I'll let you know how things go
k
Good luck 🤞
b
I also see some missing symbols:
So the .targets files is not firing I presume, since its not in the output above
k
yeah - looks that way - does it have same name as the project (i think it looks like it does) - and its not hitting somethihg cached inside your
.nuget
folder in your profile ?
b
I ran the dotnet nuget locals -c all command before publishing this package to nuget gallery, even spun up a new umbraco 10 project and installed there, same thing.
I also tried to manually create the package in nuget explorer both with and without a content folder. Even tested with just one simple file inside App_Plugins\packagedemo\ and nothing gets moved to the directory.
k
Just put the v0.0.5 package from nuget onto a local test site. and it copied the files.
b
Well I figured out what went wrong
kind of dumb (of course!). I ran dotnet build one folder down from the root 🤦
Thanks for all your help and the tips above came in handy! ❤️