PC.MobileTools.AppSettings
1.0.16
dotnet add package PC.MobileTools.AppSettings --version 1.0.16
NuGet\Install-Package PC.MobileTools.AppSettings -Version 1.0.16
<PackageReference Include="PC.MobileTools.AppSettings" Version="1.0.16" />
paket add PC.MobileTools.AppSettings --version 1.0.16
#r "nuget: PC.MobileTools.AppSettings, 1.0.16"
// Install PC.MobileTools.AppSettings as a Cake Addin #addin nuget:?package=PC.MobileTools.AppSettings&version=1.0.16 // Install PC.MobileTools.AppSettings as a Cake Tool #tool nuget:?package=PC.MobileTools.AppSettings&version=1.0.16
PC.MobileTools.AppSettings
The package helps developers for generating a configuration file of MAUI mobile application in json format to a C# class. This task allow a CI/CD configuration building for different environments.
How to use.
Add a nuget package into your main MAUI project
dotnet add package PC.MobileTools.AppSettings
Then create a buildconfig.json and appsettings.json at the root of MAUI project, the format of both files as below:
- buildconfig.json
{
"environment": "development",
"className": "Secrets",
"nameSpace": "yournamespace",
"classDir": "Helpers",
"properties": [
{
"name": "AppName",
"type": "String",
"isConstant": false,
"defaultValue": "Company Name"
},
{
"name": "PackageId",
"type": "String",
"isConstant": true,
"defaultValue": "com.companyname.name"
},
{
"name": "ProductId",
"type": "Guid",
"isConstant": false,
"defaultValue": "505aa026-a088-4d7d-9e5d-cd13c3c35f19"
}
]
}
A property type is supporting with some primitive types:
String, Int, Char, Guid, Double, and DateTime.
Note: the nameSpace is required.
- appsettings.json
{
"AppName": "",
"PackageId": "",
"ProductId": ""
}
Note: any property in the appsettings.json must include property declaration in buildconfig file.
- Build your project, then use the generated class in your code:
using yournamespace.Helpers
Console.WriteLine(Secrets.AppName);
Happy coding all ^^.
Learn more about Target Frameworks and .NET Standard.
-
net8.0
- No dependencies.
NuGet packages (1)
Showing the top 1 NuGet packages that depend on PC.MobileTools.AppSettings:
Package | Downloads |
---|---|
PC.MobileTools
A CI/CD helper for parametized secrets |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
1.0.16 | 445 | 6/12/2024 |
1.0.15 | 88 | 6/11/2024 |
1.0.14 | 92 | 6/11/2024 |
1.0.13 | 93 | 6/11/2024 |
1.0.12 | 90 | 6/11/2024 |
1.0.11 | 95 | 6/11/2024 |
1.0.10 | 94 | 6/11/2024 |
1.0.9 | 97 | 5/22/2024 |
1.0.8 | 97 | 5/22/2024 |
1.0.7 | 101 | 5/22/2024 |
1.0.6 | 102 | 5/22/2024 |
1.0.5 | 102 | 5/22/2024 |
1.0.4 | 98 | 5/22/2024 |
1.0.3 | 100 | 5/22/2024 |
1.0.2 | 94 | 5/22/2024 |
1.0.1 | 90 | 5/22/2024 |
1.0.0 | 99 | 5/22/2024 |