ZStack.AspNetCore.OpenTelemetry
9.0.9
dotnet add package ZStack.AspNetCore.OpenTelemetry --version 9.0.9
NuGet\Install-Package ZStack.AspNetCore.OpenTelemetry -Version 9.0.9
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="ZStack.AspNetCore.OpenTelemetry" Version="9.0.9" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add ZStack.AspNetCore.OpenTelemetry --version 9.0.9
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: ZStack.AspNetCore.OpenTelemetry, 9.0.9"
#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.
// Install ZStack.AspNetCore.OpenTelemetry as a Cake Addin #addin nuget:?package=ZStack.AspNetCore.OpenTelemetry&version=9.0.9 // Install ZStack.AspNetCore.OpenTelemetry as a Cake Tool #tool nuget:?package=ZStack.AspNetCore.OpenTelemetry&version=9.0.9
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
ZStack快速开发框架
.NET基础库:
ASP .NET Core基础库:
ASP .NET Core组件库:
1. 开始使用
1.1 使用脚手架创建项目
1.2 手动创建项目
控制台程序
添加NuGet程序包
ZStack.Extensions
Program.cs
global using Microsoft.Extensions.DependencyInjection;
global using Serilog;
global using ZStack.Core;
var sp = DependencyInjection.CreateConsoleAppServiceProvider(configure => { });
var logger = sp.GetRequiredService<ILogger>()
.ForContext<Program>();
logger.Information("Hello, World!");
ASP .NET Core
添加NuGet程序包
ZStack.AspNetCore
GlobalUsings.cs
global using Furion;
global using ZStack.AspNetCore;
global using App = ZStack.AspNetCore.App;
- Program.cs
var builder = WebApplication.CreateBuilder(args).InjectZStack();
var app = builder.Build();
app.Run();
- Startup.cs
/// <summary>
/// 应用启动配置
/// </summary>
public class Startup : AppStartup
{
/// <summary>
/// 服务配置
/// </summary>
/// <param name="services"></param>
public void ConfigureServices(IServiceCollection services)
{
services.AddControllersWithViews().AddInject();
}
/// <summary>
/// 中间件配置
/// </summary>
/// <param name="app"></param>
/// <param name="env"></param>
public void Configure(IApplicationBuilder app, IHostEnvironment env)
{
...
app.UseRouting();
...
app.UseZStackInject();
}
}
2. 项目结构
graph TD;
ZStack.Core --> ZStack.Extensions;
ZStack.Extensions --ASP .NET Core--> ZStack.AspNetCore;
ZStack.AspNetCore --> ZStack.AspNetCore.SqlSugar;
ZStack.AspNetCore --> ZStack.AspNetCore.EventBus;
ZStack.AspNetCore --> ZStack.AspNetCore.Hangfire;
ZStack.AspNetCore.Hangfire --> ..MemoryStorage;
ZStack.AspNetCore.Hangfire --> ..Redis;
ZStack.AspNetCore.Hangfire --> ..PostgreSql;
- ZStack.Core:ZStack框架 核心库
- ZStack.Extensions:ZStack框架 拓展方法库
- ZStack.AspNetCore:ZStack框架 ASP .NET Core基础库
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net9.0 is compatible. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net9.0
- OpenTelemetry.Exporter.OpenTelemetryProtocol (>= 1.10.0)
- OpenTelemetry.Extensions.Hosting (>= 1.10.0)
- OpenTelemetry.Instrumentation.AspNetCore (>= 1.9.0)
- OpenTelemetry.Instrumentation.Http (>= 1.9.0)
- OpenTelemetry.Instrumentation.Runtime (>= 1.9.0)
- Serilog.Sinks.OpenTelemetry (>= 4.1.1)
- ZStack.AspNetCore (>= 9.0.9)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.