最新消息:20210816 当前crifan.com域名已被污染,为防止失联,请关注(页面右下角的)公众号

【或许解决】C#中用Nlog结果找不到NLog.Win32

C# crifan 6030浏览 0评论

【问题】

折腾:

【未解决】C#中实现Log同时输出内容到文件和文本框(或终端)

期间,去写代码。

加了:

using NLog;
using NLog.Targets;
using NLog.Config;
using NLog.Win32.Targets;

结果对于:

using NLog.Win32.Targets;

提示说找不到Win32:

Error    1    The type or namespace name ‘Win32’ does not exist in the namespace ‘NLog’ (are you missing an assembly reference?)

1.以为是自己之前下载:

NLog2.netcf35.zip

的中间,缺少此库呢。

2.所以再去到:

NLog 2.0

中重新下载另外一个dll:

NLog2.netfx35.zip

得到:

NLog.dll

NLog.Extended.dll

然后去掉之前的dll,重新导入这两个dll。

结果错误依旧。

3.虽然参考:

Urgent—->Problem with NLog.Win32 namespace.

有解决办法,但是该页面:

http://nlog-project.org/wiki/List_of_breaking_changes_in_NLog_2.0

却打不开。

4. 再去参考:

Re: New NLog snapshots published

貌似之前是有个独立的:NLog.Win32.dll 的。

估计现在没有了。

5.再去下载一个:

NLog2.sl3.zip

看看里面有啥,结果也没啥,只有NLog.dll,没有。

 

【总结】

估计就是由于API更新,把NLog.Win32,整合到别的dll,比如NLog.dll或NLog.Extended.dll中了。

所以,现在找不到NLog.Win32了。

暂且就不理会该行代码,暂时注释掉再说了。

等以后真的用到了,再说。

转载请注明:在路上 » 【或许解决】C#中用Nlog结果找不到NLog.Win32

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
82 queries in 0.159 seconds, using 22.09MB memory