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

P2P libraries in project.assets.json file have incorrect Version #3748

Closed
eerhardt opened this issue Oct 24, 2016 · 7 comments
Closed

P2P libraries in project.assets.json file have incorrect Version #3748

eerhardt opened this issue Oct 24, 2016 · 7 comments

Comments

@eerhardt
Copy link

Details about Problem

NuGet product used (NuGet.exe | VS UI | Package Manager Console | dotnet.exe): dotnet restore3

NuGet version (x.x.x.xxx):

>dotnet nuget --version
NuGet Command Line
3.6.0.0

dotnet.exe --version (if appropirate):
1.0.0-preview3-003855

VS version (if appropriate):

OS version (i.e. win10 v1607 (14393.321)):

Worked before? If so, with which NuGet version: dotnet restore with a project.json

Detailed repro steps so we can see the same problem

  1. Have 2 projects: App and Library. App has a ProjectReference to Library.
  2. Set Library's $(Version) to 2.3.4.
  3. Restore App.csproj
  4. Inspect App's project.assets.json file:
    "Library/1.0.0": {
      "type": "project",
      "path": "../Library/Library.csproj",
      "msbuildProject": "../Library/Library.csproj"
    }

P2PTest.zip

Expected Result

I expect Library should have a version of 2.3.4.

@eerhardt
Copy link
Author

/cc @emgarten @rrelyea

@rrelyea
Copy link
Contributor

rrelyea commented Oct 25, 2016

How is this version used?
Is this blocking RC?
RC2 ok?

@eerhardt
Copy link
Author

We use the project assets file information to generate the .deps.json file - specifically we use:

  1. The TargetLibrary Name
  2. The TargetLibrary Version
  3. The TargetLibrary's Dependencies
  4. The LockFileLibrary's MSBuildProject to match it with other MSBuild info about the P2P reference.

So if this Version is wrong, then the library's version in the .deps.json is going to be wrong.

Looking through https://github.com/dotnet/core-setup/tree/master/src/corehost code, I don't think the host needs the version number to be correct for "project" libraries, since these aren't resolved from the NuGet cache. @schellap @gkhanna79 - can you confirm?

The other place that reads the .deps.json file is ASPNET code. @pranavkm @pranavkm @anurse - Do you see the "project" library's version number being incorrect in the .deps.json file as a blocker for RC?

@pranavkm
Copy link
Contributor

cc @pakrym in case he knows more. We don't use the Version component of DependencyContext in Mvc (just the name). So this shouldn't affect AspNetCore.

@pakrym
Copy link

pakrym commented Oct 26, 2016

I don't think type:project dependency version is used anywhere right now.

@schellap
Copy link

The host is agnostic to the type of the asset (package, project etc.) It uses a probing order given package name and version which forms the identity (meaning what) -- this can be found in the NuGet cache (meaning where) if it appears there first.

@rrelyea
Copy link
Contributor

rrelyea commented Oct 27, 2016

Moving to RC2, yell if that is too late.

emgarten added a commit to NuGet/NuGet.Client that referenced this issue Nov 5, 2016
This change reads the version or packageVersion property from an msbuild project and adds it to the package spec. This allows the assets file to display the correct version under the library entry.

Fixes NuGet/Home#3748
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

6 participants