proudmonkey / ApiBoilerPlate

A simple yet organized project template for building ASP.NET Core APIs in .NET Core 3.1
MIT License
361 stars 77 forks source link

HealthCheck 3.1.3: Change services.AddHealthChecksUI() to services.AddHealthChecksUI().AddInMemoryStorage() #22

Open biapar opened 3 years ago

biapar commented 3 years ago

If you upgrade HealthCheck to 3.1.3

you have to change the class class RegisterHealthChecks : IServiceRegistration

string DbConnectionString = config.GetConnectionString("HealthCheckDatabaseConnectionString"); services.AddHealthChecksUI().AddInMemoryStorage(); //.AddSqliteStorage(DbConnectionString);

improwise commented 3 years ago

Is the DB file actually ever used? Can't see that HealthCheckDatabaseConnectionString is ever used (but still cause an error if left remaining in the appsettings.json, so maybe its some indirect loading).

biapar commented 3 years ago

The HealthCheckDatabaseConnectionString was the original.

improwise commented 3 years ago

Yes, but it does not seem to be used in the original code?

https://github.com/proudmonkey/ApiBoilerPlate/blob/master/ApiBoilerPlate/Infrastructure/Installers/RegisterHealthChecks.cs

Edit:

Seems like the DB is created on startup if it does not exist using the HealthCheckDatabaseConnectionString, if not present in appsettings, default name will be used. Probably nothing specific for this project though.