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

nuget.exe restore works, and the automatic restore in VS causes build failures #6520

Open
AArnott opened this issue Feb 3, 2018 · 8 comments
Labels
Category:Quality Week Issues that should be considered for quality week Functionality:Restore Priority:2 Issues for the current backlog. Product:VS.Client Style:PackageReference Type:Bug

Comments

@AArnott
Copy link
Contributor

AArnott commented Feb 3, 2018

I believe this is a regression in 15.6

nuget.exe v4.3.0
VS d15.6 27401.0

git clone https://devdiv.visualstudio.com/DefaultCollection/Personal/_git/VS-Platform.andarno
cd vs-platform
git co 06ce2c7ba2005a4c17efd711c1dc51773958c761
.\init -feature connectedservices
cd src\ConnectedServices\test\ConnServ.UnitTests
msbuild

When following these steps, the build should succeed.

But when you open the src\ConnectedServices\ConnectedServices.sln solution in VS and build, automatic package restore occurs, and screws up the ConnServ.UnitTests project's restored files and the build for that project ends up breaking due to missing references.

At this point, even command line builds fail. But if you run nuget restore at the command line for that project and then retry the build from the command line, it works again. But if you try to build from VS, then once again automatic package restore steps in and breaks the build again.

The project.assets.json for the broken project is very different (and much smaller) than the same file when it works properly as restored from the command line. The two files are attached below:
ConnServ.UnitTests.zip

@nkolev92
Copy link
Member

nkolev92 commented Feb 5, 2018

From the assets file it seems like the project references are not being resolved in VS.
//cc
@emgarten

@nkolev92
Copy link
Member

nkolev92 commented Feb 6, 2018

@AArnott I was not able to reproduce the issue the way you describe it with 27404.4.d15.6
Latest stable from Preview 4 of d15.6.

I do still see discrepancies in the assets files but they're super weird.

Namely it's project versions and an extra package in the project, Microsoft.VisualStudio.ConnectedServices.Package2, when run in CommandLine,

"Microsoft.VSSDK.BuildTools": "15.6.150"

Versioning:

      "Microsoft.VisualStudio.ConnectedServices >= 15.7.34-preview-g2147761e90",

vs

      "Microsoft.VisualStudio.ConnectedServices >= 1.0.0",

I also see a discrepancy in the project name.
VS:

      "projectName": "ConnServ.UnitTests",

Commandline

      "projectName": "Microsoft.VisualStudio.Nonshipping.ConnectedServices.UnitTests",

Do any of these differences ring a bell?

@AArnott
Copy link
Contributor Author

AArnott commented Feb 6, 2018

The 1.0.0 version issue is probably due to #4790
It only manifests for this repo the very first time you run restore. After that, restores in that repo should have the right version.

For ConnServ.UnitTests vs. Microsoft.VisualStudio.Nonshipping.ConnectedServices.UnitTests, the former is the name of the project while the latter is the name of the assembly it produces.

Microsoft.VSSDK.BuildTools is imported directly in ConnectedServices.Package2.csproj. It is also conditionally brought in by a Directory.Build.targets file based on the $(VSToolsPath) property being defined.

Does that help?

@AArnott
Copy link
Contributor Author

AArnott commented Feb 6, 2018

Incidentally, it doesn't repro for me with d15.6 27404.0 either.
I'll leave it to you to determine whether there's something worth pursuing here.
Thanks.

@nkolev92
Copy link
Member

nkolev92 commented Feb 6, 2018

Yeah that makes sense.

Since it's not breaking your build currently, I'll just consider it a lower priority, but I'd still like to investigate a bit more, as part of the drive to minimize differences among VS and CLI to eliminate unneeded restores.

@nkolev92 nkolev92 added this to the Backlog milestone Feb 6, 2018
@nkolev92 nkolev92 added the Priority:2 Issues for the current backlog. label Feb 6, 2018
@nkolev92 nkolev92 self-assigned this Feb 6, 2018
@martinsuchan
Copy link

Hi, any chance this is related to my issue with broken NuGet restore since VS 15.6 Preview 4?
https://developercommunity.visualstudio.com/content/problem/195751/nuget-broken-in-vs-2017-156-preview-4-error-0x8000.html

@nkolev92
Copy link
Member

@martinsuchan
I don't think so.
They issue you're hitting is a generic error to me. It's very unlikely it's related to NuGet.

I think 15.6 - preview 5 is out thoguh, can you please try that?

@nkolev92
Copy link
Member

Probably related to #9417 and/or #9864

@nkolev92 nkolev92 removed this from the Backlog milestone Nov 17, 2020
@nkolev92 nkolev92 removed their assignment Nov 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category:Quality Week Issues that should be considered for quality week Functionality:Restore Priority:2 Issues for the current backlog. Product:VS.Client Style:PackageReference Type:Bug
Projects
None yet
Development

No branches or pull requests

4 participants