-
Notifications
You must be signed in to change notification settings - Fork 10.2k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
kestrel .net5 dateHeaderValues is null #28112
Comments
There were changes made to the heartbeat in 5.0 so it's definitely possible there's an issue. What's the exception you're seeing? |
@chris-kruining do you have a reliable repro? |
I wonder if this is related to using the WebHost directly vs using the generic host... My only guess is that somehow a request is being sent before the value is initially set. This shouldn't happen because we're supposed to do this during startup but clearly something else is happening here. |
cc @halter73 |
@chris-kruining If you don't have a reliable repro which would be ideal, can you provide a stacktrace for where the NullReferenceException occurs? DateHeaderValueManager should be fully initialized by the time Kestrel's Heartbeat.Start() completes here:
This is before Kestrel binds to any endpoints or processes any requests. |
https://github.com/chris-kruining/dotnet5-kestrel-issue-repro here you go I haven't removed all logic around it in the case it's my code that's wrong. |
@halter73 I was a little curious and checked the code. Here's what I found. There's an exception in
@chris-kruining This project is using kestrel nuget package with version 2.2 which depends on |
@Kahbazi Can I swap that sdk??? I am making a wpf desktop app, just need a localhost listener to handle the callback of oidc |
As far as I know it's not a problem. Using the web sdk adds the packages you need for listener which is Kestrel, but just to be sure you could wait for @davidfowl or @halter73 to give the final answer. |
@chris-kruining you don't need to change the SDK. You can just add a framework reference to ASP.NET COre: <ItemGroup>
+ <FrameworkReference Include="Microsoft.AspNetCore.App" />
- <PackageReference Include="Microsoft.AspNetCore.Server.Kestrel" Version="2.2.0" />
</ItemGroup> |
Thanks for looking @Kahbazi ! |
works like a charm! For my understanding, what is it I did wrong? because 2.2.0 is the latest version on nuget. And I feel like adding a whole framework for a single feature is a bit overkill. Is |
Wooooooooooooo
exactly the same One difference is that I try to run multiple Hosts while using <ItemGroup>
+ <FrameworkReference Include="Microsoft.AspNetCore.App" />
- <PackageReference Include="Microsoft.AspNetCore" Version="2.2.0" />
- <PackageReference Include="Microsoft.AspNetCore.Http.Connections" Version="1.1.0" />
- <PackageReference Include="Microsoft.AspNetCore.Mvc.Core" Version="2.2.5" />
</ItemGroup> |
Hi,
I've been breaking my head on this issue for 2 days now, I followed the sample on IdentityModel.OidcClient.Samples to implement a local server to handle the oidc callback page. but I keep running into the issue of a null reference exception inside kestrel itself. Having delved deeper into this issue I have identified the source to be on aspnetcore/src/Servers/Kestrel/Core/src/Internal/Http/HttpProtocol.cs:1188. Looking into the call I have a suspicion it is "simply" a racing condition. since I have modified the sample a bit I'll post it below.
It is the this line which triggers the exception
Am I just an idiot and blind for a missing
await
somewhere?Is the Heartbeat in kestrel internally broken?
Is my config of the
WebHost
correct?Thank you in advance!
The text was updated successfully, but these errors were encountered: