سؤال

I configured NLog layout for having method name and line number by using ${callsite} parameters and it works well locally as below.

Application_Start(Global.asax.cs:33)

But it is changing to Application_Start without line numbers on production. I guess that it is because of it can not access line numbers without .pdb files but i am using .NET 4.5 that makes possible to access line numbers via caller attributes without .pdb files. And i understand NLog haven't optimized itself for .NET 4.5.

Is there a way to put line numbers on production for .NET 4.5 with NLog ?

هل كانت مفيدة؟

المحلول

NLog does not use the new attributes in .NET 4.5

It uses the StackTrace class.

This is evident from the source code.

As such, you need the .pdb files for the line numbers.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top