Skip to content

System.Net.IPNetwork - not working #95321

@suchoss

Description

@suchoss

Description

System.Net.IPNetwork seems to be broken. It doesn`t work and always throws an exception: "System.FormatException: An invalid IP network was specified."

Reproduction Steps

//this IPNetwork works
var works = Microsoft.AspNetCore.HttpOverrides.IPNetwork.Parse("192.168.1.1/24");
//this IPNetwork doesnt work
var doesntWork = System.Net.IPNetwork.Parse("192.168.1.1/24");

Expected behavior

I would expect that this wont throw any exception var doesntWork = System.Net.IPNetwork.Parse("192.168.1.1/24");

Actual behavior

I am getting System.FormatException: An invalid IP network was specified. exception. And I am confused how to use this System.Net.IPNetwork

Regression?

No response

Known Workarounds

No response

Configuration

dotnet 8.0.100
Apple M1 Pro
macOS 14.1.1

But we tested it even on windows machine and we are getting the same results.

Other information

When I tried to step into (limited functionality on MacOS) i found this issue The specified baseAddress has non-zero bits after the network prefix. (Parameter 'baseAddress')

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions