Microsoft.WindowsAdminCenter.FeatureExternal
2.1.0
Prefix Reserved
dotnet add package Microsoft.WindowsAdminCenter.FeatureExternal --version 2.1.0
NuGet\Install-Package Microsoft.WindowsAdminCenter.FeatureExternal -Version 2.1.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="Microsoft.WindowsAdminCenter.FeatureExternal" Version="2.1.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Microsoft.WindowsAdminCenter.FeatureExternal" Version="2.1.0" />
<PackageReference Include="Microsoft.WindowsAdminCenter.FeatureExternal" />
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 Microsoft.WindowsAdminCenter.FeatureExternal --version 2.1.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Microsoft.WindowsAdminCenter.FeatureExternal, 2.1.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 Microsoft.WindowsAdminCenter.FeatureExternal@2.1.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=Microsoft.WindowsAdminCenter.FeatureExternal&version=2.1.0
#tool nuget:?package=Microsoft.WindowsAdminCenter.FeatureExternal&version=2.1.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
SDK interface
The SDK package allows to use the following public interfaces.
IFeatureControllerStartup- The controller can leverage Dependency Injection (DI) and Middleware capability to share common services among various points. Defines a class based on the interface to get starting.
/// <summary>
/// The interface of startup operations for feature controller.
/// </summary>
public interface IFeatureControllerStartup
{
/// <summary>
/// Gets the ordering preference of middleware registration.
/// </summary>
public ApplicationConfigurationOrderingPreference ApplicationConfigurationOrderingPreference;
/// <summary>
/// Partially configures the service objects for the feature controller. Final set of services will include system
/// services and other feature controllers.
/// </summary>
/// <param name="configuration">The configuration object from appsettings.json on the service.</param>
/// <param name="services">The collection of services.</param>
public void PartiallyConfigureServices(IConfiguration configuration, IServiceCollection services);
/// <summary>
/// Partially configure Web Application for the feature controller. Final configuration of web application includes
/// system and other feature controller's settings.
/// </summary>
/// <param name="configuration">The configuration object from appsettings.json on the service.</param>
/// <param name="app">The application builder.</param>
public void PartiallyConfigureApplication(IConfiguration configuration, IApplicationBuilder app);
}
HttpContextExtensions- OnHttpContext, using extension methods the controller can access node's security context.
public static class HttpContextExtensions
{
/// <summary>
/// Gets the username on current context.
/// </summary>
/// <param name="context">The HTTP context object.</param>
/// <returns>The username.</returns>
public static string Username(this HttpContext context);
/// <summary>
/// Gets current feature identity context from HttpContext.
/// </summary>
/// <param name="context">The HTTP context object.</param>
/// <returns>The username.</returns>
public static IFeatureIdentityContext FeatureIdentityContext(this HttpContext context);
}
IFeatureIdentityContextprovides access mechanism to security context.
/// <summary>
/// The interface of identity context.
/// </summary>
public interface IFeatureIdentityContext
{
/// <summary>
/// Gets the Windows identity of request.
/// </summary>
ClaimsIdentity WindowsIdentity { get; }
/// <summary>
/// Gets network credentials from AuthHeader.
/// </summary>
/// <param name="nodeName">The node name.</param>
/// <returns>the network credentials.</returns>
NetworkCredential GetNetworkCredential(string nodeName);
/// <summary>
/// Impersonate on logon user or Auth header user.
/// </summary>
/// <param name="node">The node name. if node is null, it indicates a remote node.</param>
/// <param name="action">The action.</param>
void RunImpersonated(string node, Action action);
/// <summary>
/// Impersonate on logon user or Auth header user.
/// </summary>
/// <param name="node">The node name. if node is null, it indicates a remote node.</param>
/// <param name="action">The action.</param>
/// <returns>the async task object.</returns>
Task RunImpersonatedAsync(string node, Func<Task> action);
/// <summary>
/// Try get credentials from auth header or the cluster node.
/// </summary>
/// <param name="nodeName">The node name.</param>
/// <param name="credentials">Output the credentials, otherwise it's null.</param>
/// <returns>True if it could get the credentials.</returns>
bool TryGetCredentials(string nodeName, out Tuple<string, string, SecureString> credentials);
}
IFeatureLoggerprovides an interface for logging. Internally, the implementation of this interface uses ourLoggerclass, which is instantiated in Startup.cs. So,IFeatureLoggercannot be used before Startup.cs runs.
/// <summary>
/// The interface of logger for feature controller.
/// </summary>
public interface IFeatureLogger
{
/// <summary>
/// Log critical message.
/// </summary>
/// <param name="message">The message.</param>
/// <param name="args">The arguments.</param>
public void LogCritical(string message, params object?[] args);
/// <summary>
/// Log critical exception.
/// </summary>
/// <param name="exception">The exception.</param>
/// <param name="message">The message.</param>
/// <param name="args">The arguments.</param>
public void LogCritical(Exception exception, string? message, params object?[] args);
/// <summary>
/// Log error message.
/// </summary>
/// <param name="message">The message.</param>
/// <param name="args">The arguments.</param>
public void LogError(string message, params object?[] args);
/// <summary>
/// Log error exception.
/// </summary>
/// <param name="exception">The exception.</param>
/// <param name="message">The message.</param>
/// <param name="args">The arguments.</param>
public void LogError(Exception exception, string? message, params object?[] args);
/// <summary>
/// Log warning message.
/// </summary>
/// <param name="message">The message.</param>
/// <param name="args">The arguments.</param>
public void LogWarning(string message, params object?[] args);
/// <summary>
/// Log warning exception.
/// </summary>
/// <param name="exception">The exception.</param>
/// <param name="message">The message.</param>
/// <param name="args">The arguments.</param>
public void LogWarning(Exception exception, string? message, params object?[] args);
/// <summary>
/// Log information message.
/// </summary>
/// <param name="message">The message.</param>
/// <param name="args">The arguments.</param>
public void LogInformation(string message, params object?[] args);
/// <summary>
/// Log information exception.
/// </summary>
/// <param name="exception">The exception.</param>
/// <param name="message">The message.</param>
/// <param name="args">The arguments.</param>
public void LogInformation(Exception exception, string? message, params object?[] args);
/// <summary>
/// Log trace message.
/// </summary>
/// <param name="message">The message.</param>
/// <param name="args">The arguments.</param>
public void LogTrace(string message, params object?[] args);
/// <summary>
/// Log trace exception.
/// </summary>
/// <param name="exception">The exception.</param>
/// <param name="message">The message.</param>
/// <param name="args">The arguments.</param>
public void LogTrace(Exception exception, string? message, params object?[] args);
/// <summary>
/// Log debug message.
/// </summary>
/// <param name="message">The message.</param>
/// <param name="args">The arguments.</param>
public void LogDebug(string message, params object?[] args);
/// <summary>
/// Log debug exception.
/// </summary>
/// <param name="exception">The exception.</param>
/// <param name="message">The message.</param>
/// <param name="args">The arguments.</param>
public void LogDebug(Exception exception, string? message, params object?[] args);
}
| 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 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
- No dependencies.
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 |
|---|---|---|
| 2.1.0 | 640 | 12/2/2024 |