.Net Core 2.2 Exception 'System.Net.Internals.SocketExceptionFactory.ExtendedSocketException'
This exception is continuing to show up... Exception thrown: 'System.NotImplementedException' in System.Private.CoreLib.dll Microsoft.AspNetCore.Hosting.Internal.WebHost:Information: Request finished in 1364.9437ms 500 text/html; charset=utf-8 Exception thrown: 'System.Net.Internals.SocketExceptionFactory.ExtendedSocketException' in System.Private.CoreLib.dll Exception thrown: 'System.Net.Internals.SocketExceptionFactory.ExtendedSocketException' in System.Private.CoreLib.dll Exception thrown: 'System.Net.Internals.SocketExceptionFactory.ExtendedSocketException' in System.Private.CoreLib.dll Exception thrown: 'System.Net.Internals.SocketExceptionFactory.ExtendedSocketException' in System.Private.CoreLib.dll The thread 0x1148 has exited with code 0 (0x0). Exception thrown: 'System.Net.Internals.SocketExceptionFactory.ExtendedSocketException' in System.Private.CoreLib.dll Exception thrown: 'System.Net.Internals.SocketExceptionFactory.ExtendedSocketException' in System.Private.CoreLib.dll The thread 0x6538 has exited with code 0 (0x0). Exception thrown: 'System.Net.Internals.SocketExceptionFactory.ExtendedSocketException' in System.Private.CoreLib.dll Exception thrown: 'System.Net.Internals.SocketExceptionFactory.ExtendedSocketException' in System.Private.CoreLib.dll Exception thrown: 'System.Net.Internals.SocketExceptionFactory.ExtendedSocketException' in System.Private.CoreLib.dll Exception thrown: 'System.Net.Internals.SocketExceptionFactory.ExtendedSocketException' in System.Private.CoreLib.dll Exception thrown: 'System.Net.Internals.SocketExceptionFactory.ExtendedSocketException' in System.Private.CoreLib.dll Exception thrown: 'System.Net.Internals.SocketExceptionFactory.ExtendedSocketException' in System.Private.CoreLib.dll Exception thrown: 'System.Net.Internals.SocketExceptionFactory.ExtendedSocketException' in System.Private.CoreLib.dll Exception thrown: 'System.Net.Internals.SocketExceptionFactory.ExtendedSocketException' in System.Private.CoreLib.dll
Could you share some simle repro code @matendie ? This is not actionable without more details. Also include info about your os and general environment.
hm... I have another .NET core 2.2 API that doesn't have this issue. The problematic one is already complex enough that It will be difficult for me to figure out what triggers it. I don't think its the system, since I have another API that is not having this problem.
Let me investigate a little more before I can give you more info. Looks like its related to some other assembly I'm including, but not sure which one.
Tad
On Wed, Mar 27, 2019 at 1:46 PM Tomas Weinfurt [email protected] wrote:
Could you share some simle repro code @matendie https://github.com/matendie ? This is not actionable without more details. Also include info about your os and general environment.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/dotnet/corefx/issues/36401#issuecomment-477275887, or mute the thread https://github.com/notifications/unsubscribe-auth/AHUHs2ea2yJnhZW_Wsyz-MtzrDZnUSiHks5va66CgaJpZM4cNvPn .
I've seen this exception on Linux this past week using .NET Dns.GetHostAddressesAsync I will try to post repro code soon. It was trying to resolve a name that couldn't be resolved.
This exception is unusual. We should never be exposing System.Net.Internals.SocketExceptionFactory.ExtendedSocketException to an API caller of Socket or DNS APIs. It should have been transformed into a SocketException, for example.
Im running Windows 10 as a parallel on Mac Pro. Don't ask, not my decision, LOL. Im not sure when this exception started showing up, i just noticed it today when my call to external API failed and I used tracing to look at the stack and the request. I have some remaining nuget libs that I need to get cleared up. Some didn't do what I needed. I can give you a list of things my projects include. If that helps at all for now?
Tad
On Wed, Mar 27, 2019, 2:57 PM David Shulman [email protected] wrote:
I've seen this exception on Linux this past week using .NET Dns.GetHostAddressesAsync I will try to post repro code soon. It was trying to resolve a name that couldn't be resolved.
This exception is unusual. We should never be exposing System.Net.Internals.SocketExceptionFactory.ExtendedSocketException to an API caller of Socket or DNS APIs. It should have been transformed into a SocketException, for example.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/dotnet/corefx/issues/36401#issuecomment-477303755, or mute the thread https://github.com/notifications/unsubscribe-auth/AHUHs-Jxaw_HPfLtFziE5wqOfURz4fhSks5va78mgaJpZM4cNvPn .
Here are the included libraries in the project... Like I said, I'm not sure if its related to any of these, but if you see anything that may be a suspect, that you want me to try removing to test, let me know.
[image: image.png]
[image: image.png]
On Wed, Mar 27, 2019 at 2:57 PM David Shulman [email protected] wrote:
I've seen this exception on Linux this past week using .NET Dns.GetHostAddressesAsync I will try to post repro code soon. It was trying to resolve a name that couldn't be resolved.
This exception is unusual. We should never be exposing System.Net.Internals.SocketExceptionFactory.ExtendedSocketException to an API caller of Socket or DNS APIs. It should have been transformed into a SocketException, for example.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/dotnet/corefx/issues/36401#issuecomment-477303755, or mute the thread https://github.com/notifications/unsubscribe-auth/AHUHs-Jxaw_HPfLtFziE5wqOfURz4fhSks5va78mgaJpZM4cNvPn .
@matendie Your last message didn't include any actual screenshots. It just says "image.png". Using email-reply to GitHub issue will strip out attachments.
here is more info on what's in the project:
Library responsible to AAD Bearer Token Authentication:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Configuration" Version="2.2.0" />
<PackageReference Include="Microsoft.IdentityModel.Clients.ActiveDirectory" Version="4.5.1" />
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="5.4.0" />
</ItemGroup>
<ItemGroup>
<Reference Include="System.IdentityModel.Tokens.Jwt">
<HintPath>..\..\..\Program Files\dotnet\sdk\NuGetFallbackFolder\system.identitymodel.tokens.jwt\5.2.0\lib\netstandard1.4\System.IdentityModel.Tokens.Jwt.dll</HintPath>
</Reference>
</ItemGroup>
</Project>
API that gets called from outside and calls other external APIs:
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<UserSecretsId>guid</UserSecretsId>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="Microsoft.AspNetCore.Razor.Design" Version="2.2.0" PrivateAssets="All" />
<PackageReference Include="Microsoft.Extensions.DiagnosticAdapter" Version="2.2.0" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="2.2.3" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="4.0.1" />
<PackageReference Include="System.Configuration.ConfigurationManager" Version="4.5.0" />
<PackageReference Include="System.Diagnostics.DiagnosticSource" Version="4.5.1" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Custom.ADAuthentication.Provider\Custom.ADAuthentication.Provider.csproj" />
<ProjectReference Include="..\Custom.projectDataLayer.Service\Custom.projectDataLayer.Service.csproj" />
</ItemGroup>
<ItemGroup>
<Folder Include="Swagger\" />
</ItemGroup>
<ItemGroup>
<Reference Include="HibernatingRhinos.Profiler.Appender">
<HintPath>..\..\..\Users\username\Downloads\EntityFramework.Profiler-v5.0-Build-5032\Appender\net46\HibernatingRhinos.Profiler.Appender.dll</HintPath>
</Reference>
</ItemGroup>
</Project>
Data Layer EF specific :
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="2.2.2" />
</ItemGroup>
<ItemGroup>
<Folder Include="Command\" />
</ItemGroup>
</Project>
I did have a custom library but I removed it since I didn't need it: https://github.com/hanssens/localstorage
@davidsh do you have suggestions for next steps?
@davidsh do you have suggestions for next steps?
Next step is for us to reproduce the problem and see where this weird exception is coming from.
I'm looking in to this again... I switched over from VS2017 Pro to VS 2019 Pro and the exception is no longer showing in output window. If I open it back in VS2017 Pro exception shows back up again
Exception thrown: 'System.Net.Internals.SocketExceptionFactory.ExtendedSocketException' in System.Private.CoreLib.dll
Exception thrown: 'System.Net.Internals.SocketExceptionFactory.ExtendedSocketException' in System.Private.CoreLib.dll
Exception thrown: 'System.Net.Internals.SocketExceptionFactory.ExtendedSocketException' in System.Private.CoreLib.dll
Exception thrown: 'System.Net.Internals.SocketExceptionFactory.ExtendedSocketException' in System.Private.CoreLib.dll
I'm not sure what the debugger difference is between the two VS versions, could new one be hiding it, or is the old one causing it?
No Idea.
There should be no difference in the same .NET Core 2.2 version behavior in one VS or another, or outside. Can you please run it outside of VS? I would also recommend trying older VS 2017 in a brand new VM with fresh installation to avoid some corrupted install /config problems.
I'm not sure how to run it outside of VS and have visibility to exceptions thrown... I published this API to Azure and I don't see any exceptions thrown in Application Insights. Maybe this is a VS 2017 issue?
You can try to isolate it and move it outside of ASP.NET Core first. Or you can try to create repro on brand new VM (fresh install).
Rather than VS 2017 issue, it is more likely to be some weird environment setting / debugging setting in your VS. I recommend to not chase it down, unless you have something actionable - you may opt in to debug the exception and find out what triggered it. Closing for now, feel free to reopen if there is anything actionable for us. Thanks!
Ok will do, thank you!
On Mon, Apr 29, 2019, 12:08 PM Karel Zikmund [email protected] wrote:
You can try to isolate it and move it outside of ASP.NET Core first. Or you can try to create repro on brand new VM (fresh install).
Rather than VS 2017 issue, it is more likely to be some weird environment setting / debugging setting in your VS. I recommend to not chase it down, unless you have something actionable - you may opt in to debug the exception and find out what triggered it. Closing for now, feel free to reopen if there is anything actionable for us. Thansk!
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/dotnet/corefx/issues/36401#issuecomment-487641127, or mute the thread https://github.com/notifications/unsubscribe-auth/AB2QPM7COZONRJIVBCAVFGDPS4MPFANCNFSM4HBW6PTQ .
I have the same issue, it does not provide much information for troubleshooting.
can you isolate simple corefx repro @lhsomoza notes here are not actionable so far.
Ran into this problem as well. I see
Exception thrown: 'System.Net.Internals.SocketExceptionFactory.ExtendedSocketException' in System.Private.CoreLib.dll
in the VS 2019 debug output, and my console application exits with status 0. This exception goes around my try-catch blocks, nothing reported in the event viewer, seems downright impossible to debug. This is on Core 3.1.
UPDATE: my issue was back-to-back NetworkStream.WriteAsync and NetworkStream.ReadAsync - I wanted to say something to the server and get response. Adding 100ms delay prevents the problem. I am not happy with this solution, so I will keep looking into the right way to do this, but at least I know what's causing the silent crash.
await _stream!.WriteMessageAsync(request, cancellationToken, _client!.SendBufferSize)
.ConfigureAwait(false);
Thread.Sleep(100);
return await GetResponseAsync(cancellationToken)
.ConfigureAwait(false);