You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The default XElement constroctor is public in corefx, but not in dotnet standard. This breaks our serialization generator for XElement type. The code will be generated based on the corefx and use the default constructor when create a new XElement instance. But it cannot compile in dotnet standard since the default public constructor doesn't exist. Need make them be consistent to unblock our scenario. Either make XElement default contructor be internal like in desktop version. Or add it in the dotnet standard.
changed the title [-]Make the default XELement contructor be public in dotnet Standard[/-][+]Make XElement serializable in netstandard[/+]on May 2, 2017
Activity
karelz commentedon May 1, 2017
@huanwu @shmao should it got into 2.0?
huanwu commentedon May 1, 2017
@karelz yes, it is 2.0
karelz commentedon May 1, 2017
Can you please also add issue type label? See triage rules for details.
danmoseley commentedon May 2, 2017
@weshaggard
krwq commentedon May 2, 2017
Previously we have have marked XElement constructor internal in the contract so that serialization worked fine - would that be sufficient?
EDIT: It already is internal - https://github.com/dotnet/corefx/blob/master/src/System.Xml.XDocument/ref/System.Xml.XDocument.Manual.cs#L14 - I guess this doesn't help
weshaggard commentedon May 2, 2017
We cannot make the constructor public in .NET Standard 2.0. We should make it internal in Core. https://github.com/dotnet/corefx/blob/master/src/System.Private.Xml.Linq/src/System/Xml/Linq/XElement.cs#L132.
krwq commentedon May 2, 2017
@huanwu - I don't see why internal wouldn't work - is it uapaot problem? Should you update rd.xml?
huanwu commentedon May 2, 2017
@krwq This impact our serialization code generator scenario. The code was generated based on corefx,. Since the default constructor for XElement is public, (https://github.com/dotnet/corefx/blob/master/src/System.Private.Xml.Linq/src/System/Xml/Linq/XElement.cs#L132)
the generated code is like
o.@MyElement = (global::System.Xml.Linq.XElement)ReadSerializable(( System.Xml.Serialization.IXmlSerializable)new global::System.Xml.Linq.XElement());
However the generated code cannot compile since the default constructor is not public in dotnet standard.
krwq commentedon May 2, 2017
@huanwu would changing it to internal fix the issue and cause proper code to get generated?
huanwu commentedon May 2, 2017
@krwq yes, it will solve our problem if you change it to internal.
[-]Make the default XELement contructor be public in dotnet Standard[/-][+]Make XElement serializable in netstandard[/+]