jsnlog icon indicating copy to clipboard operation
jsnlog copied to clipboard

Are .net core dependencies necessary for the framework version?

Open Thieum opened this issue 6 years ago • 6 comments

The 2.28.0 nuget packages defines many asp.net core, and with them .net core dependencies for the .net Framework 4.5.2 version of the package: image

Creating an empty .NET 4.7.2 web project, and adding the jsnlog dependency leads to many references warning as they are duplicates of the Framework:

image

Would it be possible to prevent those, by dropping the .net core dependencies in the Framework version ?

Thieum avatar Aug 01 '18 17:08 Thieum

Thanks for pointing this out.

I reproduced this issue with a new 4.7.1 Net Framework project. It doesn't happen with a 4.6.1 Net Framework however. Also, even if you get the warnings, it doesn't stop your application from running.

I'm not sure how to prevent these warnings. Ideally, I would code the .csproj file so that it only includes the .Net Core packages in .Net Core projects. However, there seems to be no way in .csproj files to target Net Framework or Net Core projects.

You can target Netstandard or Netframework versions in the .csproj file. However, it is perfectly legal to have a .Net Core project that uses say .Net 4.7.1. This is why when you install JSNLog in a .Net Framework project, it imports both the .Net Core packages and the .Net Framework packages.

I could introduce different Nuget packages for Net Core and Net Framework. However, I much prefer to keep the one package for maintenance reasons.

mperdeck avatar Aug 04 '18 11:08 mperdeck

I think it's related to this: https://github.com/dotnet/standard/issues/481

The thing is, I cannot switch to PackageReference as I have an asp.net project. Will keep investigating for a possible solution.

Thieum avatar Aug 06 '18 15:08 Thieum

Please introduce different nuget packages as seems to be common practice. I don't want to have to pull in and reference the 30+ .NET Core packages if I'm not using them.

ajbeaven avatar Oct 29 '18 21:10 ajbeaven

official announcement: https://github.com/aspnet/Announcements/issues/324 - ASP.NET Core 3.0 will only run on .NET Core, so you cannot have a dependency on it, if you want to serve .net framework clients as well.

Thieum avatar Oct 31 '18 15:10 Thieum

I am having a similar issue. Is there any workaround to remove the AspNetCore references?

StandBackBurrito avatar Dec 18 '20 04:12 StandBackBurrito

Potentially Also connected to #203

thompson-tomo avatar Jan 08 '24 09:01 thompson-tomo