CodeSharePaul
09/17/2021, 7:47 PMCodeSharePaul
09/17/2021, 7:51 PMCodeSharePaul
09/17/2021, 10:21 PMKevin Jump
09/20/2021, 6:20 PMKevin Jump
09/20/2021, 6:21 PM/umbraco/config/appsettings-schema.json
Kevin Jump
09/20/2021, 6:21 PMKevin Jump
09/20/2021, 6:22 PM"uSync": {
"$ref": "../../App_Plugins/uSync/config/appsettings-usync-schema.json#/definitions/uSync"
}
Kevin Jump
09/20/2021, 6:22 PMKevin Jump
09/20/2021, 6:23 PMKevin Jump
09/20/2021, 6:24 PMSebastiaan
09/20/2021, 6:32 PMKevin Jump
09/20/2021, 6:34 PMWarren Buckley
09/20/2021, 7:15 PMWarren Buckley
09/20/2021, 7:22 PMuSync.development.json
and usync.production.json
files that you add as additional files to load/read from
Then those separate files can have their own JSON schema without worrying about ours.
https://docs.microsoft.com/en-us/dotnet/core/extensions/configuration-providers#json-configuration-providerKevin Jump
09/20/2021, 7:47 PMKevin Jump
09/20/2021, 7:50 PMWarren Buckley
09/20/2021, 7:54 PMRichard Soeteman
09/21/2021, 6:33 AMskttl
09/21/2021, 6:39 AM$schema
in your json, but comment out "inactive" ones? like
{
"$schema": "https://json.schemastore.org/appsettings.json",
// "$schema": "https://usync.org/appsettings.json",
// "$schema": "https://doctypegrideditor.skttl.dk/appsettings.json",
skttl
09/21/2021, 6:41 AMKevin Jump
09/21/2021, 7:03 AMRichard Soeteman
09/21/2021, 7:04 AMRichard Soeteman
09/21/2021, 7:05 AMKevin Jump
09/21/2021, 7:08 AMWarren Buckley
09/21/2021, 10:25 AMWarren Buckley
09/21/2021, 12:00 PMusing Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
[assembly: HostingStartup(typeof(MyAwesomePackage.MyPackageConfig))]
namespace MyAwesomePackage
{
public class MyPackageConfig : IHostingStartup
{
public void Configure(IWebHostBuilder builder)
{
builder.ConfigureAppConfiguration((ctx, config) =>
{
var env = ctx.HostingEnvironment;
config.AddJsonFile("mypackage.json", optional: true, reloadOnChange: true)
.AddJsonFile($"mypackage.{env.EnvironmentName}.json", optional: true, reloadOnChange: true);
});
}
}
}
But the problem is that .NET does not auto scan all assemblies. You have to use/update ENV variable
"ASPNETCORE_HOSTINGSTARTUPASSEMBLIES": "MyAwesomePackage;"
Still poking around but not sure setting an ENV variable gonna be much nicer/friendlier than what we have.
Currently trying to see how/if other libraries use this approachRichard Soeteman
09/21/2021, 1:23 PMMatt Wise
09/21/2021, 1:24 PMRichard Soeteman
09/21/2021, 1:30 PMsoren7885
09/21/2021, 1:31 PM