-
Notifications
You must be signed in to change notification settings - Fork 265
Open
Labels
Area:RestoreRepeatableBuildThe lock file featuresThe lock file featuresFunctionality:RestoreType:BugWaitingForCustomerApplied when a NuGet triage person needs more info from the OPApplied when a NuGet triage person needs more info from the OP
Description
NuGet Product Used
dotnet.exe
Product Version
10.0.101
Worked before?
8.0
Impact
It's more difficult to complete my work
Repro Steps & Context
Trying to restore NuGet packages using locked mode fails for Blazor WASM projects due to a package appearing in the lock file even though it is not referenced. I tried reporting this as a .NET SDK bug but was told this is a NuGet issue.
Reproduction repository: https://github.com/dosolkowski-work/dotnet-restore-error
Steps:
- Run
dotnet new blazorwasm - Add project settings:
<Deterministic>true</Deterministic>
<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>
<RestoreLockedMode Condition="'$(CI)' == 'true'">true</RestoreLockedMode>- Run
dotnet restore --force --force-evaluateto generate a lock file - Build in CI fails:
dotnet publish dotnet-restore-error.csproj -c Release --output publish
Verbose Logs
Edited for readability:
/__w/dotnet-restore-error/dotnet-restore-error/dotnet-restore-error.csproj : error NU1004: The package references have changed for net10.0.
Lock file's package references:
Microsoft.AspNetCore.App.Internal.Assets:[10.0.1, ),
Microsoft.AspNetCore.Components.WebAssembly:[10.0.1, ),
Microsoft.AspNetCore.Components.WebAssembly.DevServer:[10.0.1, ),
Microsoft.DotNet.HotReload.WebAssembly.Browser:[10.0.101, ),
Microsoft.NET.ILLink.Tasks:[10.0.1, ),
Microsoft.NET.Sdk.WebAssembly.Pack:[10.0.1, ),
project's package references:
Microsoft.AspNetCore.App.Internal.Assets >= 10.0.1,
Microsoft.AspNetCore.Components.WebAssembly >= 10.0.1,
Microsoft.AspNetCore.Components.WebAssembly.DevServer >= 10.0.1,
Microsoft.NET.ILLink.Tasks >= 10.0.1,
Microsoft.NET.Sdk.WebAssembly.Pack >= 10.0.1.
The packages lock file is inconsistent with the project dependencies so restore can't be run in locked mode. Disable the RestoreLockedMode MSBuild property or pass an explicit --force-evaluate option to run restore to update the lock file.
See action run log for details.
Metadata
Metadata
Assignees
Labels
Area:RestoreRepeatableBuildThe lock file featuresThe lock file featuresFunctionality:RestoreType:BugWaitingForCustomerApplied when a NuGet triage person needs more info from the OPApplied when a NuGet triage person needs more info from the OP