FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Explicitly deserialize Xml without XmlSerializer (which is not AOT Friendly) by inforithmics · Pull Request #1500 · DotSpatial/DotSpatial · GitHub

Explicitly deserialize Xml without XmlSerializer (which is not AOT Friendly) - #1500

Open
inforithmics wants to merge 3 commits into
DotSpatial:masterfrom
inforithmics:RemoveUsageOfXmlSerializer
Open

inforithmics wants to merge 3 commits into
DotSpatial:masterfrom
inforithmics:RemoveUsageOfXmlSerializer

Conversation

inforithmics commented Mar 18, 2023 •
edited
Loading

Copy link
Copy Markdown
Contributor

Fixes # .

Checklist

  • I have included examples or tests
  • I have updated the change log
  • I am listed in the CONTRIBUTORS file
  • I have cleaned up the commit history (use rebase and squash)

Changes proposed in this pull request:

  • Use XmlReader to Deserialize the datums.xml is AOT and Mobile (Xamarin) friendlier.
    A further advantage of this that no XmlSerialization Assembly needs to be createde on first projection usage.
    It seems for me that the appveyor run is slightly faster after this checkin.

inforithmics force-pushed the RemoveUsageOfXmlSerializer branch 2 times, most recently from 052ad58 to 22e570d Compare March 18, 2023 14:14
Explicitly deserialize Xml without XmlSerializer (is not AOT Friendly)

improve code

improve code

ad pull request number

remove .
inforithmics force-pushed the RemoveUsageOfXmlSerializer branch from 22e570d to 2014464 Compare March 18, 2023 14:16
inforithmics changed the title Explicitly deserialize Xml without XmlSerializer (is not AOT Friendly) Explicitly deserialize Xml without XmlSerializer (which is not AOT Friendly) Mar 19, 2023

inforithmics commented Apr 17, 2023 •
edited
Loading

Copy link
Copy Markdown
Contributor Author

Here in this pull request I added a sample that shows the problem.

  1. checkout pull request.
  2. select Mapsui.Forms.slnf
  3. Set Mapsui.Forms.UWP as startup project
  4. Select Projections
  5. select Shapefile with dotSpatial projections. (does not work because an assembly is created (XmlSerializer) with is forbidden in UWP).

Selecting Mapsui.Forms.WPF as startup project the sample works.

Mapsui/Mapsui#1962

I can make a simple reproduction sample in uwp too

Copy link
Copy Markdown
Contributor

Thanks for posting this. I'll have a look at it as soon as I've got time. If I remember the compiler warnings correctly there might be more places in our code where we'll have to fix this.

inforithmics commented Apr 18, 2023 •
edited
Loading

Copy link
Copy Markdown
Contributor Author

An alternative solution would be to use the xml-serializer-generator. Which generates the xml Serialization code on compilation instead of at the runtime.

https://learn.microsoft.com/en-us/dotnet/core/additional-tools/xml-serializer-generator

But the it would produce an additional dll, which needs to be redistribouted whith the library dll (added to the nuget packge). And there might be other problems.

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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.

2 participants


Back | FazBrowse Home | New Git URL