fsprojects / FSharp.Json

F# JSON Reflection based serialization library
Apache License 2.0
226 stars 26 forks source link

.net core build? #7

Closed bohdanszymanik closed 5 years ago

bohdanszymanik commented 6 years ago

Would be great rather than have .net core come up with the warning that FSharp.Json was restored using the .NETFramework ...

vsapronov commented 6 years ago

Hi Bohdan, I need a bit more context. Could you please describe what exactly does not work for you as expected?

bohdanszymanik commented 6 years ago

Oh - it works great! It's just that I tend to run under dotnetcore with the .net tooling and you get the warning that while the project framework is .NETCoreApp, Version=v2.0, FSharp.Json runs under the .NETFramework; the actual warning text follows:

warning NU1701: Package 'FSharp.Json 0.3.1' was restored using '.NETFramework,Version=v4.6.1' instead of the project target framework '.NETCoreApp,Version=v2.0'. This package may not be fully compatible with your project.

NullVoxPopuli commented 6 years ago

I'm also getting this warning! On this project: https://github.com/NullVoxPopuli/CryptoExchangeClient

vsapronov commented 6 years ago

Thank you for feedback. I will try to compile for dotnetcore and include into nuget pkg soon.

NullVoxPopuli commented 6 years ago

@vsapronov hey, how's it going? do you need help with anything?

vsapronov commented 6 years ago

@NullVoxPopuli I don't think I need help with anything particular. Overall F# related toolset seems to be not ready for dotnet (new structure) projects. I figured out that easiest way to port library to dotnet core is to have multi-target project in new dotnet core structure. So I already got it compiling for both netcore and netframework. But it looks like Paket and Fake does not work with it nicely yet. So I need to change scripting around packaging and releasing. It will be ready soon...

vsapronov commented 6 years ago

@NullVoxPopuli @bohdanszymanik Could you please try version 0.3.3 and let me know here if there are some issues with it on .NET Core. Just have pushed it: https://www.nuget.org/packages/FSharp.Json/0.3.3

NullVoxPopuli commented 6 years ago

it works!!!! thanks a ton! My nuget package is now fully .net core 2 :-)

Hardt-Coded commented 6 years ago

Hi there. Maybe it is possible to release a netstand2.0 version. Tell me if I am wrong, but this would cover all including .net core 2.0.

vsapronov commented 6 years ago

@DieselMeister FSharp.Json 0.3.3 is built for both .Net Core 2.0 and .Net Framework 4.5.2. Do you have any practical problem with it as 0.3.3? What is the problem?

The thing is that these multi-target projects are not fun. They are poorly supported in MS products like Visual Studio and F# tools do not make it easier. Paket and Fake are not really supportive. I spent like 3-4 evenings to make it built and published for these two platforms. So I'm not really happy to fight with tooling that Microsoft and F# community never bothered to fix. So I would like to avoid any type of work that would require build/release routine change until absolutely necessary or until MS fixes their crap. So, what is the practical problem?

Hardt-Coded commented 6 years ago

Hi. I can not use it in .net standard project files. The benefit to use netstandard 2.0 is, that this works also for netcore20.

I tested it and the packaging works fine:

Thats it. Do not use Paket for packaging multiplatform projects.

Found this hint here: https://github.com/fsprojects/Paket/issues/2330

I hope it help, because your Json is excactly what i need.

vsapronov commented 6 years ago

Interesting, I will try tonight.

atadi96 commented 5 years ago

Hi! What's the status on this? You really just need to add netstandard2.0 to TargetFrameworks and publish the new version as @DieselMeister described it, and it would make a huge difference in consumability. I tried it in a fork and the project builds and all tests pass.

vsapronov commented 5 years ago

@atadi96 @DieselMeister @NullVoxPopuli Could you please take a look at release 0.3.4: https://www.nuget.org/packages/FSharp.Json/0.3.4 Now it's built only for Standard.