Cordova app for Windows, NuGet fails to get correct version of System.Collections.Specialized - nuget

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

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.

Related

Visual Studio 2019 connection problem to NuGet

I reinstalled (clean) Visual Studio 2019 (Microsoft Visual Studio Community 2019 Version 16.8.5) and I get error when I try to clean solution, it complains about connection to https://api.nuget.org/v3/index.json.
When I copy paste the link to web browser I see all the packages but VS cannot reach any package.
When I rebuild I get all this error: 'obj\project.assets.json' not found. Run a NuGet package restore to generate this file.
Then I do from NuGet Console > dotnet restore and I get error:
PM> dotnet restore
Determining projects to restore...
C:\Program Files\dotnet\sdk\5.0.103\NuGet.targets(131,5): error : Unable to load the service index for source https://api.nuget.org/v3/index.json. [C:\Program Files (x86)\Microsoft V
isual Studio\2019\Community\MyProjects2019\source\repos\Bank\Bank.sln]
C:\Program Files\dotnet\sdk\5.0.103\NuGet.targets(131,5): error : The SSL connection could not be established, see inner exception. [C:\Program Files (x86)\Microsoft Visual Studio\
2019\Community\MyProjects2019\source\repos\Bank\Bank.sln]
C:\Program Files\dotnet\sdk\5.0.103\NuGet.targets(131,5): error : The remote certificate is invalid because of errors in the certificate chain: UntrustedRoot [C:\Program Files (x86
)\Microsoft Visual Studio\2019\Community\MyProjects2019\source\repos\Bank\Bank.sln]
PM>
I have been trying for 4 days to resolve this problem without success, any help, any tips.
Thanks

Visual Studio Code macOS: error loading OmniSharp: spawn EACCES

I'm having no luck in trying to make the C# extension work in macOS. When loading the sln file everything seems to load just fine other than OmniSharp. This makes it hard or impossible to work with Visual Studio Code.
Here's the error I get:
Starting OmniSharp server at 2018-5-4 13:51:51
Target: /PATH/TO/PROJECT/Project.sln
[ERROR] Error: spawn EACCES
Which tells very little about what's wrong.
I followed all instructions found here, including installing Mono SDK but OmniSharp keeps giving this error. I also tried
to install the extension from a vsix file
to overwrite the omnisharp folder content with what I found here
All leading to the same error.
When the extension is freshly installed, it automatically downloads the OmniSharp package and successfully installs it.
Installing C# dependencies...
Platform: darwin, x86_64
Downloading package 'OmniSharp for OSX' (24026 KB) .................... Done!
Downloading package '.NET Core Debugger (macOS / x64)' (44057 KB) .................... Done!
Installing package 'OmniSharp for OSX'
Installing package '.NET Core Debugger (macOS / x64)'
Finished
Someone suggests to add a+x permissions recursively to the whole project folder (as found in this official thread) but is this really necessary? All files in extensions belong to the same staff group as all files in the project do.
I tried this anyway but still [ERROR] Error: spawn EACCES
I'm using Visual Studio Code 1.23.0 and the OmniSharp's version is 1.14.0.
I should also say that all projects I am trying to open are generated by Unity 3D and I have the Unity Debug extension installed.
I don't know where else to go from here. Would someone be able to give advice on this?

UWP Deployment Microsoft.NET.Native.Runtime.1.7 not found error

I have recently installed a few updates to windows / visual studio 2017, and now when I create a package of my UWP app and try deploying it to any of the machine where it used to work just fine - installation fails and there is this error message in windows error log:
AppX Deployment operation failed for package 92211ab1-5481-4a1a-9111-a3dd87b81b72_1.0.26.0_neutral_~_n78qa84z3g9aj with error 0x80073CF3. The specific error text for this failure is: Windows cannot install package 92211ab1-5481-4a1a-9111-a3dd87b81b72_1.0.26.0_x86__n78qa84z3g9aj because this package depends on a framework that could not be found. Provide the framework "Microsoft.NET.Native.Runtime.1.7" published by "CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US", with neutral or x86 processor architecture and minimum version 1.7.25531.0, along with this package to install. The frameworks with name "Microsoft.NET.Native.Runtime.1.7" currently installed are: {}
I can not find any reference on the web for this package.
The package installs just fine on the developement machine.
Any help would be greatly appreciated.
EDIT 1:
Screenshot of my dependencies folder below:
UWP Deployment Microsoft.NET.Native.Runtime.1.7 not found
The problem is that there is no Microsoft.NET.Native.Runtime.1.7 dependence in current OS system. And you could install Microsoft.NET.Native.Runtime.1.7 dependence manually.
The Microsoft.NET.Native.Runtime.1.7 dependence will be stored in the Dependencies folder where under the appx folder.
Update1
I have checked your screenshot. It seems that you generate your package in debug mode and I can reproduce the same dependency in this way. The .NET Native tool chain is checked by default in the release mode. So you could regenerate your package in release mode to get files above.
Looks like these dependencies only appear on a Release build, and not in Debug.

Cannot install FsLab with NuGet

Complete VS noob. Fresh install of Visual Studio Community 2015. New project. Trying to install FsLab with NuGet ends with this error:
Unable to find a version of 'Deedle' that is compatible with 'FsLab 1.0.2 constraint: Deedle (= 1.2.5)'
When I search for Deedle the version that NuGet shows is v1.2.5.
I suspect this is a NuGet problem after reading about some issues with its dependency resolution management.
I tried installing Deedle separately and setting NuGet's Dependency behavior to Highest with no luck. In the end I installed Paket which worked with no problems. No time to debug this further for now.

NuGet restore during first asp.net vNext project

Today I installed ASP.NET 5 on windows and begun creating my first application in Visual Studio 2015.
When the project loads I get an error: "Package restore failed", specifically the following error:
Restore failed Det gick inte att hitta en del av s�kv�gen C:\Users\h\.dnx\packages\Microsoft.Win32.Primitives\4.0.0\Microsoft.Win32.Primitives.4.0.0.nupkg.sha512. NuGet Config files used:
C:\Users\h\AppData\Roaming\NuGet\nuget.config
C:\Users\h\documents\visual studio 2015\Projects\NextTest\nuget.config
Feeds used:
https://api.nuget.org/v3-flatcontainer/
C:\Program Files (x86)\Microsoft Web Tools\DNU
When I look for the missing file I find the following path missing:
C:\Users\h\.dnx\packages\Microsoft.Win32.Primitives\4.0.0\Microsoft.Win32.Primitives.4.0.0.nupkg.sha512
But this one exists, note the extra 0 in the version:
C:\Users\h\.dnx\packages\Microsoft.Win32.Primitives\4.0.0.0\Microsoft.Win32.Primitives.4.0.0.0.nupkg.sha512
How would I go about to solve this?
I've tried to search through the project files but no mention of neither Primitives nor verion 4.0.0.
The "Solution DNX SDK version" is 1.0.0-beta8, (beta5 was also available but not selected).
Delete C:\Users\h.dnx\packages folder and try running "dnu restore" command.