问题
I would like to use System.Net.Ping NuGet reference in a UWP Project with ARM target. I want use Ping in Windows 10 Mobile.
I'm trying with "Install-Package System.Net.Ping -Version 4.0.0" but i get same message with lastest preview (Install-Package System.Net.Ping -Pre)
Output:
System.Net.Ping 4.0.0 provides a compile-time reference assembly for System.Net.Ping in UAP, Version = v10.0, but there is no assembly in Runtime compatible with win10-arm Line: 1 Character: 1 + Install-Package System.Net.Ping -Version 4.0.0 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [Install-Package], Exception + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand
Install-Package : One or more packages are not compatible with UAP, Version = v10.0 (win10-arm)
Same message for win10-arm-aot,win10-x64,win10-x64-aot....
Maybe, can't i use these library with ARM target?
回答1:
According to the error message, the System.Net.Ping package is not compatible with UWP app. I have tried install on a command C# Class Library project, it could install correct. And I also check the dlls contained in this package with NuGet Package Explorer, I found that there only .NET Framework 4.6 dll in this packages. Other platform folder is empty.
回答2:
System.Net.NetworkInformation.Ping class is not supported by UWP since ICMP is still not supported in UWP yet. You can use winrt-vasily as a workaround for now.
来源:https://stackoverflow.com/questions/40538754/system-net-ping-nuget-installation-error