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

[WIP] netstandard support #171

Merged
merged 3 commits into from
Mar 28, 2017
Merged

[WIP] netstandard support #171

merged 3 commits into from
Mar 28, 2017

Conversation

ViktorHofer
Copy link
Contributor

@ViktorHofer ViktorHofer commented Mar 21, 2017

I certify that I own, and have sufficient rights to contribute, all source code and related material intended to be compiled or integrated with the source code for the SharpZipLib open source product (the "Contribution"). My Contribution is licensed under the MIT License.

.NET Standard support. Currently 3 tests are failing with netcore2.0.
appveyor also needs to be adjusted. some links maybe too? please contribute!

#106 (comment)

@McNeight McNeight merged commit be53259 into icsharpcode:master Mar 28, 2017
@McNeight
Copy link
Contributor

@ViktorHofer

Thank you for your contribution.

-Neil

@christophwille
Copy link
Member

@ViktorHofer I just grabbed latest and ran it in VS2017 - correct that .Tests doesn't compile and .netcore2.0 fails the restore for Bootstrapper?

@ViktorHofer
Copy link
Contributor Author

ViktorHofer commented Mar 28, 2017

@christophwille Tests do compile. Just quite different as before with a console wrapper around it as nunit does not support netcoreapp yet. As mentioned 3 tests are failing right now. I had no restore errors...

@McNeight Thanks for the fine words, but I didn't expect you to merge it instantly as I marked it with WIP - Work in Progress. I did most of the work for porting it to netstandard but there are still some rough parts that need to be fixed --> see the issue.

@christophwille
Copy link
Member

Ok, then something is different in my setup because it doesn't (clean checkout, rtm vs2017):

Restoring NuGet packages...
To prevent NuGet from restoring packages during build, open the Visual Studio Options dialog, click on the Package Manager node and uncheck 'Allow NuGet to download missing packages during build.'
Unable to resolve 'Microsoft.NETCore.App (>= 2.0.0-beta-001791-00)' for '.NETCoreApp,Version=v2.0'.
Unable to resolve 'Microsoft.NETCore.App (>= 2.0.0-beta-001791-00)' for '.NETCoreApp,Version=v2.0'.
NuGet package restore failed.
1>------ Rebuild All started: Project: ICSharpCode.SharpZipLib, Configuration: Debug Any CPU ------
1>Checksum\BZip2Crc.cs(36,24,36,30): warning CS0414: The field 'BZip2Crc.crcXor' is assigned but its value is never used
1>ICSharpCode.SharpZipLib -> D:\GitWorkspace\SharpZipLib\src\ICSharpCode.SharpZipLib\bin\Debug\netstandard1.3\ICSharpCode.SharpZipLib.dll
1>Done building project "ICSharpCode.SharpZipLib.csproj".
2>------ Rebuild All started: Project: ICSharpCode.SharpZipLib.Tests, Configuration: Debug Any CPU ------
2>Zip\ZipTests.cs(4,47,4,53): error CS0234: The type or namespace name 'Binary' does not exist in the namespace 'System.Runtime.Serialization.Formatters' (are you missing an assembly reference?)
2>TestSupport\Streams.cs(61,24,61,29): error CS0115: 'TrackedMemoryStream.Close()': no suitable method found to override
2>TestSupport\Streams.cs(428,24,428,29): error CS0115: 'WindowedStream.Close()': no suitable method found to override
2>Done building project "ICSharpCode.SharpZipLib.Tests.csproj" -- FAILED.
3>------ Rebuild All started: Project: ICSharpCode.SharpZipLib.TestBootstrapper, Configuration: Debug Any CPU ------
3>C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Sdks\Microsoft.NET.Sdk\build\Microsoft.PackageDependencyResolution.targets(154,5): error : Unexpected dependency 'Microsoft.NETCore.App' with no version number.
3>C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Sdks\Microsoft.NET.Sdk\build\Microsoft.PackageDependencyResolution.targets(154,5): error : Unexpected dependency 'Microsoft.NETCore.App' with no version number.
3>C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(1964,5): warning MSB3277: Found conflicts between different versions of the same dependent assembly that could not be resolved. These reference conflicts are listed in the build log when log verbosity is set to detailed.
3>CSC : error CS0006: Metadata file 'D:\GitWorkspace\SharpZipLib\test\ICSharpCode.SharpZipLib.Tests\bin\Debug\netcoreapp2.0\ICSharpCode.SharpZipLib.Tests.dll' could not be found
3>Done building project "ICSharpCode.SharpZipLib.TestBootstrapper.csproj" -- FAILED.
========== Rebuild All: 1 succeeded, 2 failed, 0 skipped ==========

@dpethes
Copy link

dpethes commented May 3, 2017

Also, doesn't this break support for older VS versions?

@ViktorHofer
Copy link
Contributor Author

Yes, definitely breaks compatibility with older versions as .NET Standard and .NET Core tooling isn't available (despite a pre-release version) before VS 2017.

@christophwille
Copy link
Member

http://www.alteridem.net/2017/05/04/test-net-core-nunit-vs2017/ would that help us in any way to make it work better?

@christophwille
Copy link
Member

@ViktorHofer I used VS2017 U3 to update to preview2. Builds & runs now. Do you happen to know if there now would be a better Core-way of running NUnit tests?

@christophwille
Copy link
Member

@ViktorHofer also in the vein of Unit Test questions: the currently failing three ones - did those come from the replatforming / changes? Because I don't see those failures on @McNeight older builds.

@ViktorHofer
Copy link
Contributor Author

@christophwille again as I mentioned several times already, I intended to help porting the library to netstandard but nothing besides that. I was surprised when I saw my PR already merged as I mentioned issues of my port. I currently can't spend any time on this project. You might try to resolve the test failures on your own...

I used VS2017 U3 to update to preview2. Builds & runs now. Do you happen to know if there now would be a better Core-way of running NUnit tests?

This is a better question for the nunit team. I did a quick research and it seems there is an alpha version of nunit for VS2017 with the sdk project format out now: https://github.com/nunit/nunit3-vs-adapter/releases/tag/3.8-alpha1

@christophwille
Copy link
Member

@ViktorHofer NUnit now running smoothly, test failures resolved (not really netstandard-related as it turned out).

@ViktorHofer
Copy link
Contributor Author

Perfect, glad to here that :)

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.

4 participants