![]() |
VOOZH | about |
dotnet add package Extensions.Configuration.GitRepository --version 1.0.33
NuGet\Install-Package Extensions.Configuration.GitRepository -Version 1.0.33
<PackageReference Include="Extensions.Configuration.GitRepository" Version="1.0.33" />
<PackageVersion Include="Extensions.Configuration.GitRepository" Version="1.0.33" />Directory.Packages.props
<PackageReference Include="Extensions.Configuration.GitRepository" />Project file
paket add Extensions.Configuration.GitRepository --version 1.0.33
#r "nuget: Extensions.Configuration.GitRepository, 1.0.33"
#:package Extensions.Configuration.GitRepository@1.0.33
#addin nuget:?package=Extensions.Configuration.GitRepository&version=1.0.33Install as a Cake Addin
#tool nuget:?package=Extensions.Configuration.GitRepository&version=1.0.33Install as a Cake Tool
Git repository configuration provider is a library designed for managing and loading configuration files, specifically for C# developers. It allows developers to read configuration files directly from a Git repository, enabling centralized configuration management and version control in distributed systems or microservice architectures.
👁 Build status
👁 NuGet Count
👁 Issues Open
👁 NuGet Version
This project now supports fetching configuration files from the following platforms:
| Git repository | Git files | gist | version | downloads |
|---|---|---|---|---|
| Gitee | √ | √ | 👁 NuGet Version |
👁 NuGet Count |
| GitLab | √ | 👁 NuGet Version |
👁 NuGet Count |
|
| Gitea | √ | 👁 NuGet Version |
👁 NuGet Count |
|
| GitHub | √ | √ | 👁 NuGet Version |
👁 NuGet Count |
With this feature, you can directly retrieve configuration files from repositories hosted on these platforms, making it easier to manage and load configurations in multi-platform environments.
You can install this library via the NuGet package manager. Run the following command to install:
dotnet add package Extensions.Configuration.GitRepository
Here is a simple example demonstrating how to use this library to load configuration files from a Git repository:
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddControllers();
builder.Services.AddOpenApi();
builder.Configuration.AddUserSecrets("personal_access_tokens");
builder.Configuration.AddGitRepository(cfg => cfg.WithGitLab()
.WithHostUrl("https://git.uixe.net/")
.WithRepositoryPath("uixe/stdlanedevctlsvr")
.WithAuthenticationToken(builder.Configuration.GetValue<string>("personal_access_tokens"))
.WithFileName($"{Environment.GetEnvironmentVariable("UIXEID")}/appsettings.{builder.Environment.EnvironmentName}.json")
.WithCache($"{builder.Environment.ContentRootPath}{System.IO.Path.DirectorySeparatorChar}appsettings.{builder.Environment.EnvironmentName}.json")
);
var app = builder.Build();
// Configure the HTTP request pipeline.
if (app.Environment.IsDevelopment())
{
app.MapOpenApi();
}
Console.WriteLine($"abc={app.Configuration.GetValue<string>("abc")}");
app.UseAuthorization();
app.MapControllers();
app.Run();
}
We welcome community contributions. You can contribute in the following ways:
This project is licensed under the MIT License. For details, please refer to the LICENSE file.
Inspired by https://github.com/denis-ivanov/Extensions.Configuration.GitLab
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 net8.0 is compatible. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 is compatible. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
Showing the top 4 NuGet packages that depend on Extensions.Configuration.GitRepository:
| Package | Downloads |
|---|---|
|
Extensions.Configuration.GitRepository.GitLabProvider
GitLab's repository configuration provider implementation to use with Microsoft.Extensions.Configuration. |
|
|
Extensions.Configuration.GitRepository.GiteaProvider
Gitea's repository configuration provider implementation to use with Microsoft.Extensions.Configuration. |
|
|
Extensions.Configuration.GitRepository.GitHubProvider
GitHub's repository and gist configuration provider implementation to use with Microsoft.Extensions.Configuration. |
|
|
Extensions.Configuration.GitRepository.GiteeProvider
Gitee's repository and gist configuration provider implementation to use with Microsoft.Extensions.Configuration. |
This package is not used by any popular GitHub repositories.