Mobile.Secrets 1.0.0

The owner has unlisted this package. This could mean that the package is deprecated, has security vulnerabilities or shouldn't be used anymore.
dotnet add package Mobile.Secrets --version 1.0.0
                    
NuGet\Install-Package Mobile.Secrets -Version 1.0.0
                    
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="Mobile.Secrets" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Mobile.Secrets" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Mobile.Secrets" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Mobile.Secrets --version 1.0.0
                    
#r "nuget: Mobile.Secrets, 1.0.0"
                    
#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.
#:package Mobile.Secrets@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Mobile.Secrets&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Mobile.Secrets&version=1.0.0
                    
Install as a Cake Tool

Mobile.Secrets

This small package is used to generate secrets from an appsettings file or your environment. This project is aimed to be used with MAUI. It can also be used in other projects/frameworks such as ASP.NET.

How to use

  1. Download this package from NuGet into your project.
  2. For local development, create an appsettings.json file in the root of your project, not your solution.
  3. Build your application.

You will find a Settings.Generated.cs file in your obj directory. The secrets from your appsettings.json have been generated and compiled and are ready to use in your project.

To use this in your pipeline, simply add your secrets to your environment. The name of each secret should be prefixed with Secret_, that way Mobile.Secrets can find your secrets in your environment.

Notes

  1. I created this project because I was not able to migrate the Mobile.BuildTools package from Xamarin to MAUI. We were only using configuration, so I figured it would be interesting to create my own small solution. That being said, without the Mobile.BuildTools package I wouldn't have come far.
  2. It is possible use nested objects in your appsettings.json file. Keep in mind that the names of each object are chained together with an _. The nested ConnectionStrings in this test appsettings file are renamed to ConnectionStrings_Default in the generated class.
  3. Currently, arrays are unsupported and will not be generated.

Solution structure

This solution contains a couple of projects, these are:

  1. Mobile.Secrets: the actual package.
  2. TestApplication: an application I used to do some local testing/development.
  3. UnitTests: mostly used for development and currently not intended for CI.
There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated