PC.MobileTools.AppSettings 1.0.12

There is a newer version of this package available.
See the version list below for details.
dotnet add package PC.MobileTools.AppSettings --version 1.0.12                
NuGet\Install-Package PC.MobileTools.AppSettings -Version 1.0.12                
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.12" />                
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.12                
#r "nuget: PC.MobileTools.AppSettings, 1.0.12"                
#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.12

// Install PC.MobileTools.AppSettings as a Cake Tool
#tool nuget:?package=PC.MobileTools.AppSettings&version=1.0.12                

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",
      "defaultValue": "Company Name"
    },
    {
      "name": "PackageId",
      "type": "String",
      "defaultValue": "com.companyname.name"
    },
    {
      "name": "ProductId",
      "type": "Guid",
      "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 498 6/12/2024
1.0.15 94 6/11/2024
1.0.14 98 6/11/2024
1.0.13 99 6/11/2024
1.0.12 98 6/11/2024
1.0.11 103 6/11/2024
1.0.10 102 6/11/2024
1.0.9 105 5/22/2024
1.0.8 103 5/22/2024
1.0.7 107 5/22/2024
1.0.6 108 5/22/2024
1.0.5 110 5/22/2024
1.0.4 104 5/22/2024
1.0.3 108 5/22/2024
1.0.2 102 5/22/2024
1.0.1 96 5/22/2024
1.0.0 109 5/22/2024