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

Migrate to VS2017 /MSBuild15 / .NET Standard / .NET Core #261

Merged
merged 16 commits into from
Jun 11, 2017
Merged

Migrate to VS2017 /MSBuild15 / .NET Standard / .NET Core #261

merged 16 commits into from
Jun 11, 2017

Conversation

supermihi
Copy link
Contributor

@supermihi supermihi commented Jun 3, 2017

This PR resolves #255. See #257 for initial discussion.

TODO:

  • Verify Net35 project can be removed
  • Verify Portable40 project can be removed
  • Verify signed packages "just work" when upgrading to new package (key file was converted)
  • Set up build and tests for UnitsNet.WindowsRuntimeComponent (not sure yet if dotnet CLI compatible)
  • See if UnitsNet.sln can be removed or renamed to UnitsNet.WindowsRuntimeComponent.sln if that is the only project that is not compatible with dotnet CLI.
  • Set up .xml output for tests to \Artifacts\Logs\<TestProjectName>.xml files, currently blocked by NUnit support in dotnet CLI. XUnit seems to have found a workaround, so either wait for NUnit to do the same or switch to XUnit.
  • Update README on new build targets (net35, netstandard1.0, WindowsRuntimeComponent)

@angularsen
Copy link
Owner

Fixes #262 when merged.

@angularsen
Copy link
Owner

angularsen commented Jun 5, 2017

Slowly moving towards completion. I spent some time redoing all the build scripts, but it now properly builds, tests, packs and publishes nugets via Appveyor CI.

https://www.nuget.org/packages/UnitsNet/3.65.0-alpha1
https://www.nuget.org/packages/UnitsNet.Signed/3.65.0-alpha1

@supermihi
Copy link
Contributor Author

Wow, now you put some effort into this! :) Would you mind pushing the current alpha version of the serialization package to nuget, because there's currently no version on nuget that works with dotnet core?

@angularsen
Copy link
Owner

I had some issues building, but just pushed some manual nugets out now. They are prerelease versions -alpha3.

I must say, this whole vs2017 journey has not been entirely pleasant. It took a lot more time plow through than I'd like to admit, but I do like a lot of the concepts that dotnet CLI brings.

@angularsen
Copy link
Owner

Currently running into this issue: microsoft/vstest#445 (comment)

Tests refuse to run when the output dir is changed using <BaseIntermediateOutputPath> in the test project, and it is needed due to having multiple test projects in the same folder to share the source code.
Sigh.

@supermihi
Copy link
Contributor Author

Sorry that I sort of "tricked" you into this effort. ;-) I naively assumed that it would be sufficient to remove a few lines in the *.csproj files and be happy with it. But I think it's worth the effort, as you say the direction Microsoft is heading with the dotnet CLI and the .NET Standard is a good one, though at the moment tooling and documentation ase pure chaos.

If there's any specific task you need help with please let me know; unless it's fixing the code-gerenating/build/pack/sign scripts, since I don't know Powershell and don't want to learn it ATM. :)

@angularsen
Copy link
Owner

Hah, no worries :-) It would have to be done at some point anyway, and your effort really helped get over those initial roadblocks, so thanks for that!
Did the nugets work out as expected?

@supermihi
Copy link
Contributor Author

Yes, I'm using the alpha version including JsonNet serialization in a dotnetcore app, works like a charm. Thanks!! :)

@angularsen
Copy link
Owner

angularsen commented Jun 8, 2017 via email

supermihi and others added 16 commits June 11, 2017 22:42
Fix an EOL issue in the tests by the way.
* dotnet CLI to build, test and pack nugets
* msbuild for WindowsRuntimeComponent projects (dotnet not supported)
* Xunit instead of Nunit
…ossible

* Add NetStandard10.Signed
* Add UnitsNet.Serialization.JsonNet.Signed
* Remove Portable40 (replaced by netstandard)
* Remove Net35 (merged into NetStandard10)
* Move test projects into their own folders ('dotnet xunit' requires it)
* Convert UnitsNet.Tests to .NET Core
* Convert WindowsRuntimeComponent-Net45 to .NET Core (and rename to .ForTests)
From NUnit. Needed to transition to 'dotnet xunit', since 'dotnet test' is
very limited right now and NUnit does not have a similar solution yet.
Can always revert back, but there seems to be more push around xunit these days.
Squashed the intermediate alpha1-2 commits
Squashed alpha1-2 commits
@angularsen angularsen merged commit c1ebee3 into angularsen:master Jun 11, 2017
@angularsen angularsen deleted the vs2017 branch June 11, 2017 21:17
@angularsen
Copy link
Owner

Merged! Phew.. a lot of hurdles on the windows runtime component stuff, as well as nunit and xunit with the new dotnet test and dotnet xunit commands. Did not like having multiple test projects in the same folder for one thing.

Thanks a lot for putting in the effort here. Hopefully this is now fairly future proof and not too many things change when dotnet CLI 2.0 goes RTM.

@supermihi
Copy link
Contributor Author

Thank you as well for finishing this! I can only hope that Microsoft's approach with .NET standard will help to simplify multi-target libraries in the future ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Serialization with .NET core / .NET standard
2 participants