dotnet / runtime

.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.
https://docs.microsoft.com/dotnet/core/
MIT License
14.98k stars 4.66k forks source link

.NET Core Dependencies Nightmare #21156

Closed mrns closed 4 years ago

mrns commented 7 years ago

Hello, I have a .NET Core project with some net452 dependencies. As per MS documentation, a .NET Core app can run on top of net452 with no issues and indeed, I was able to get a working ,NET Core app by targeting net452. Now, I am having trouble using libraries targeted to .NET Core because some of them target netstandard1.3, some other target netcoreapp1.0 and so on, which causes incompatibility issues.

This is the case with IdentityServer4 and AWS .NET Core libraries for instance, how am I suppose to use libraries if there are so many different flavors of the same ".NET Core" apps. Is this something that can be resolved by changing some config in my project file or is this an MS design decision?

svick commented 7 years ago

Hello, I have a .NET Core project with some net452 dependencies. As per MS documentation, a .NET Core app can run on top of net452 with no issues and indeed, I was able to get a working ,NET Core app by targeting net452.

I think you can't really call that app a .Net Core app, even if you're using .Net Core tooling.

Now, I am having trouble using libraries targeted to .NET Core because some of them target netstandard1.3, some other target netcoreapp1.0 and so on, which causes incompatibility issues.

.Net Standard 1.3 is supported by .Net Framework 4.6 and newer. So, yes, you can't use a .Net Standard 1.3 library from a .Net Framework 4.5.2 project, there's no way around that.

Libraries generally should not target .Net Core 1.0. If they do, you should probably ask the maintainers to switch to .Net Standard.

This is the case with IdentityServer4 and AWS .NET Core libraries for instance

IdentityServer4 supports .Net Standard 1.4 and .Net Framework 4.5.2, so you should have no issues using it from a .Net Framework 4.5.2 project.

AWSSDK and AWSSDK.Core support .Net Framework 3.5, so there shouldn't be any issues there. AWSSDK.Extensions.NETCore.Setup, used for ASP.NET Core integration, is .Net Standard 1.3 only, even though ASP.NET Core itself supports .Net Framework 4.5.1. If that's the package that's causing you issues, you might consider asking them to add a .Net Framework version.

karelz commented 7 years ago

As per MS documentation, a .NET Core app can run on top of net452

Where did you find that information? The above holds for .NET Standard. .NET Core is one of .NET Standard implementations (also available on Linux and Mac). Technically it is a sibling to .NET Framework. That said, there is huge overlap between .NET Framework and .NET Core -- we try to keep them compatible as much as possible, but there are unique APIs in both .NET Core and in .NET Framework (and likely in Xamarin and .NET Native). Se details here: https://github.com/dotnet/standard/blob/master/docs/versions.md

tarekgh commented 7 years ago

@mrns I am closing this issue as I think you got the answers. feel free to send any follow up question or request if you have any. Thanks.