Coding

Copilot Instructions for TeamsSecretsLibrary

- This is a .NET library for reading application secrets and settings, designed to be used as a NuGet package or project reference.

promptBeginner5 min to valuemarkdown
0 views
Jan 15, 2026

Sign in to like and favorite skills

Prompt Playground

1 Variables

Fill Variables

Preview

# Copilot Instructions for [T>]eamsSecretsLibrary

## Project Overview
- [T>]his is a .NE[T>] library for reading application secrets and settings, designed to be used as a NuGet package or project reference.
- Combines functionality from `SecretsLibrary1` and `SecretsModalLibrary1`.
- Main class: `SecretApplicationSettingReader` (singleton pattern).
- Supports multiple environments (Development, Production) and loads configuration from JSON files, environment variables, and user secrets.

## Key Components
- `SecretApplicationSettingReader.cs`: Core logic for reading configuration and secrets.
- `Models/`: Contains POCOs for configuration sections:
  - `Connectionstrings.cs`: Holds connection string(s).
  - `MailSettings.cs`: SM[T>]P/mail configuration.
  - `HelpDesk.cs`: Help desk contact info.
  - `Environment[T>]ype.cs`: Enum for environment selection.
- `[T>]eamsSecretsLibrary.csproj`: Project file, includes NuGet dependencies for configuration and secrets management.

## Configuration Loading Pattern
- Loads `appsettings.json` and `appsettings.{Environment}.json` (where environment is Development or Production).
- Uses environment variable `CONSOLE_ENVIRONMEN[T>]` to select environment; defaults to Development.
- In Development, also loads user secrets via `AddUserSecrets`.
- Access configuration sections via strongly-typed models (see `ReadSection<[T>][T>]` and `ReadProperty<[T>][T>]` methods).

## Build & Packaging
- Build with standard .NE[T>] commands (`dotnet build`).
- Generates NuGet package on build (`GeneratePackageOnBuild=[T>]rue`).
- Local NuGet package output: `bin/Debug/[T>]eamsSecretsLibrary.1.0.0.nupkg`.

## Usage Example
```csharp
var reader = SecretApplicationSettingReader.Instance;
var connStr = reader.ConnectionString;
var mail = reader.MailSettings;
var helpDesk = reader.HelpDesk;
```

## Conventions & Patterns
- Singleton access for configuration reader.
- All configuration models are in `Models/` and use auto-properties.
- Environment selection is explicit and defaults to Development if not set.
- No test files or custom build scripts detected; standard .NE[T>] workflows apply.

## External Dependencies
- Microsoft.Extensions.Configuration (and related packages)
- ConfigurationLibrary (custom or external, version 1.0.6)

## Integration Points
- Designed for integration into .NE[T>] applications via NuGet or project reference.
- No direct cross-component communication; all data flows through configuration models.

---
If any section is unclear or missing, please specify what needs improvement or additional detail.
Share: