Helper library with common infrastructure code for our distributed apps
- Install via NuGet:
Install-Package ProReception.DistributionServerInfrastructure - Add custom settings:
- Create new class for storing your settings, which inherits from
BaseSettingsusing DistributionServerInfrastructure.Settings.Models; public class MySettings : BaseSettings { }
- Create new
ISettingsManagerinterface, which inherits fromISettingsManagerBaseusing DistributionServerInfrastructure.Settings; public interface ISettingsManager : ISettingsManagerBase { }
- Create new
SettingsManagerclass, which inherits fromSettingsManagerBaseand implementsISettingsManagerusing DistributionServerInfrastructure.Settings; public class SettingsManager : SettingsManagerBase<MySettings>, ISettingsManager { public SettingsManager(string appName, string cryptKey, string authKey) : base(appName, cryptKey, authKey) { } }
- Create new class for storing your settings, which inherits from
- In your
Program.csfile, create a new instance of yourSettingsManagerclass, and add the infrastructure configurationvar settingsManager = new SettingsManager( "My App Name", "some crypt key", "some auth key"); builder.AddProReceptionDistributionServerInfrastructure<ISettingsManager, SettingsManager>(settingsManager);
- Use the infrastructure config after building the app:
app.UseProReceptionDistributionServerInfrastructure();
These are the expected configuration values.
There has to be a section in the configuration called ProReceptionApi:
{
"ProReceptionApi": {
"BaseUrl": "https://localhost:7016"
}
}The components can be used inside your Razor views.
@using ProReception.DistributionServerInfrastructure.Components
<ProReceptionConnection />@using ProReception.DistributionServerInfrastructure.Components
<Logs />There is an issue when using MudBlazor from an app running as a Windows Service. See my question on StackOverflow here.
So, my work around is to host the MudBlazor CSS and JS files on Azure storage, and load them from there. This means that every time I update the MudBlazor library, I also need to add the new CSS and JS files to the Azure storage.
To get the CSS and JS files for a specific version, I create a new app, and then copy the files when the app is running.
dotnet new install MudBlazor.Templates
mkdir -p mud-test/MyApplication
dotnet new mudblazor --interactivity Server --name MyApplication --all-interactive --output mud-test/MyApplication
dotnet new sln -n MyApp -o mud-test
dotnet sln mud-test/MyApp.sln add mud-test/MyApplication/MyApplication.csproj