Repository navigation
NullReferenceException when doing paket.exe update #4315
Copy link
Copy link
Closed
Description
When we do paket.exe update with 10.0.0, 10.0.1 or 10.1.1 we get:
Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object.
at Paket.PackageResolver.step@1134(UpdateMode updateMode, GroupName groupName, FSharpOption`1 globalStrategyForTransitives, FSharpOption`1 globalStrategyForDirectDependencies, FrameworkRestrictions globalFrameworkRestrictions, FSharpFunc`2 getVersionsRaw, FSharpFunc`2 getPreferredVersionsRaw, FSharpFunc`2 getPackageDetailsRaw, FSharpSet`1 cliToolSettings, ResolverRequestQueue workerQueue, Int32 taskTimeout, TimeSpan loopTimeout, ConcurrentDictionary`2 startedGetPackageDetailsRequests, FSharpFunc`2 getPackageDetailsBlock, ConcurrentDictionary`2 startedGetVersionsRequests, FSharpOption`1 packageFilter, IDictionary`2 rootDependenciesDict, FSharpSet`1 lockedPackages, DateTime loopTime, Stage stage, StackPack stackpack, IEnumerable`1 compatibleVersions, StepFlags flags)
at Paket.PackageResolver.tryStep@1464(UpdateMode updateMode, GroupName groupName, FSharpOption`1 globalStrategyForTransitives, FSharpOption`1 globalStrategyForDirectDependencies, FrameworkRestrictions globalFrameworkRestrictions, FSharpFunc`2 getVersionsRaw, FSharpFunc`2 getPreferredVersionsRaw, FSharpFunc`2 getPackageDetailsRaw, FSharpSet`1 cliToolSettings, ResolverRequestQueue workerQueue, Int32 taskTimeout, TimeSpan loopTimeout, ConcurrentDictionary`2 startedGetPackageDetailsRequests, FSharpFunc`2 getPackageDetailsBlock, ConcurrentDictionary`2 startedGetVersionsRequests, FSharpOption`1 packageFilter, IDictionary`2 rootDependenciesDict, FSharpSet`1 lockedPackages, DateTime loopTime, StepResult result)
at Paket.PackageResolver.Resolve(FSharpFunc`2 getVersionsRaw, FSharpFunc`2 getPreferredVersionsRaw, FSharpFunc`2 getPackageDetailsRaw, GroupName groupName, FSharpOption`1 globalStrategyForDirectDependencies, FSharpOption`1 globalStrategyForTransitives, FrameworkRestrictions globalFrameworkRestrictions, FSharpSet`1 rootDependencies, UpdateMode updateMode)
at <StartupCode$Paket-Core>.$DependenciesFile.resolveGroup@220-1.Invoke(GroupName groupName, b _arg1)
at Microsoft.FSharp.Collections.MapTreeModule.mapiOpt[TKey,TValue,TResult](FSharpFunc`3 f, MapTree`2 m)
at Microsoft.FSharp.Collections.MapModule.Map[TKey,T,TResult](FSharpFunc`2 mapping, FSharpMap`2 table)
at Paket.UpdateProcess.selectiveUpdate(Boolean force, FSharpFunc`2 getSha1, FSharpFunc`2 getVersionsF, FSharpFunc`2 getPackageDetailsF, FSharpFunc`2 getRuntimeGraphFromPackage, LockFile lockFile, DependenciesFile dependenciesFile, UpdateMode updateMode, SemVerUpdateMode semVerUpdateMode)
at Paket.UpdateProcess.SelectiveUpdate(DependenciesFile dependenciesFile, FSharpOption`1 alternativeProjectRoot, UpdateMode updateMode, SemVerUpdateMode semVerUpdateMode, Boolean force)
at Paket.UpdateProcess.SmartInstall(DependenciesFile dependenciesFile, UpdateMode updateMode, UpdaterOptions options)
at <StartupCode$Paket-Core>.$PublicAPI.UpdateFilteredPackages@355.Invoke(Unit unitVar0)
at Paket.Utils.RunInLockedAccessMode(String lockedFolder, FSharpFunc`2 lockedAction)
at Paket.Program.handleCommand@888-16.Invoke(ParseResults`1 results)
at Paket.Program.processWithValidationEx[a](FSharpFunc`2 printUsage, Boolean silent, FSharpFunc`2 validateF, FSharpFunc`2 commandF, a result)
at Paket.Program.handleCommand(Boolean silent, Command command)
at Paket.Program.main()
at <StartupCode$paket>.$Paket.Program.main@()
Using paket.exe 9.0.2 works. Any idea what's going on?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Activity
forki commentedon Jan 19, 2026
could you please try the new version and let me know? thanks
martinh2011 commentedon Jan 19, 2026
The exception is gone. However, now I get a lot of "Conflict detected:" message during update which paket.exe seems to be unable to resolve. Going back to 9.0.2 and the conflicts are gone.
forki commentedon Jan 19, 2026
martinh2011 commentedon Jan 19, 2026
Cannot share the file publicly (Company Policy), but you got mail.
forki commentedon Jan 19, 2026
#4284 <- this introduced the new check. cc @fpellet
Fix framework compatibility check using proper NuGet semantics (#4315)
priestm commentedon Jan 19, 2026
I think we also ran into this same issue with 10.2.0. I managed to narrow it down to a reproducible sample Nuget package and paket.dependencies file.
It looked like when the Nuget package contained a directory called "components" and we were targetting "net48" framework, then it would go wrong with the following error:
Appears to be fixed in 10.2.1.
Bump cache version to invalidate old entries missing AvailableFrameworks
Revert PR-4284 and fix #4315 to resolve .NET 10 compatibility issues
martinh2011 commentedon Jan 20, 2026
Seems to work here with 10.3.1 now. No NullReferenceException, conflicts are gone.