PC.MobileTools.AppSettings 1.0.14

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.14                
NuGet\Install-Package PC.MobileTools.AppSettings -Version 1.0.14                
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.14" />                
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.14                
#r "nuget: PC.MobileTools.AppSettings, 1.0.14"                
#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.14

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

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