Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Are .net core dependencies necessary for the framework version? #174

Open
Thieum opened this issue Aug 1, 2018 · 6 comments
Open

Are .net core dependencies necessary for the framework version? #174

Thieum opened this issue Aug 1, 2018 · 6 comments

Comments

@Thieum
Copy link

Thieum commented Aug 1, 2018

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 ?

@mperdeck
Copy link
Owner

mperdeck commented Aug 4, 2018

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.

@Thieum Thieum closed this as completed Aug 6, 2018
@Thieum Thieum reopened this Aug 6, 2018
@Thieum
Copy link
Author

Thieum commented Aug 6, 2018

I think it's related to this: dotnet/standard#481

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

@ajbeaven
Copy link

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.

@Thieum
Copy link
Author

Thieum commented Oct 31, 2018

official announcement: aspnet/Announcements#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.

@StandBackBurrito
Copy link

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

@thompson-tomo
Copy link
Contributor

Potentially Also connected to #203

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants