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://video2.skills-academy.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.

C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,723 questions
Windows 10 Network
Windows 10 Network
Windows 10: A Microsoft operating system that runs on personal computers and tablets.Network: A group of devices that communicate either wirelessly or via a physical connection.
2,346 questions
Not Monitored
Not Monitored
Tag not monitored by Microsoft.
39,088 questions
{count} votes

Accepted answer
  1. Tianyu Sun-MSFT 30,566 Reputation points Microsoft Vendor
    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://video2.skills-academy.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.