-
Notifications
You must be signed in to change notification settings - Fork 258
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
dotnet pack - ProjectReference loses version information #3953
Comments
Quick feedback here will be appreciated. If we need to do something in migration we need to know :) |
rc2 has this fixed (the part about all proj refs end up as 1.0.0). we need to integrate into CLI this week. |
@jgoshi @piotrpMSFT 1) & 2) seem to have been fixed in latest versions of pack and sdk. Would appreciate if you could verify it. as for 3) and 4) seem to be expected behavior, still discussing if we need to fix them. |
@jgoshi 4) is definitely the right behavior going forward. There is no change in behavior functionally, and this way we are consistent with nuget.exe pack |
Which versions? I can verify this is still happening in CLI 1.0.0-preview4-004233 (RC.2) |
@natemcmaster latest build from dev branch of nuget. if you are interested in trying it out , i can help you patch the DLLs correctly to give it a try. |
first issue and second issue in OP are fixed, awaiting next integration into CLI. |
RC.3 fixes part of the problem (all version used to be set to 1.0.0), but has introduced others, primarily, that the 'version' of package references is resolved at restore, not at pack. This means --version-suffix can only apply to the currently-packed project, not its references. Repro: Goal: Comparison: With 4.0.0-rc3, if I have the same setup, running the same pack command ( |
If so, it's a significant breaking change from project.json behavior and will make builds difficult for anyone with multiproject solutions. |
@natemcmaster why cant you just use package reference version= 3.0.0-$(VersionSuffix) instead of putting a "*" ? |
@rohit21agrawal a little confused by your question. PackageReference and ProjectReference are not the same thing. Can you clarify what you were asking? |
@natemcmaster oh i thought you were referring to the behavior of PackageReference, i misread your OP. can you attach your project's assets file here? |
Here's a gist with the repo: Here is the project.assets.json file: |
One possible workaround: if you set version suffix during restore, it get's baked into the project.assets.json file, and shows up in nuspec:
This is still less than ideal, and I suspect will go wrong when the build runs NuGet restore within Visual Studio. |
feel free to file a separate bug on this, but i feel this workaround is the only solution going forward. |
@natemcmaster any other bugs from the OP that still repro for you? |
Without the workaround of calling restore AND pack in one MSBuild invocation #3953 (comment), item 3 in OP description still repros. It's the version-suffix on project reference issue we've been discussing. |
@natemcmaster could you open another bug which specifically tracks that issue, and close this one please? |
dotnet --info
.NET Command Line Tools (1.0.0-preview4-004094)
Product Information:
Version: 1.0.0-preview4-004094
Commit SHA-1 hash: fc4eb2108c
Runtime Environment:
OS Name: Windows
OS Version: 10.0.14393
OS Platform: Windows
RID: win10-x64
Repro steps:
If you open up the generated nuspec file you will see the correct version numbers for both TestApp and the dependent TestLibrary project.
Note the following bugs:
The text was updated successfully, but these errors were encountered: