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

Dependencies via project reference are not having versions updated when performing a dotnet pack #7890

Closed
KallDrexx opened this issue Mar 9, 2017 · 1 comment

Comments

@KallDrexx
Copy link

Steps to reproduce

  1. Go to a directory
  2. mkdir test1
  3. mkdir test2
  4. cd test1
  5. dotnet new classlib
  6. Edit test1.csproj and add <VersionPrefix>1.0.1</VersionPrefix>
  7. dotnet restore then dotnet pack
  8. cd ../test2
  9. dotnet new classlib
  10. vim Class1.cs
  11. Change class definition to public class Class1 : test1.Class1
  12. Edit test2.csproj and add <VersionPrefix>1.0.0</VersionPrefix>
  13. Edit test2.csproj and add:
  <ItemGroup>
    <ProjectReference Include="../test1/test1.csproj" />
  </ItemGroup>
  1. dotnet restore then dotnet pack
  2. Edit test1.csproj and change version to 1.0.2, then build and repack it
  3. go back to test2 folder and update the version to 1.0.1
  4. In test2 folder do dotnet restore then dotnet pack
  5. Extract the test2.1.0.1.nupkg
  6. View the .nuspec file

Expected behavior

Dependency should be listed as:
<dependency id="test1" version="1.0.2" exclude="Build,Analyzers" /> so that any nuget package built against the test2 library auto-restore test1 to 1.0.2

Actual behavior

Dependency is outdated and listed as

<dependency id="test1" version="1.0.1" exclude="Build,Analyzers" />

This is impacting us heavily right now as any time we build a nuget package it has outdated dependencies, which when restored on other projects causes FileLoadExceptions due to dotnet restore restoring an older dll.

Environment data

dotnet --info output:

.NET Command Line Tools (1.0.1)

Product Information:
 Version:            1.0.1
 Commit SHA-1 hash:  005db40cd1

Runtime Environment:
 OS Name:     ubuntu
 OS Version:  16.04
 OS Platform: Linux
 RID:         ubuntu.16.04-x64
 Base Path:   /usr/share/dotnet/sdk/1.0.1
@livarcocc
Copy link
Contributor

Moved this to nuget/home: NuGet/Home#4779.

@msftgits msftgits transferred this issue from dotnet/cli Jan 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants