Click or drag to resize

SetupBuilderExtensionsRegisterNLogWeb Method (ISetupBuilder, IConfiguration, IServiceProvider)

Convience method to register aspnet-layoutrenders in NLog.Web as one-liner before loading NLog.config

Namespace:  NLog.Web
Assembly:  NLog.Web.AspNetCore (in NLog.Web.AspNetCore.dll) Version: 6.0.0+59339f2811712b446adf6dcd8a6bad39ad9f2ba1
Syntax
public static ISetupBuilder RegisterNLogWeb(
	this ISetupBuilder setupBuilder,
	IConfiguration? configuration = null,
	IServiceProvider? serviceProvider = null
)

Parameters

setupBuilder
Type: NLog.ConfigISetupBuilder
configuration (Optional)
Type: IConfiguration
serviceProvider (Optional)
Type: SystemIServiceProvider

Return Value

Type: ISetupBuilder

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type ISetupBuilder. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
Remarks
If not providing serviceProvider, then output from aspnet-layoutrenderers will remain empty
See Also