Git Product home page Git Product logo

Comments (15)

dgxhubbard avatar dgxhubbard commented on July 4, 2024 1

I just checked nuget and .net standard 2.0 is not listed as a supported framework.
Do yo know when this release will be available?
Thanks

from microsoft.extensions.logging.log4net.aspnetcore.

JensFu avatar JensFu commented on July 4, 2024 1

This package downgrade is because the "nearest" version to the project wins.
In this case your project (which also references log4net) references a lower version of the sockets than log4net does. Since the log4net reference is to the sockets is not "direct" it looses. The build detects this and warn about this.
I do not know exactly where the reference to the lower version of the socket package comes from (maybe from the default netcoreapp3.0 dependencies).
You can easily solve this by adding the higher version of the socket reference directly (in the same project as your log4net reference is added). Be aware that this might not solve all your version conflicts, so adding a meta package might be the better choice.

Try adding the latest (3.0.0) version of Microsoft.NETCore.Targets package.

Not sure if this is the only and best solution. But it feels much better than supressing the warning, which is supposed in many forums.

from microsoft.extensions.logging.log4net.aspnetcore.

huorswords avatar huorswords commented on July 4, 2024

Hello @tcz717 ,

Thank you very much by your kindly words.

Can you explain me something about the scenario that you are trying to solve with this nuget package?

For me, your question is similar to #3, and I think that the answer could be the same, but I want that, if you can, expose me the scenario in order to evaluate if the .net standard support is reasonable or not.

Thank you very much.

Regards

from microsoft.extensions.logging.log4net.aspnetcore.

tcz717 avatar tcz717 commented on July 4, 2024

Hi @huorswords

I am writing a RPC lib in .net standard 2.0 and its network part is based on DotNetty. DotNetty has an internal logging system that supports Microsoft.Extensions.Logging.ILoggerFactory interface, but my whole system uses log4net to log. So I need an adapter to connect these two parts.

Thanks for your reply.

from microsoft.extensions.logging.log4net.aspnetcore.

huorswords avatar huorswords commented on July 4, 2024

Hello @tcz717,

After reviewing your request, and after checking some of the other Logging providers that also supports Microsoft.Extensions.Logging library, I have just included .NET Standard 2.0 as supported target framework of this project.

The nuget package will be available soon on nuget.org.

Thank you very much by your suggestion.

Regards.

from microsoft.extensions.logging.log4net.aspnetcore.

huorswords avatar huorswords commented on July 4, 2024

Hello @dgxhubbard,

Sorry but, on last version of the nuget package, .Net Standard 2.0 is one of the dependencies...

Where have you checked it? From VS? From nuget.org portal?

Thank you. Regards.

from microsoft.extensions.logging.log4net.aspnetcore.

dgxhubbard avatar dgxhubbard commented on July 4, 2024

I opened the manage nuget packages for solution click on browse and type in "log4net"
The last one listed is .net standard 1.3

from microsoft.extensions.logging.log4net.aspnetcore.

dgxhubbard avatar dgxhubbard commented on July 4, 2024

I see the problem. I searched here found log4net and thought this was log4net. I looked at the logging extension and there is a .net standard 2.0. Alas, I was looking for log4net thought.
Sorry about that.

from microsoft.extensions.logging.log4net.aspnetcore.

huorswords avatar huorswords commented on July 4, 2024

Oh! I see...

Cool, I have worried about it. :)

Anyway, thank you by your question.

from microsoft.extensions.logging.log4net.aspnetcore.

JensFu avatar JensFu commented on July 4, 2024

Hi, I just tried to add the log4net nuget for a netstandard2.0 library and had the same problem like dgxhubbard. What is excatly the name i have to search for in the nuget package manager of visual studio?

from microsoft.extensions.logging.log4net.aspnetcore.

huorswords avatar huorswords commented on July 4, 2024

Hello @JensFu ,

The official log4net nuget package (https://www.nuget.org/packages/log4net/) it is compatible with .NET Standard 1.3, so it should be compatible with any library created on .NET Standard 2.0.

At the other hand, the Microsoft.Extensions.Logging.Log4Net.AspNetCore package it is compatible with .NET Standard 2.0, and imports automatically the reference from log4net v.2.0.8 package.

Please, let me know any thought on this.

Thank you.

from microsoft.extensions.logging.log4net.aspnetcore.

petertsu avatar petertsu commented on July 4, 2024

Once you add the log4net reference to .NETStandard 2.0 project you get a lot of nu1605 warnings

https://docs.microsoft.com/en-us/nuget/reference/errors-and-warnings/nu1605?f1url=https%3A%2F%2Fmsdn.microsoft.com%2Fquery%2Fdev15.query%3FappId%3DDev15IDEF1%26l%3DEN-US%26k%3Dk(NU1605)%26rd%3Dtrue

I think there a need to make log4net .NETStandard 2.0 compatible

from microsoft.extensions.logging.log4net.aspnetcore.

huorswords avatar huorswords commented on July 4, 2024

Completely agree @petertsu , but unfortunately log4net is a "third-party" library on this project.

Maybe you can propose it as an enhancement on the log4net repo: https://github.com/apache/logging-log4net.

from microsoft.extensions.logging.log4net.aspnetcore.

IqraMunir5 avatar IqraMunir5 commented on July 4, 2024

Hi, I have been trying to deploy web API on Lambda AWS but every time I get this error in publishing on AWS.
error NU1605: Detected package downgrade: System.Net.Primitives from 4.3.0 to 4.0.11. Reference the package directly from the project to select a different version.
error NU1605: log4net 2.0.8 -> System.Net.Sockets 4.1.0 -> runtime.unix.System.Net.Sockets 4.3.0 -> System.Net.Primitives (>= 4.3.0)

from microsoft.extensions.logging.log4net.aspnetcore.

IqraMunir5 avatar IqraMunir5 commented on July 4, 2024

Thanks a lot. Adding Microsoft.NETCore.Targets v3.0.0 nuget package in my project resolved the issue.

from microsoft.extensions.logging.log4net.aspnetcore.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.