Skip to content
This repository has been archived by the owner on Jan 22, 2020. It is now read-only.

Nuget package dependency incorrect version.. #11

Closed
srininz77 opened this issue Nov 27, 2017 · 8 comments
Closed

Nuget package dependency incorrect version.. #11

srininz77 opened this issue Nov 27, 2017 · 8 comments
Assignees

Comments

@srininz77
Copy link

srininz77 commented Nov 27, 2017

I have 2 projects - ProjectA and ProjectB.

I added MSBump nuget package to both the projects. I have the following version in both csproj files:
1.0.0-pre000002

ProjectB has dependency on ProjectA.

When I build the solution, the version number in both the projects are incremented to 1.0.0-pre000003 which is CORRECT.

However, the resulting ProjectB nuget package has dependency on ProjectA nuget package 1.0.0-pre000002 instead of 1.0.0-pre000003.

Any ideas why this is happening. Thank you.

@BalassaMarton BalassaMarton self-assigned this Nov 27, 2017
@BalassaMarton BalassaMarton added bug and removed bug labels Nov 27, 2017
@BalassaMarton
Copy link
Owner

@srininz77 Thank you for reporting this problem. It is actually an issue with NuGet: NuGet/Home#4337
Until this is resolved, the only workaround I have is to run dotnet build --no-dependencies manually on your projects.

@srininz77
Copy link
Author

Thanks.
A post build event of dotnet pack --no-build worked for me.

@BalassaMarton
Copy link
Owner

I've reopened this issue so that others can find the workaround more easily. I'll close it when the blocking NuGet issue is fixed.

@BalassaMarton
Copy link
Owner

@srininz77 I've added your workaround to the readme. As it turns out, NuGet/Home#4790 is the blocking issue.

@AndrewTriesToCode
Copy link

AndrewTriesToCode commented Mar 2, 2018

Hi, using 2.3.2 even with @srininz77's workaround I see the problem behavior. I also noticed thats the deps.json file in the output directory appears to be ahead by 1:

...
"targets": {
    ".NETStandard,Version=v2.0": {},
    ".NETStandard,Version=v2.0/": {
        "MyProject/1.0.0-dev0007": {
            "dependencies": {
              "MyProject.Core": "1.0.0-dev0006",
...

In the .csproj file both MyProject and MyProject.Core had version 1.0.0-dev0006 before build and version 1.0.0-dev0007 after build. It seems like a mismatch in the json selection above.

Update: I was seeing the .nuspec file problem because I was using dotnet pack --no-build --no-restore, after removing --no-restore the .nuspec file appears ok.

Thanks!

@BalassaMarton
Copy link
Owner

@achandlerwhite could you please create a repo to demonstrate the problem?

@AndrewTriesToCode
Copy link

AndrewTriesToCode commented Mar 3, 2018

@BalassaMarton sure here it is: https://github.com/achandlerwhite/MSBumpExample
Edit: I realize now this is probably not related to this particular issue. Let me know if you want me to create a new issue.

@BalassaMarton
Copy link
Owner

Good news, the NuGet issue has been fixed. Update NuGet with nuget update -self and the generated packages should have the correct version numbers in their dependencies.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants