c#: IPAddress.IsLoopback() treating 255.255.255.255 as Loopback IP

Darsi, Sanjay Kumar 41 Reputation points
2020-08-28T08:42:43.397+00:00

Hi Team,
Need some help. i am new to network coding. I am using the below code:

if (IPAddress.IsLoopback(statusMessage.IPAddress))
{
TraceLogger.Debug("DBG:: Loopback IP so returning...");
return;
}

The Code build using visual studio 2017, treating the IP Address 255.255.255.255 as not a Loopback address.
The Code build using visual studio 2012, treating the IP Address 255.255.255.255 as Loopback address.

Any suggestions to resolve this.

As per the article(https://learn.microsoft.com/en-us/dotnet/api/system.net.ipaddress.isloopback?view=netcore-3.1), loopback ip address range is 127.0.0.0 – 127.255.255.255.

Then why 255.255.255.255 is treating as Loopback address.

Regards,
Sanjay.

Windows for business | Windows Client for IT Pros | Networking | Network connectivity and file sharing
Developer technologies | C++
Community Center | Not monitored
{count} votes

Accepted answer
  1. Tianyu Sun-MSFT 34,456 Reputation points Microsoft External Staff
    2020-08-28T09:49:07.637+00:00

    Hello Darsi,

    Visual C# is not currently supported in the Microsoft Q&A forums, the supported products are listed over there: https://learn.microsoft.com/en-us/answers/products/ (more to be added later on).

    For the related questions about Visual C# you can post in dedicated forums here: MSDN (Visual C#).

    Best Regards,
    Tianyu

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.