简体   繁体   English

NLog不记录带有.NET 3.5客户端配置文件的XP SP3上的消息

[英]NLog not logging messages on XP SP3 with .NET 3.5 Client Profile

I'm writing a program that is targeting the .NET 3.5 Client Profile and using NLog. 我正在编写针对.NET 3.5客户端配置文件并使用NLog的程序。 I configure my logger programmatically on start up (no config file.) 我在启动时以编程方式配置记录器(无配置文件。)

It works perfectly on Vista and Windows 7, but when running on a fresh install of XP SP3 with the .NET Client Profile installed, it will not log any of the variables in the layout string. 它可以在Vista和Windows 7上完美运行,但是在全新安装了.NET Client Profile的XP SP3上运行时,它将不会在布局字符串中记录任何变量。 For example, with the layout string set to: 例如,将布局字符串设置为:

target.Layout = "MESSAGE: ${longdate}|${level}|${message}";

It will log "MESSAGE: | | |" 它将记录为“ MESSAGE:| | |”

Again, this only happens on XP SP3, and the logger is set to throw exceptions. 同样,这仅在XP SP3上发生,并且记录器被设置为引发异常。 Any ideas what may be causing this? 任何想法可能是什么原因造成的?

我遇到了同样的问题,但SP1解决了它。

Which version of NLog are you using? 您正在使用哪个版本的NLog? This should be a supported scenario in NLog 2.0, which comes with client-profile-specific assembly. 这应该是NLog 2.0中受支持的方案,它带有特定于客户端配置文件的程序集。 You can download recent nightly builds from: 您可以从以下位置下载最新的每晚版本:

http://nlog-project.org/download.html http://nlog-project.org/download.html

Let me know if it fixes the issue. 让我知道是否可以解决问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM