jjchiw / gelf4net

GELF log4net Appender - graylog2
MIT License
63 stars 59 forks source link

Dependencies not added #74

Closed FDonald closed 2 years ago

FDonald commented 3 years ago

Hi, We observe a strange behavior with gelf4Net dependencies. We compile a standard Net Framework (V 4.52) application with Visual Studio 2013 and dependencies libraries are copied in bin directory. (Eg. Newtonsoft.Json.dll)

We compile same application with Visual Studio 2019 Msbuild (v 16.7) and dependencies libraries not are copied in bin directory. (Eg. Newtonsoft.Json.dll)

Inspecting package we found that .nuspec have this configuration:

So we suspect that new version of MsBuild v 16.7 does not copy necessary libraries in output folder and gelf appender not work! Could you confirm this behavior, please? If so, we need add manually necessary dependency? Thank you.

jjchiw commented 3 years ago

Hi!

I'm planning to upgrade library to .net5 and update all the nuget packages....

I'm not sure why the libraries are not copied... I'll look it through today and let you know

:)

FDonald commented 3 years ago

Sorry I forgot add nuspec configuration (downloaded form nuget):

<dependency id="Newtonsoft.Json" version="9.0.1" exclude="Build,Analyzers" />

It seem that new compiler not add this type of dependecies.

jjchiw commented 3 years ago

I couldn't reproduce it....

I executed ./build.ps1 and I see the libraries copied image

I build it with

Microsoft (R) Build Engine version 16.9.0-preview-21078-04+968042dd0 for .NET
Copyright (C) Microsoft Corporation. All rights reserved.
FDonald commented 3 years ago

Thanks @jjchiw. Sorry, the behavior it's the same with all compiler, I will review proyect structure. As a difference, I add a reference to gel4Net directly. It is necessary or I could add Gelf4Net Core and Gel4$Net UdpAppender (or needed Appenders)? Let me make a suggestion, please. When a dependency dll is missing, Why not show Gelf4Net an error instead of silently fail?

jjchiw commented 3 years ago

Ok So it seems you are not using the Nuget Package with nuget all the dependencies are downloaded and should work....

So, if you want to reference the project you should reference gelfnet and it would pull all the dependencies....

If you want all the appender you need to reference Gelf4Net if you only want some appenders you can only add the appender needed.

Gelf4Net UdpAppender image

Gelf4Net bin image