Azrng.ConsoleApp.DependencyInjection
1.0.1
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package Azrng.ConsoleApp.DependencyInjection --version 1.0.1
NuGet\Install-Package Azrng.ConsoleApp.DependencyInjection -Version 1.0.1
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="Azrng.ConsoleApp.DependencyInjection" Version="1.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Azrng.ConsoleApp.DependencyInjection" Version="1.0.1" />
<PackageReference Include="Azrng.ConsoleApp.DependencyInjection" />
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 Azrng.ConsoleApp.DependencyInjection --version 1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Azrng.ConsoleApp.DependencyInjection, 1.0.1"
#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.
#addin nuget:?package=Azrng.ConsoleApp.DependencyInjection&version=1.0.1
#tool nuget:?package=Azrng.ConsoleApp.DependencyInjection&version=1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Azrng.ConsoleApp.DependencyInjection
控制台依赖注入扩展
- 支持读取appsettings.json配置文件
- 默认使用了Serilog日志输出
使用方法
var builder = new ConsoleAppServer(args);
// 注入自定义配置
// builder.Services.AddHttpClient();
await using var sp = builder.Build<UrlSortService>();
await sp.RunAsync();
Console.Read();
这里的示例类UrlSortService类需要继承自IServiceStart,然后实现方法即可
版本更新记录
- 1.0.1
- 读取环境变量需增加变量前缀:ASPNETCORE_
- 1.1.0-beta1
- 测试进一步缩小打包文件的大小
- 1.0.0
- 基础控制台依赖注入开发
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net8.0
- AzrngCommon.Core (>= 1.3.0)
- Microsoft.Extensions.Hosting (>= 8.0.0)
- Serilog.Extensions.Hosting (>= 8.0.0)
- Serilog.Settings.Configuration (>= 8.0.0)
- Serilog.Sinks.Console (>= 6.0.0)
-
net9.0
- AzrngCommon.Core (>= 1.3.0)
- Microsoft.Extensions.Hosting (>= 9.0.0)
- Serilog.Extensions.Hosting (>= 9.0.0)
- Serilog.Settings.Configuration (>= 9.0.0)
- Serilog.Sinks.Console (>= 6.0.0)
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 |
---|---|---|
1.2.0 | 109 | 5/9/2025 |
1.1.0 | 119 | 3/21/2025 |
1.1.0-beta1 | 94 | 2/18/2025 |
1.0.1 | 104 | 2/23/2025 |
1.0.0 | 110 | 2/17/2025 |