Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Enabled XmlSerializer to Serialize XElement on UWP. - #19843

Merged
shmao merged 2 commits into
dotnet:masterfrom
shmao:19809-XElementOnUwp
May 19, 2017
Merged

Enabled XmlSerializer to Serialize XElement on UWP.#19843
shmao merged 2 commits into
dotnet:masterfrom
shmao:19809-XElementOnUwp

Conversation

@shmao

@shmao shmao commented May 16, 2017

Copy link
Copy Markdown
Contributor

After PR #19244, XmlSerializer failed to serialize XElement on UWP because the metadata info for XElement..ctor() was reduced by UWP toolchain. Although we already have rd.xml for keeping the constructor, see System.Private.Xml.Linq.rd.xml, it didn't work because the assembly has BlockReflectionAttribute and UWP toolchain would remove metadata for any non-public types/members in the assembly.

The fix is to make the constructor public on uap.

Fix #19809.

@shmao

shmao commented May 18, 2017

Copy link
Copy Markdown
Contributor Author

@krwq can you please take a look at the PR? The fix is in System.Private.Xml.Linq. Thanks!

@krwq
krwq requested a review from sepidehkh May 18, 2017 23:25

@krwq krwq left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me - @weshaggard @ericstj could you take a look if this is OK to make XElement public on UAP?

@krwq
krwq requested a review from ericstj May 18, 2017 23:36
@ericstj

ericstj commented May 18, 2017

Copy link
Copy Markdown
Member

If you're going to do this you better leave a comment for the reasoning.

@shmao
shmao force-pushed the 19809-XElementOnUwp branch from be38df0 to d2e6d4b Compare May 19, 2017 00:40
@shmao

shmao commented May 19, 2017

Copy link
Copy Markdown
Contributor Author

Sounds good. I added comments for the ifdef.

Besides, I removed System.Private.Xml.Linq.rd.xml, which was for XElement only. After the fix, the rd.xml is not needed.

/cc: @vitek-karas

@karelz karelz modified the milestone: 2.1.0 May 19, 2017
@shmao
shmao merged commit d8501cf into dotnet:master May 19, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[UWP] XElement Tests Failed

7 participants