Hi Radek
Thank you for your answer. I forgot to mention, we use .NET 5 and Kentico version v13.0.8.
I followed the documentation (.NET 5 version) and I still can't figure out what I'm doing wrong.
I ran the following commands:
* dotnet user-secrets init
* dotnet user-secrets set "*** see CMSConnectionString setting below ***"
This is my secrets.json structure:
{
"CacheConnection": "---redis.cache.windows.net,abortConnect=false,ssl=true,password=---",
"ConnectionStrings:CMSConnectionString": "Data Source=---.database.windows.net,1433;Initial Catalog=---;Integrated Security=False;Persist Security Info=False;User ID=---;Password=---;Connect Timeout=60;Encrypt=False;Current Language=English;"
}
The project file contains a reference to my secrets ID:
I am using the default builder (I a not calling builder.AddUserSecrets):
public static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
.ConfigureWebHostDefaults(webBuilder =>
{
webBuilder.UseStartup Startup();
});
The following Kentico features are used:
features.UsePageBuilder();
features.UsePageRouting();
In the MS documentation they show you how to read the configuration, which I am not trying to do as I expect it is already done (unsuccessfully) by Kentico.
If I take the connection string out of the secrets file and put it in the appsettings file everything works as expected.
I know that Kentico is not officially tested with .NET 5. Could that be the issue? What other information can I provide?
Thank you!
Noam.