-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[dotnet-sdk-9.0.100-preview.4.24253.11] IPInterfaceProperties.GatewayAddresses. FirstOrDefault() returns Null #101710
Comments
Is it null, or is it empty? With your use of |
This is likely outcome of #100824 cc: @MojtabaTajik |
We verified this issue with the latest Preview 4 validation build #dotnet-sdk-9.0.100-preview.4.24253.11, this issue also reproduced. @stephentoub @wfurt Could you please help confirm if this issue is a blocker for Preview 4? Thanks you. |
From the picture it seems like it is returning empty collection, right? And are both pictures on the same interface? What is corresponding |
The code above is problematic IMHO even on 8.0 foreach (NetworkInterface n in NetworkInterface.GetAllNetworkInterfaces())
{
var ipp = n.GetIPProperties();
Console.WriteLine("{0}: {1} {2} {3}", n.Name, ipp.GatewayAddresses.Count, ipp.GatewayAddresses.FirstOrDefault(), ipp.GatewayAddresses.FirstOrDefault() == null);
} will produce this output for me
attempt to dereference same code on 9.0 (9.0.0-preview.5.24256.1)
That is LOT of interfaces. And some will throw when attempting IPv6 properties (and perhaps more) It seems like we made it more difficult to use it (showing all Windows internals) for supporting corner case (e.g. disabled interfaces) any thoughts on this @stephentoub and @dotnet/ncl ? |
Yes, you are right. we have updated the title .
Yes, The both pictures on the same interface.
you can refer to the devdiv bug to get ipconfig details info if you need |
@wfurt Any update for this issue? The validation window for Preview4 is until 5/16, could you please help confirm whether it is a blocker for .NET 9 Preview4? Thank you very much. |
what is the failing interface @Junjun-zhao? And are other propertied set? Just look at it ion the debugger. |
or at least run the code fragment above and share results here or on the internal issue. |
Sure. Do you mean this code fragment above mentioned?
|
yes. |
@wfurt We have updated the repro machine information under Internal bug, please let us know if any more information needed. Thanks. |
@wfurt Thanks for looking into this issue. Is there any update? This issue also reproduces on the latest dotnet-sdk-9.0.100-preview.6.24274.13. |
we tried to reproduce it with @ManickaP and we could not. Could you share access to your machine or perhaps create Azure VM for investigation? There seems to be something unique in your setup. |
I was using Win 11 DevBox in Azure. I can share more details about that machine if you want. |
Thank you @wfurt @ManickaP . We had provided a reproducing machine for you. Please refer to the access info from Internal bug, And You can also share the access info about this Win 11 DevBox machine in the internal bug, we can try to reproduce on it. |
@wfurt Could you please help confirm which release build will consume this fix? We verified with preview 5 latest build dotnet-sdk-9.0.100-preview.5.24305.12, it is still repro. |
It will be in next public preview 6 for sure. I did look at current daily builds (.version file)
that commit is (barely) older than ead1d5c that fix the issue. I have no visibility to when SDK will pick up dated runtime again. But it seems like there is no build yet with the fix. |
Verified with dotnet-sdk-9.0.100-preview.6.24307.18, this issue has been fixed. |
Description
when we run OpenNetMeter app with 9.0.100-preview.5.24227.1 or higher version. It will show error: GatewayAddresses is NULL.
Application Name: OpenNetMeter
OS:Windows 10 21H2
CPU:AMD64
.NET Build Number: dotnet-sdk-9.0.100-preview.5.24227.1
App or source Location checking at: https://devdiv.visualstudio.com/DevDiv/_workitems/edit/2049203
Github Link: https://github.com/Ashfaaq18/OpenNetMeter
Reproduction Steps
Test Steps for the Application:
1.Launch app from folder “OpenNetMeter.exe".
Expected Result: Show detailed data service successfully.
Actual Result: App is in Disconnected State, nothing appears.
Minimal Repro steps:(Demo AttachedConsoleApp12.zip)
1)Create .NET Console App
2) Add this code
Expected behavior
App run successfully without error.
Actual behavior
Show error: GatewayAddresses returns NULL
Regression?
Yes
Verify Scenarios:
1). Windows 10 21H2 AMD64 + dotnet-sdk-9.0.100-preview.5.24227.1: Fail
2). Windows 10 21H2 AMD64 + dotnet-sdk-9.0.100-preview.4.24223.3: Pass
3). Windows 10 21H2 AMD64 + dotnet-sdk-8.0.300-win-x64: Pass
4). Windows 10 21H2 AMD64 + dotnet-sdk- 7.0.306-win-x64: Pass
5). Windows 10 21H2 AMD64 + dotnet-sdk-6.0.422-win-x64: Pass
6). Windows 10 21H2 AMD64 + dotnet-sdk-9.0.100-preview.4.24253.11: Fail
Did it work in .NET Framework?
Yes
Known Workarounds
No response
Configuration
dotnet info:
Other information
Finding:
After debugging the app, we find out that IPInterfaceProperties.GatewayAddresses Property returns NULL, app stays in Disconneted State , in earlier Runtimes, we get value of GatewayAddresses
@dotnet-actwx-bot @dotnet/compat
The text was updated successfully, but these errors were encountered: