![]() |
VOOZH | about |
dotnet add package HMENetCore.Extensions --version 10.0.9
NuGet\Install-Package HMENetCore.Extensions -Version 10.0.9
<PackageReference Include="HMENetCore.Extensions" Version="10.0.9" />
<PackageVersion Include="HMENetCore.Extensions" Version="10.0.9" />Directory.Packages.props
<PackageReference Include="HMENetCore.Extensions" />Project file
paket add HMENetCore.Extensions --version 10.0.9
#r "nuget: HMENetCore.Extensions, 10.0.9"
#:package HMENetCore.Extensions@10.0.9
#addin nuget:?package=HMENetCore.Extensions&version=10.0.9Install as a Cake Addin
#tool nuget:?package=HMENetCore.Extensions&version=10.0.9Install as a Cake Tool
HMENetCore.Extensions 是一个功能丰富的 .NET Core 扩展库,集成了日志记录、路由配置、IP限流、配置管理等多种常用功能。该库旨在简化开发流程,提高开发效率,同时保持代码的整洁和可维护性。
dotnet add package HMENetCore.Extensions
// 使用默认配置
services.AddNLogSingleton();
// 或使用自定义配置
services.AddNLogSingleton(config => {
// 自定义 NLog 配置
});
public class MyService
{
private readonly INLogHelper _logger;
public MyService(INLogHelper logger)
{
_logger = logger;
}
public void DoWork()
{
try {
// 业务逻辑
_logger.Info(this, "工作正常完成");
}
catch (Exception ex) {
_logger.Error(this, "工作发生错误", ex);
}
}
}
services.AddControllers(options => {
options.Filters.Add<GlobalExceptionsFilter>();
});
services.AddControllers(options => {
options.UseCentralRoutePrefix(new RouteAttribute("api/v1"));
});
{
"IpRateLimiting": {
"EnableEndpointRateLimiting": true,
"StackBlockedRequests": false,
"RealIpHeader": "X-Real-IP",
"ClientIdHeader": "X-ClientId",
"HttpStatusCode": 429,
"GeneralRules": [
{
"Endpoint": "*",
"Period": "1s",
"Limit": 5
}
]
}
}
services.AddIpPolicyRateLimit(Configuration.GetSection("IpRateLimiting"));
app.UseIpLimit();
builder.Configuration.AddJsonFileBuilder(AppDomain.CurrentDomain.BaseDirectory + "Config");
// 在应用启动时配置
AppSettingsHelper.AppSettingsConfigure(Configuration);
// 任何地方访问配置
var setting = AppSettingsHelper.GetValue("ConnectionStrings:Default");
| 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 was computed. 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 is compatible. 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. |
This package is not used by any NuGet packages.
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 10.0.9 | 102 | 5/18/2026 |
| 10.0.8 | 162 | 3/17/2026 |
| 10.0.7 | 127 | 2/24/2026 |
| 10.0.6 | 130 | 1/23/2026 |
| 10.0.3 | 134 | 1/14/2026 |
| 10.0.1 | 488 | 12/10/2025 |
| 10.0.0 | 238 | 11/28/2025 |
| 6.1.10 | 95 | 5/18/2026 |
| 6.1.9 | 135 | 3/17/2026 |
| 6.1.8 | 123 | 2/24/2026 |
| 6.1.7 | 129 | 1/23/2026 |
| 6.1.5 | 140 | 1/14/2026 |
| 6.1.2 | 489 | 12/10/2025 |
| 6.1.0 | 254 | 11/24/2025 |
| 6.0.53 | 252 | 10/20/2025 |
| 6.0.52 | 413 | 9/18/2025 |
| 6.0.50 | 255 | 8/11/2025 |