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
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="PC.MobileTools.AppSettings" Version="1.0.16" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add PC.MobileTools.AppSettings --version 1.0.16
#r "nuget: PC.MobileTools.AppSettings, 1.0.16"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// 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:

  1. 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.

  1. appsettings.json
{
  "AppName": "",
  "PackageId": "",
  "ProductId": "" 
}

Note: any property in the appsettings.json must include property declaration in buildconfig file.

  1. Build your project, then use the generated class in your code:
using yournamespace.Helpers
    
Console.WriteLine(Secrets.AppName);

Happy coding all ^^.

There are no supported framework assets in this package.

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 36 6/12/2024
1.0.15 48 6/11/2024
1.0.14 48 6/11/2024
1.0.13 50 6/11/2024
1.0.12 51 6/11/2024
1.0.11 57 6/11/2024
1.0.10 57 6/11/2024
1.0.9 64 5/22/2024
1.0.8 66 5/22/2024
1.0.7 72 5/22/2024
1.0.6 73 5/22/2024
1.0.5 75 5/22/2024
1.0.4 69 5/22/2024
1.0.3 70 5/22/2024
1.0.2 64 5/22/2024
1.0.1 61 5/22/2024
1.0.0 68 5/22/2024