NLog: Errors thrown without NLog.Web in extensions

NLog version: 4.5.4.7700

Platform: .Net 4.5

We recently upgraded to 4.5.4.7700 from 4.5.0 and have started to see errors for a target we’ve had setup for forever which uses aspnet-user-identity from NLog.Web. I can resolve the error by adding NLog.Web as an extension but I’m wondering if that is expected as I can’t find any mention of it elsewhere. Also the exception that gets thrown seems wrong.

  • What is the current result?

Event viewer shows the following exception which doesn’t help at all and seems wrong?:

Message: Type is not resolved for member 'NLog.NLogConfigurationException,NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c'.

NLog internal logs show:

2018-06-11 12:40:45.6381 Warn Error when setting property 'Body' on 'Mail Target[exchange]' Exception: System.ArgumentException: LayoutRenderer cannot be found: 'aspnet-user-identity'. Is NLog.Web not included?
2018-06-11 12:40:45.6381 Warn Error when setting '<sty... **snipped for length** on attibute 'body'
2018-06-11 12:40:45.6381 Error Parsing configuration from C:\Data\Service\NLog.config failed. Exception: NLog.NLogConfigurationException: Exception when parsing C:\Data\Service\NLog.config.  ---> NLog.NLogConfigurationException: Error when setting property 'Body' on Mail Target[exchange] ---> System.ArgumentException: LayoutRenderer cannot be found: 'aspnet-user-identity'. Is NLog.Web not included?
  • What is the expected result?

Same behavior as 4.5.0 OR a blog post/documentation letting us know about the change.

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 22 (13 by maintainers)

Most upvoted comments

I’ve been finishing off a project but have a few spare cycles to start looking at this now so I’ll let you know what I find.