Setting up C# solution with multiple projects using NLog in Visual Studio

前端 未结 3 848
名媛妹妹
名媛妹妹 2021-02-13 18:01

My solution in Visual Studio 2012 currently contains two projects:

  • DLL
  • WPF application (which requires methods of the DLL)

Both, the DLL an

3条回答
  •  后悔当初
    2021-02-13 18:28

    You better abstract the use of your logging mechanism. I described this in this blog post, it's about log4net but is the same principle whatever framework you use. In any case, you need the log assembly in every project where you use it, but by abstracting it it's easy to replace it by something else (when testing for example). Logging is infrastructure, so you would put the interfaces and concrete implementation in an infrastructure project, and reference that one from the projects in which you want to log.

提交回复
热议问题