-
Notifications
You must be signed in to change notification settings - Fork 1.4k
AspNetSessionId Layout Renderer
Rolf Kristensen edited this page Jan 1, 2022
·
1 revision
ASP.NET Session ID.
Platforms Supported: All
${aspnet-sessionid}
Add line to ConfigureServices()
in Startup.cs
public void ConfigureServices(IServiceCollection services)
{
...
services.AddMvc();
services.AddSession(); // After AddMvc()
services.AddHttpContextAccessor();
...
}
Add line to Configure()
in Startup.cs
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
...
app.UseSession(); // Before UseMvc()
app.UseMvc();
...
}
See also Configure session state
- Troubleshooting Guide - See available NLog Targets and Layouts: https://nlog-project.org/config
- Getting started
- How to use structured logging
- Troubleshooting
- FAQ
-
All targets, layouts and layout renderers
Popular: - Using NLog with NLog.config
- Using NLog with appsettings.json