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

Updating .net version dependency from 4.5 #866

Closed
james1301 opened this issue Jul 27, 2019 · 3 comments
Closed

Updating .net version dependency from 4.5 #866

james1301 opened this issue Jul 27, 2019 · 3 comments
Labels

Comments

@james1301
Copy link

When are you updating .net version dependency from 4.5? This version is no longer supported my Microsoft, we have recently updated to the latest .net as there is no real loss of OS support.

This may reduce the need for dependency on other nuget packages like Tasks.Extensions.

@stakx
Copy link
Contributor

stakx commented Jul 27, 2019

When are you updating .net version dependency from 4.5?

Most likely at the same time when we add a target for .NET Standard 2.1 (which isn't available just yet); i.e. sometime later this year.

This version is no longer supported my Microsoft [...]

I'm aware of that, but how exactly is this a problem in this case? Your own project (the one referencing Moq) can simply target a higher .NET Framework version, then NuGet will resolve packages relative to that.

This may reduce the need for dependency on other nuget packages like Tasks.Extensions.

I don't see how: Moq only has two dependencies: Castle.Core, and System.Threading.Tasks.Extensions. The latter has a dependency on System.Runtime.CompilerServices.Unsafe, regardless of what frameworks Moq targets.

I'm very much aware of the demand for fewer package dependencies, but our net45 target really isn't the main problem. What's much worse is that we're relying on Castle.Core which for .NET Standard is still at netstandard1.x target, which causes tons of unwanted transitive dependencies. (We're waiting on .NET Standard 2.1 to arrive, see castleproject/Core#407.) That's why Moq has a net45 target at all... to avoid these dependencies when your own project targets the .NET Framework. If it weren't for that, Moq would perhaps be a .NET Standard 2.x-only package by now.

@stakx stakx added the question label Jul 27, 2019
@james1301
Copy link
Author

Fair enough. I was just thinking that Tasks.Extensions was included in a later .net like valuetuples are so then it wouldn't require the additional nugets. But I don't think that does work the same does it?

@stakx
Copy link
Contributor

stakx commented Jul 30, 2019

I was just thinking that Tasks.Extensions was included in a later .net like valuetuples are so then it wouldn't require the additional nugets.

No, ValueTask<> is not included in the BCL of later .NET Framework versions. Suppose it were included in .NET 4.7.2's BCL, your project is targeting .NET 4.7.2 and referencing Moq. You'd get type ambiguities because ValueTask<> would now be defined several times (once by the BCL, once by the NuGet package brought in by Moq). In order to prevent this, Microsoft would typically add an empty net472 target to that NuGet package.

So, to conclude this, as far as I can see, updating Moq's target from net45 to net452 is not going to achieve anything at all regarding NuGet dependencies, regardless of whether your own project references net45 or a later .NET Framework version.

@stakx stakx closed this as completed Jul 30, 2019
@devlooped devlooped locked and limited conversation to collaborators Sep 6, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants