How to place SomeSettings.json in RCL project so that it can be consumed by Configuration of consuming projects
I have a strategy to share App.razor from RCL project with Blazor hosing apps like Blazor Webassembly standalone app as a front-end app and Blazor hybrid apps as native apps.
I would like place all together into a RCL project(RCL) including appsettings.json file so put it in RCL/wwwroot/appsettings.json setting as Content and Copy.
Building RCL project moved it in /bin/.../wwwroot/appsettings.json.
I added Blazor Webassembly standalone app(Wasm project) into the solution, set up project reference to RCL, removed its own appsettings.json and all razor files, change Wasm.Program.cs as below:
builder.RootComponents.Add<RCL.App>("#app");
builder.RootComponents.Add<HeadOutlet>("head::after");
After bulding the solution, I have also checked RCL's appsettings.json is placed in Wasm/bin/../wwwroot/.
However, the problem is the file was not included in the configuraiton.
So, I tried adding this line in Wasm.Program but it wouldn't work.
builder.Configuration.AddJsonFile("_content/RCL/appsettings.json");
// or
// builder.Configuration.AddJsonFile("/appsettings.json");
tried also this in Wasm/wwwroot/index.html to see if the file is downloaded to browser cache but to fail.
<head>
<link rel="import" href="_content/RCL/appsettings.json"/>
How can I achieve my goal?