IApplicationBuilder does not includes a definition for UseHealthChecks


#1

Hi, I’m very new with Kbernetes and this stuff.
I try to include a health check in my .NET Core WebApi.
I copy the lines I find at the tutorials in my code and get a error:
The error says: IApplicationBuilder does not includes a definition for UseHealthChecks
What is the problem in my code? I guess it is not about Kubernetes, more about C#, but still I don’t know how to manage this.
Would be lovely to get help.
Frank
health


#2

Yeah, this is strictly not kubernetes. Just your code not compiling.

It seems app is of Type IApplicationBuilder and doesn’t have that method. I don’t use C#, but it should be trivial. Look at it harder and it you will probably solve it :slight_smile:


#3

Your succestion does not realy help.


#4

Sorry, I really don’t know C#…

I can tell you from that is that is not kubernetes, but the application. It’s a C# problem. I hope that helps to narrow it down a little bit.

If not, maybe others can help. Or you can post in some C# specific mailing list. I really don’t know what else to tell you, honestly.


#5

I add the NuGet package

Microsoft.AspNetCore.Diagnostics.HealthChecks 2.2.0

and there for also and first

Microsoft.AspNetCore.Http.Features 2.2.0
Microsoft.AspNetCore.Http.Abstractions 2.2.0
Microsoft.Net.Http.headers 2.2.0

Now the method is known.