RT.MesWeb.Framework
1.2.0
dotnet add package RT.MesWeb.Framework --version 1.2.0
NuGet\Install-Package RT.MesWeb.Framework -Version 1.2.0
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="RT.MesWeb.Framework" Version="1.2.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="RT.MesWeb.Framework" Version="1.2.0" />
<PackageReference Include="RT.MesWeb.Framework" />
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 RT.MesWeb.Framework --version 1.2.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: RT.MesWeb.Framework, 1.2.0"
#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.
#:package RT.MesWeb.Framework@1.2.0
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=RT.MesWeb.Framework&version=1.2.0
#tool nuget:?package=RT.MesWeb.Framework&version=1.2.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Framework 使用说明
安装
dotnet add package RT.MesWeb.Framework
目标框架:net8.0 / net10.0
配置要求
- 若启用授权功能,则需要在
appsettings.json中添加以下配置(LicenseMode:1=加密狗、2=授权文件、3=网络授权(当前未实现,配置后启动即抛NotSupportedException)、4=配置体内嵌授权):
{
"License": {
"LicenseMode": 2,
"LicenseFilePath": "License.lic", // LicenseMode=2 使用;默认 License.lic
"LicenseFileFolder": "", // LicenseMode=2 使用;授权文件目录,空表示程序根目录
"HostSystemFolder": "",
"HostName": "", // LicenseMode=4 使用:授权绑定的主机名
"MacAddress": "", // LicenseMode=4 使用:授权绑定的 MAC(去掉分隔符的十六进制)
"LicenseContent": "" // LicenseMode=4 使用:授权内容密文
}
}
JWT 配置
Jwt节由JwtOptions(RT.MesWeb.Framework.Identity)绑定。SecurityKey内置默认密钥,未配置也可正常使用(适用于低安全要求的部署);需要自定义时通过环境变量Jwt__SecurityKey覆盖。HMAC-SHA256 要求密钥至少 32 字节(256 位)。
{
"Jwt": {
"Issuer": "rt.mes",
"Audience": "mes.api",
"ClockSkewSeconds": 30,
"ExpiresMinutes": 1440
}
}
- 令牌校验包含签发者(
iss)与受众(aud):GetTokenValidationParameters在Audience非空时开启受众校验(默认值mes.api)。只有显式把Audience配成空串才会关闭该校验。 ExpiresMinutes已废弃,access_token 寿命由Authentication:OAuth:AccessTokenMinutes控制。
使用说明
- 在主工程内注册全局静态配置资源:
GlobalStaticConfiguration.Initialize(configuration);
- 在主工程内启动授权服务:
MesLicenseChecker.Current.Start(configuration, hostEnvironment.ContentRootPath, logger);
| 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 was computed. 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 is compatible. 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.
-
net10.0
- Microsoft.AspNetCore.Http.Abstractions (>= 2.3.0)
- Microsoft.AspNetCore.Mvc.Core (>= 2.3.0)
- Microsoft.Extensions.Configuration.Abstractions (>= 8.0.0 && < 11.0.0)
- Microsoft.Extensions.Configuration.Binder (>= 8.0.0 && < 11.0.0)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 8.0.0 && < 11.0.0)
- Newtonsoft.Json (>= 13.0.4)
- RT.MesWeb.LicenseReader (>= 1.2.0)
- System.IdentityModel.Tokens.Jwt (>= 8.11.0)
-
net8.0
- Microsoft.AspNetCore.Http.Abstractions (>= 2.3.0)
- Microsoft.AspNetCore.Mvc.Core (>= 2.3.0)
- Microsoft.Extensions.Configuration.Abstractions (>= 8.0.0 && < 11.0.0)
- Microsoft.Extensions.Configuration.Binder (>= 8.0.0 && < 11.0.0)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 8.0.0 && < 11.0.0)
- Newtonsoft.Json (>= 13.0.4)
- RT.MesWeb.LicenseReader (>= 1.2.0)
- System.IdentityModel.Tokens.Jwt (>= 8.11.0)
NuGet packages (3)
Showing the top 3 NuGet packages that depend on RT.MesWeb.Framework:
| Package | Downloads |
|---|---|
|
RT.MesWeb.Authentication
Authentication server for mes system |
|
|
RT.MesWeb.Audit
Audit support for mes system |
|
|
RT.MesWeb.OpcUa
OpcUa support for mes system |
GitHub repositories
This package is not used by any popular GitHub repositories.