AspNetSession layout renderer not working

5.3k views Asked by At

I am using NLog for logging in my asp.net 4.5 website. I have used NLog 4.0. Now I need to use session variables in my logs. So i tries to use AspNetSession layout renderer. This layout renderer is included in Nlog.Web. I have added this dll and also under the extensions tag in NLog config file. But it gives the following error:

ArgumentException: LayoutRenderer cannot be found: 'aspnet-session'

I have also added NLog.extended dll and also under the extensions tag in NLog config file. But it also didn't help.

Please let me know what should i do.

enter image description here

1

There are 1 answers

2
Viacheslav Yankov On BEST ANSWER

You need to install NLog.Web assembly from NuGet by using the following command.

Install-Package NLog.Web