1

I'm tearing my hair out trying to build a windows app using Cordova. The build error I'm getting is:

C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\
MSBuild\Microsoft\NuGet\15.0\Microsoft.NuGet.targets(377, 5):
error : The package System.Collections.Specialized with version 4.0.0 
could not be found in C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\. 
Run a NuGet package restore to download the package. 
[C:\cygwin64\home\Owner\src\apps\mytestapp- 
gen\platforms\windows\CordovaApp.Windows10.jsproj]

In visual studio, I attempt to add the version of the package to the project and I get the following error:

Severity  Code    Description Project File    Line    Suppression State
Error     Could not install package 'System.Collections.Specialized 
4.0.0'. You are trying to install this package into a project that targets 
'native,Version=v0.0', but the package does not contain any assembly 
references or content files that are compatible with that framework. For 
more information, contact the package author.

Can anyone advise how to resolve this?

I've looked at this very old question How can I make my managed NuGet package support C++/CLI projects? but I can't find anything (particually from the VS2017 era) that helps

LukeW
  • 23
  • 1
  • 4
  • My installation details are: Microsoft Visual Studio Community 2017 Version 15.8.7 VisualStudio.15.Release/15.8.7+28010.2046 Microsoft .NET Framework Version 4.7.03056 Installed Version: Community ASP.NET and Web Tools 2017 15.8.05085.0 ASP.NET and Web Tools 2017 C# Tools 2.9.0-beta8-63208-01 C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used. – LukeW Nov 03 '18 at 19:54
  • JavaScript Language Service 2.0 JavaScript Language Service JavaScript Project System 2.0 JavaScript Project System NuGet Package Manager 4.6.0 NuGet Package Manager in Visual Studio. For more information about NuGet, visit http://docs.nuget.org/. Visual Studio Tools for Apache Cordova 15.123.7408.1 Visual Studio Tools for Apache Cordova Visual Studio Tools for Universal Windows Apps 15.0.28010.2046 – LukeW Nov 03 '18 at 19:56
  • I'm facing the exact same issue. – Igor Silva Dec 11 '18 at 11:31
  • Having the same issue ... – regnete Jun 24 '20 at 12:10

1 Answers1

0

May be, this helps others to solve the issue:

My Visual Studio 2017 installation must obviously have been damaged when removing the Visual Studio 2015 installation from that same machine. After I performed a repair of Visual Studio 2017 via Visual Studio Installer the isuue disappeared.

regnete
  • 136
  • 3