Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LockFile validation fails for projects with <RuntimeIdentifiers> set in SDK 3.0.100 #8639

Closed
bergbria opened this issue Sep 27, 2019 · 6 comments

Comments

@bergbria
Copy link

Details about Problem

NuGet product used: dotnet.exe

dotnet.exe --version: 3.0.100

Worked before?: Yes, with sdk version 2.2.402

Automated Repro

  1. Download netSdk3_rid_lockFile_repro.zip
  2. Extract
  3. Run repro.bat

Manual repro steps

  1. Create a .csproj resembling this:
<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>netcoreapp2.1</TargetFramework>
    <RuntimeIdentifiers>win-x64;osx-x64</RuntimeIdentifiers>
  </PropertyGroup>
</Project>
  1. dotnet restore --use-lock-file
    • This will succeed and write a lock file
  2. dotnet restore --use-lock-file --locked-mode
    • This will fail with error NU1004: The packages lock file is inconsistent with the project dependencies despite the fact that the file was just generated and nothing has changed.

Tagging @nkolev92 and @rrelyea as FYI.

@anangaur
Copy link
Member

anangaur commented Sep 27, 2019

@nkolev92, Is this because of the framework libraries now getting folded into the SDK with 3.0?

@bergbria
Copy link
Author

@anangaur / @nkolev92 this is related to #7724 / #8442 and possibly has the same root cause. I don't know enough about the implementation to say.

Either way, it's frustrating that this blocks using even newer SDK versions, not just .Net Core 3.

@nkolev92
Copy link
Member

nkolev92 commented Oct 1, 2019

I think this is a duplicate of #8645.

The above example will work if the runtime identifiers are sorted.

For example it doesn't repro for me if I do the following:

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>netcoreapp2.1</TargetFramework>
    <RuntimeIdentifiers>osx-x64;win-x64</RuntimeIdentifiers>
  </PropertyGroup>
</Project>

Can you please confirm @bergbria

@nkolev92 nkolev92 added Area:RestoreRepeatableBuild The lock file features Functionality:Restore Type:Bug WaitingForCustomer Applied when a NuGet triage person needs more info from the OP Product:dotnet.exe Resolution:Duplicate This issue appears to be a Duplicate of another issue and removed Triage:Investigate Resolution:Duplicate This issue appears to be a Duplicate of another issue labels Oct 1, 2019
@nkolev92
Copy link
Member

nkolev92 commented Oct 1, 2019

I guess the other way around since this issue is older.

@nkolev92
Copy link
Member

Fixed by NuGet/NuGet.Client#3075

@nkolev92 nkolev92 removed the WaitingForCustomer Applied when a NuGet triage person needs more info from the OP label Oct 16, 2019
@nkolev92 nkolev92 added this to the 5.4 milestone Oct 16, 2019
@bergbria
Copy link
Author

@nkolev92 - sorry for not responding. Sorting the RIDs did resolve the issue in my repros, so the fix should resolve it. Thanks!

@rrelyea rrelyea changed the title Lock file validation fails for projects with <RuntimeIdentifiers> set in SDK 3.0.100 LockFile validation fails for projects with <RuntimeIdentifiers> set in SDK 3.0.100 Oct 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants