Skip to content

Different behaviour in comparing IPAddress.IPv6Any to IPv6None to non .Net6 frameworks  #115804

Closed as duplicate of#62072
@Maxyeah

Description

@Maxyeah

In .Net 6, comparing the System.Net.IPAddress.IPv6Any to IPAddress.IPv6None returns true.
In older versions of .Net Framework and .Net Core the result is false (IPv6Any != IPv6None).

Steps to reproduce:

Debug the following code in for example .Net Core 3.1 and .Net 6 to see the results.

            if(System.Net.IPAddress.IPv6Any == System.Net.IPAddress.IPv6None)
            {
                Console.WriteLine("IPv6Any == IPv6None");
            }
            else
            {
                Console.WriteLine("IPv6Any != IPv6None");
            }

Is this an intended change?

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-area-labelAn area label is needed to ensure this gets routed to the appropriate area owners

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions