Skip to content

Library Template Overview

The ConnectSoft Library Template (identity: ConnectSoft.LibraryTemplate, CLI short name: connectsoft-library) scaffolds a multi-project solution: a reusable class library (multi-targeting net8.0;net9.0;net10.0), MSTest unit tests, MkDocs documentation layout, Central Package Management, and Azure Pipelines for build, test, pack, and publish.

When to use this template vs API Library Template

Use Library Template Use API Library Template
Shared domain, utilities, options, metrics, internal abstractions Typed HTTP clients, auth, resilience, mock servers for external APIs
NuGet consumed by many services Service-agent style SDKs for specific APIs
Optional ActivitySource / tracing sample HTTP-focused integration patterns

If the goal is calling a third-party or internal HTTP API with Polly, auth, and client tests, prefer API Library Template. If the goal is shared .NET building blocks (configuration, metrics, small APIs), use this template.

How Factory agents use it

The Backend Library Generator Agent maps planner output and prompts to dotnet new connectsoft-library with template symbols from template.json: UseDI, UseLogging, UseOptions, UseMetrics, UseActivitySource, Framework, buildDefinitionNumber. Agents should pass kebab-case CLI flags (see dotnetcli.host.json in the template repo).

Symbol → output (high level)

  • UseOptions / UseMetrics / UseActivitySource: conditionally include Options/, Metrics/, Diagnostics/, Samples/TracingDemo.cs, and test folders.
  • Framework: default net10.0primary moniker for tooling; TargetFrameworks in the .csproj remains all three TFMs unless humans edit the project after scaffold.
  • buildDefinitionNumber: replaces placeholders in README/pipeline badges.

Quick start (CLI)

dotnet new install <path-or-package-to-ConnectSoft.LibraryTemplate>
dotnet new connectsoft-library --name ConnectSoft.Extensions.MyLibrary

Full parameter reference, FAQ, and CI vs template flags: ConnectSoft.DocumentationDocs/starters/library-template/parameters.md (canonical); publish base URL depends on your MkDocs/site hosting.