-
Notifications
You must be signed in to change notification settings - Fork 252
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 can't restore packages from new csproj format #4809
Comments
@Kralizek can you share a solution that repros this? I'm not sure how this could happen. |
Attached is a solution that I created via console. I also included the nuget.exe file I am using.
|
Am I the only one having this issue? |
I'm seeing this as well on a project that was migrated. using Msbuild restore gives the same output you have above but no drop is created when the build is ran on TFS. |
@Kralizek I'm not able to repro this. @jrc60752 does restore create the obj\project.assets.json file for you? |
@emgarten I'll check during the weekend (just posted to avoid the issue to be closed due to inactivity) |
@emgarten I can confirm it worked on my home computer. Would you please guide me troubleshooting the issue on my office computer? |
I suppose the problem is that NuGet uses MSBuild from Build Tools rather than any full VS edition. As the former doesn't have .NET Core SDK bundled within it. |
NuGet.exe should bring it's own targets needed for reading projects, but it is possible that the project relies on something else from the SDK that isn't being loaded by MSBuild. |
I was receiving the same error as @Kralizek on my build server (trying to setup TeamCity). Installing VS Community and restarting resolved the issue. Same build -- Just reran. |
@emgarten is it possible to tell nuget.exe to pick up a specific msbuild using a environment variable if a that msbuild version works here? |
NuGet.exe will use msbuild.exe from |
This started happening to me when I installed the .Net Core 2.0 sdk and upgraded VS to 15.3. My current solution I'm trying to build targets .Net Core 1.1. The nuget restore command is not installing my nuget references from my projects with PackageReference(s) in them. However I can build the solution in Visual Studio with no issues. When I restore using VS I do see the obj/projects.assets.json file. However if I just run a nuget restore solution.sln I do not get an obj/projects.assets.json file and the message is "Nothing to do. None of the projects in this solution specify any packages for NuGet to restore." |
This issue should be resolved in nuget.exe 4.3.0 If anyone is still hitting this with the latest bits please open a new issue with details repro steps. |
The dotnet core update breaks nuget restores (as in, nuget doesn't know how to restore PackageReference projects, see NuGet/Home#4809) I tried newer versions of nuget but no luck, something is still really broken. msbuild knows how, though, so use that to restore things. Also, clean up some backup files that should not have been committed, make sure all builds use VS2017 on appveyor, and make cloning faster there.
Details about Problem
NuGet product used (NuGet.exe | VS UI | Package Manager Console | dotnet.exe): nuget.exe
NuGet version (x.x.x.xxx): 4.0.0.2283
dotnet.exe --version (if appropriate): 1.0.1
OS version: Windows 10 14393.693
Worked before? If so, with which NuGet version:
Detailed repro steps so we can see the same problem
In the solution root folder
dotnet restore
✔️ solution's packages are correctly restoredmsbuild /t:Restore
✔️ solution's packages are correctly restored.\nuget.exe restore .\Solution.sln
=>Nothing to do.
Verbose Logs
The text was updated successfully, but these errors were encountered: