Open iskiselev opened 6 years ago
I looked in to your sample solution and found that you're using both project.json
file and PackageReference
in .vcxproj
which is not supported. So you should manage all your NuGet dependencies through project.json file.
With only project.json file, I was able to restore via msbuild or VS.
Sorry for not fully correct example. I've just updated it - please check it from original repo. Looks like adding to solution any PackageReference
based project is trigger for a problem.
So, I've removed PackageReference
from .vcxproj
- it now use only project.json
, but I've added SDK-based netstandard2.0 library, and problem is reproducible again.
BTW, I found that only "Any CPU" platform for .vcxproj
results in issue. I've started using "All CPU" platform for .vcxproj
and it solved problem for me - but still there is some bug in Nuget/Visual Studio.
Details about Problem
NuGet product used (NuGet.exe | VS UI | Package Manager Console | dotnet.exe): VS UI NuGet version (x.x.x.xxx): 4.5.0 VS version (if appropriate): 15.5.0 OS version (i.e. win10 v1607 (14393.321)): win 10 v 1709 (16299.64) Worked before? If so, with which NuGet version: No
Detailed repro steps so we can see the same problem
When non-standart platform is used in vcxproj with project.json, Nuget crash throws exception on build:
Any project (PackageReference/projec.json based) that should be restored after exception are not restored.
Sample Project
https://github.com/iskiselev/NuGetIssueExample Problem is reproducible on AnyCPU build. A little background information: I'm trying to create CPP project with both x86/x64 compilation on same build. Additional notice: When this config loaded, if Solution Explorer switched to "Show All Files", it shows root of drive instead.