-
Notifications
You must be signed in to change notification settings - Fork 387
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
Migrate UnitsNet + Serialization projects to "VS2017-style" projects targeting netstandard1.0 #257
Conversation
Fix an EOL issue in the tests by the way.
Wow, you put in some solid effort here. I'll need some time to review it, but I like the approach you go with here and simplifying things. I must say, I gave a puny attempt at converting to MSBUILD 15 / VS2017 not long ago, but I was met with all sorts of trouble I could not make sense of at the time and my heart was just not in it to figure it out. |
Thanks. Msbuild 15 is still a mess, especially when it comes to documentation, but it starts to improve slightly, and I had to dig through for another project anyway. ;) Meantime I managed to test the setup using VS 2017 and add the "net35" target for both UnitsNet and the serialization project. The "uap" target for windows runtime should in theory als work, but gives an error, probably related to this. |
Cool. I just upgraded the NUnit3 stuff and fixed the compile errors. https://github.com/anjdreas/UnitsNet/tree/pr/257-vs2017 This works:
Currently trying to get tests running from command line using https://github.com/nunit/dotnet-test-nunit |
With your latest changes, I'm getting errors
It seems related to this: It seems to me targeting .NET 3.5 is not supported by the dotnet CLI yet? |
Signing off for tonight 😴 |
You now should be a collaborator on the fork. Regarding net35: Yes, doesn't seem to work with the "dotnet" command-line, but you can build the whole solution from within visual studio 2017, it will generate both the .NET 3.5 and .NET Standard 1.0 DLLs. To build with the |
By the way, if I correctly read the .NET standard table, there's no need to build a DLL targeting win81, win10 or uap because they are compatible with .NET standard 1.0? |
You are probably referring to the It is a very special kind of beast, basically it imposes a lot of restrictions on the public API in order to be consumed by WinJS and C++ UWP apps. If I understand the table right, it does not address Windows Runtime Components in terms of netstandard - and it makes senses, since the restrictions are in addition to what .NET API surface you can expect. |
Ok, I thought WinRT and UWP are more or less the same. According to this site, "you can consider [UWP] as an successor of the WinRT" ... so maybe one could consider dropping WinRT support in future versions anyway? |
I totally understand your confusion, Microsoft messed up the namings in a big way. WinRT -> UAP -> UWP. So, people who write UWP apps in javascript can take a dependency on Units.NET and use it for conversions etc - directly from javascript. It's pretty cool on the technical side of things, but I'm not sure how widely used it is. There are some sample WinJS/C++/c# UWP apps in the repo to test this. |
I created a new branch https://github.com/supermihi/UnitsNet/compare/vs2017?expand=1 |
Made a little bit of progress. Started rebuilding a So far I've approached this by using .NET Core test projects for Anyhow, feel free to continue on this work. I'll see if I can find some time this weekend. |
As far as I understand, with |
Overview
This PR resolves #255:
UnitsNet.Serialization.JsonNet
UnitsNet.NetStandard10.csproj
to current .NET core / "VS2017-style" toolset format (was necessary to get 1. running)netcoreapp1.1
project for the serialization unit testsUnitsNet.Core.sln
that references only the abovementioned project that are compatible with dotnet core (and hence support cross-platform build).Notes
The new
csproj
-Format is much more compact than the other and can be used for various target frameworks at once: I haven't included this yet because I only have a linux machine at hand right now so I cannot test, but using VS 2017 it should be possbile to add net35 and uap10 target frameworks to the respective.NetStandard10.csproj
-files which would allow to remove all the other projects.Further, since one now can build NuGet packages directly from a new-style
csproj
(usingdotnet pack
on the CLI or the "pack" option in VS 2017) the "boilerplate" of this repository could probably be further simplified.Known Limitation
UnitsNet.Tests
does not yet work with .NET core because it needs to be migraed to NUnit 3 first. I could not figure out (without a windows machine) how the code generation works, so I did not touch that test project yet. I'll be happy to help with the migration but wanted to await the feedback to this PR first.