I'm having a strange problem with a package. If I ...
# package-development
h
I'm having a strange problem with a package. If I install it from my local nuget repositry everything works fine and the package installs in umbraco, however if I upload the package to nuget and install the package from there, when I run umbraco I get the following error
Copy code
BootFailedException: Boot failed: Umbraco cannot run. See Umbraco's log file for more details.

-> Umbraco.Cms.Core.Exceptions.BootFailedException: Value cannot be null. (Parameter 'packageXmlFile')

-> System.ArgumentNullException: Value cannot be null. (Parameter 'packageXmlFile')
at Umbraco.Cms.Infrastructure.Packaging.PackageInstallation.ReadPackage(XDocument packageXmlFile)
ANy body any bright ideas as to what is going on?
s
I'm assuming you're embedding a package.zip with doctype definitions etc.? Something is wrong with that 😅
h
I'm embedding a package.xml not zip, but yes the code looks like that, and installs perfectly from a local repo just not when installed from nuget, (same nuget package)
s
Any chance you can send me the nupkg file here?
Installing in v10 or 11?
h
Grrrr, it was the nuget cache! I cleared it out and reinstalled, now all working 😄 This is the package, but all good now I'v cleaned out my nuget cache 😢 https://github.com/users/huwred/packages/nuget/package/Umbraco.Community.FullCalendar.Block
s
I was going to say that.. lol
So the one pro-tip I have for you: never, ever, set up local NuGet source ⚠️ Those will be cached, and then when you try to fetch the package that you've changed 10 times since the first build locally from remote NuGet, you get the version that was locally cached. Work around this by using NuGet commands to point to a package source while developing:
dotnet add package Cultiv.Hangfire --source D:\Dev\Cultiv.Hangfire\Release --prerelease
This SHOULD solve caching issues, as I believe it doesn't get cached if you use
--source
- however, to be EXTRA safe, I always make sure I change the version number before I upload to nuget.org. So locally I keep changing the version on each build:
dotnet build --configuration Release /p:Version=2.2.2-rc001
(and
rc002
, etc). When I finally upload to nuget.org, it has to be at LEAST
rc003
if I previously used
rc002
locally. Might be paranoia, but it saves me from issue like this! 😅