0

I have a class library with a Nuget(NLog) added to it. I am trying to generate a dll from my code which has the Nuget reference (Logger) used inside my code. Now when I am trying to use the dll, I get NLog reference missing, how to fix this issue?

Thanks!

CoyBit
  • 1,592
  • 1
  • 17
  • 19
DeSon
  • 147
  • 13
  • 1
    You will also have to ship that dll. This goes for all dependencies that you added yourself. Normally this would be the entire output folder where your own built dll resides. – Silvermind Feb 28 '19 at 14:53
  • @Silvermind - That doesnt sound like a convincing way to fix the problem. That way I`ll have to copy all the config related files too right? – DeSon Feb 28 '19 at 15:09
  • The config related files should ALL be on your web.config of your site, including the NLog config. And yes, you have to ship all the dependencies to your output folder – Stormhashe Feb 28 '19 at 15:13
  • Thanks Silvermind & Stormhashe! I`ll rather remove NLog then copying all the related dlls. – DeSon Feb 28 '19 at 15:31
  • As your dll has a dependency on NLog, the best way is to publish it as a NuGet package and take a dependency on NLog's NuGet package, https://learn.microsoft.com/en-us/nuget/create-packages/creating-a-package – Lex Li Feb 28 '19 at 17:55
  • Try to use ILMerge - https://stackoverflow.com/a/8078947/5472922 – Ivan Tikhonov Mar 21 '19 at 11:23

0 Answers0