-
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
VS doesn't restore on build/rebuild due to migration of versionprefix in netfx;netstandard project #4487
Comments
From @333fred on February 2, 2017 18:59 Another project that demonstrates this issue: exceptionless/Exceptionless.Net@31ef359. |
Here is the NuGet Exception:
This was introduced by this PR: NuGet/NuGet.Client#1146 Inspecting the project after migration, I see:
This is what is causing this exception. I was able to resolve this by removing the NuGet explicitly does not handle cases where different PackageVersions are returned for different TFMs, though perhaps it shouldn't crash restore, especially if this is a common migrate scenario. |
@alpaix To clarify, this does not crash VS, it just breaks restore. But I think that's what you meant. I believe the fix to #4419 only covers the case where the conflict is between 1.0.0.0 and 1.0.0. In the first sample, the entry <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>netcoreapp1.0;net451</TargetFrameworks>
<VersionPrefix>1.2.0</VersionPrefix>
<RuntimeIdentifier>win7-x86</RuntimeIdentifier>
</PropertyGroup>
</Project> |
From @davkean on February 3, 2017 1:19 Should we move this over to NuGet (you can use: https://github-issue-mover.appspot.com/)? |
believe that restore is having a hard time because Version is different for each tfm. |
Potential Fix: Workaround: |
What are the semantic differences between versionprefix and version? if I have version 1.0.0-* and pass --version-suffix to dotnet pack, will the right version be constructed. We have versionprefix in migration because we must maintain the same semantics as the project.json version property. Also, while everyone who migrates will hit this, fixing this in migration does not address the root cause of the problem? People who have multiTFM with netfx and netcore and add a versionprefix themselves will hit this. I don't believe this is a migration issue and this should be fixed somewhere else. |
@livarcocc is right. Migration's job is to create a semantically same csproj to project.json. Also, if we migrate it in such a way |
The problem is |
SDK plans a clever fix: dotnet/sdk#814 |
This is fixed now: Verified with VS build: 26206.0.d15rel I could repro the with the same project on 26204.0.d15rel. The restore was correct in 26206.0.d15rel |
From @krwq on February 2, 2017 17:13
Repro:
VS build: 15.0.0-RC.4+26130.1.d15rel
I have previously tested this exact scenario on one of the previous builds (26020) and it has worked before (I was unable to repro it working - possibly some of the nuget packages disappeared - I did errors during restore though which means that at least VS tried to restore).
cc: @srivatsn @rrelyea
Copied from original issue: dotnet/project-system#1447
Update from @natidea:
A simplified repro is:
The text was updated successfully, but these errors were encountered: