System.Net.Ping NuGet Installation error

99封情书 提交于 2019-12-12 04:21:35

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!