riskfirst / riskfirst.hateoas

Powerful HATEOAS functionality for .NET web api
MIT License
78 stars 25 forks source link

Multi-Targeting Support For .Net Framework 4.5.1 #6

Closed adamrodger closed 7 years ago

adamrodger commented 7 years ago

This library currently only supports .Net Standard 1.6 which means it is currently unusable on the full .Net Framework.

However, all of the dependencies of this project support multi-targeting .Net Framework 4.5.1. I can't raise a Pull Request for this right now, but the required changes are:

In RiskFirst.Hateoas.csproj, change TargetFramework to:

<TargetFrameworks>netstandard1.6;net451</TargetFrameworks>

In SelfLinkRequirement.cs, change Task.CompletedTask to Task.FromResult(true) (the former is only available in .Net 4.6+ whereas the latter is pretty much equivalent but works in .Net 4.5 also).

jamiecoh commented 7 years ago

Thanks for the issue/request. I'm just considering whether targeting netstandard1.2 would suffice, as (according to https://docs.microsoft.com/en-us/dotnet/standard/net-standard) this is compatible with .NET 4.5.1

adamrodger commented 7 years ago

I don't think you'll be able to do that because some of your dependencies only support either .Net standard 1.6 or .Net Framework 4.5.1+. When you set your target framework to .Net Standard 1.2 and try to do a dotnet restore it'll say it can't find packages which target netstandard1.2 and fail.

jamiecoh commented 7 years ago

v1.1.1 should be available on nuget in a few minutes. Thanks again for the improvement - let me know if you have any issues.