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

Netcore2.2 #495

Closed
wants to merge 12 commits into from
Closed

Netcore2.2 #495

wants to merge 12 commits into from

Conversation

tebjan
Copy link
Contributor

@tebjan tebjan commented Jun 19, 2019

This is the branch currently used for the new nugets with major version 3. I'll keep this here so we can discuss issues and get feedback whether the nuget works.
https://www.nuget.org/packages/Svg/3.0.3-gecdc54b12b

mmosca and others added 6 commits May 10, 2019 21:12
- This build supports targeting .Net Framework 4.0 and .Netstandard2.0 allowing use of Svg library by .Net core apps.
- Solution can be built using Visual Studio 2017 Preview and .Net Core 2.0 Preview 2+
# Conflicts:
#	Tests/Svg.UnitTests/Svg.UnitTests.csproj
@mrbean-bremen
Copy link
Member

@tebjan - as far as I can see, the only difference to master here is the automatic git versioning and the version number. Is there a reason not to add this directly to master?

@mrbean-bremen
Copy link
Member

Ah, and a suggestion - I noticed that you added me to the authors, maybe you can also add H1Gdev, who did most of the latest fixes and refactoring.

@tebjan
Copy link
Contributor Author

tebjan commented Jun 19, 2019

yes, good point. indeed, the idea is to merge to master once there is some positive feedback on the nuget preview.

@gvheertum
Copy link
Member

I was wondering, does this mean that it's also non-Windows compatible? I tried building on VSCode on my Macbook, but there were still some references to Windows related libraries. Since we work with graphics for the bitmap conversion, it's plausible that Windows libs are still needed (at least until .NET Core 3, where they will possibly also port forms and all other windows specific stuff). Is that something one of you looked into already? Just wondering :)

@mrbean-bremen
Copy link
Member

This should work with MacOS and Linux, though it has not really been tested yet (see #427 for a test @thedonciuxx made under Linux). You may try that also with master, as there seems to be some problem with the pre-release branch).

@ErlendSB
Copy link

I'm hitting the NullReferenceException (#427 (comment)) when running on linux (works fine on windows). I'm guessing the commit mentioned there is not part of this version (3.0.3)?

@gvheertum
Copy link
Member

This should work with MacOS and Linux, though it has not really been tested yet (see #427 for a test @thedonciuxx made under Linux). You may try that also with master, as there seems to be some problem with the pre-release branch).

Yep, my bad. I just did a dotnet build, which tried to build both target-frameworks (including .net 4.5.2, which ofcourse will not work on a Mac). If I specify the framework dotnet build -f netcoreapp2.2 it compiles as expected (except the SVGViewer, which makes sense).

Nice job getting it ported to .NET Core! 👍

@mrbean-bremen
Copy link
Member

mrbean-bremen commented Jun 25, 2019

@ErlendSB - the commit in question is part of this branch, so this should not be the issue.
Do you have libgdiplus installed (which is a requirement under Linux)?

@mrbean-bremen
Copy link
Member

Just to put a reference here: under Linux and MacOs you need libgdiplus installed. There is a packaging project on Github that makes this easier and also contains installation instructions (copied here for convenience):

Using libgdiplus on Ubuntu Linux

You can install libgdiplus on Ubuntu Linux using the Quamotion PPA. Follow these steps:

sudo add-apt-repository ppa:quamotion/ppa
sudo apt-get update
sudo apt-get install -y libgdiplus

Using libgdiplus on macOS

On macOS, add a reference to the runtime.osx.10.10-x64.CoreCompat.System.Drawing package:

dotnet add package runtime.osx.10.10-x64.CoreCompat.System.Drawing

@gvheertum
Copy link
Member

@ErlendSB - the commit in question is part of this branch, so this should not be the issue.
Do you have libgdiplus installed (which is a requirement under Linux)?

I can imagine it's a bit confusing. The SvgDocument.Open() will in some cases ignore the gdi error and just return a null. This at least explained why together with the dll reference issues, I also had some tests failing with null pointer exceptions if the CoreCompat package is not installed. For example, the tests that use the drawing elements like the one in SvgTextTests will yield the TypeInitializationException (the do calls directly on SVG elements), while the LexerIssueTests yield a null pointer since they use the SvgDocument.Open() which seems to ignore this type of error.

I think it might be more useful for the users if we did something to catch that error and rethrow it or wrap it with a message that makes more sense to the user. In the most likely scenario's users will not work on the SVG elements, but will start by creating an SvgDocument from a string or XML.

@ErlendSB
Copy link

Installing libgdiplus fixed it.

gvheertum and others added 5 commits June 26, 2019 19:54
… a more logical message (including reference to documentation)
… the mac (by having the CoreCompat included)
Gdi+ related errors are now wrapped in a specific exception with more detailed information
@tebjan
Copy link
Contributor Author

tebjan commented Jun 27, 2019

also merged master into the netcore branch, new nuget preview is ready to test:
https://www.nuget.org/packages/Svg/3.0.9-g6ea47b4039

@tebjan
Copy link
Contributor Author

tebjan commented Jul 6, 2019

resolved by #503

@tebjan tebjan closed this Jul 6, 2019
@paulushub paulushub deleted the netcore2.2 branch December 29, 2023 02:30
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.

5 participants