aspnet / Tooling

Issue tracker and info on Visual Studio tooling for ASP.NET
Other
258 stars 124 forks source link

Can't restore NuGet packages from MSBuild #1042

Closed ArcanoxDragon closed 7 years ago

ArcanoxDragon commented 7 years ago

I've encountered this problem twice in the last couple days. I'm trying to work with .NET Core projects (project.json), specifically AngleSharp and its libraries. When I try and build a project from Visual Studio 2017 or through a Cakefile, I get an error from NuGet stating something along the lines of:

Invalid restore input. UAP projects must contain exactly one target framework. Input files: C:\Users\<me>\Projects\AngleSharp\src\AngleSharp\AngleSharp.Core.csproj, C:\Users\<me>\Projects\AngleSharp\src\AngleSharp\project.json.

I can't find any instance of this error anywhere on the internet, which is really frustrating. If I manually run nuget restore in Projects\AngleSharp\src\AngleSharp\, it works fine and restores all packages properly. The only version of NuGet in my PATH is 4.1.0.2450, which I just installed today. I can't figure out which version of NuGet is being run by MSBuild, but the MSBuild version that is being run is from Visual Studio 2017, which I just installed earlier this week, so it has to be a recent version of NuGet as well.

ArcanoxDragon commented 7 years ago

I just realized I was on the wrong repo when I submitted the issue. Moving to NuGet repo.

sayedihashimi commented 7 years ago

@briman0094 thanks, I was just going to comment about moving it :)

ArcanoxDragon commented 7 years ago

I have about a dozen GitHub tabs open right now, I was bound to use the wrong one eventually :P

sayedihashimi commented 7 years ago

Yeah same here.