GetIsNetworkAvailable() behaves differently depending on .NET version

16 hours ago 4
ARTICLE AD BOX

we have a project using following function call.

var isNetworkAvailable = NetworkInterface.GetIsNetworkAvailable();

On a Win11 LTSC (W11 IoT Enterprise LTSC) test unit with no network connection. ( Ethernet cable unplugged and Wifi not connected)

Project built with NET 8.0,  function GetIsNetworkAvailable() returns false.

Project built with NET 9.0,  function GetIsNetworkAvailable() returns true.

Here is Microsoft support's explanation on why GetIsNetworkAvailable() behaves differently depending on .NET version.

https://learn.microsoft.com/en-gb/answers/questions/5763874/getisnetworkavailable()-behaves-differently-depend

We like to keep the function behavior of NET 8.0 when building the project with NET 9.0, Is there any equivalent code to replace the function GetIsNetworkAvailable()? Thanks.

Read Entire Article