Skip to content
This repository was archived by the owner on May 21, 2026. It is now read-only.
This repository was archived by the owner on May 21, 2026. It is now read-only.

System.Runtime.Serialization.Json nuget package error #571

Description

@rebulanyum

Hello.

I've started to use .NetCore version=1.0.0-preview2-003121 with Visual Studio 2015. My project.json file is below:

{"version": "1.0.0-*","frameworks": {"netstandard2.0": {"dependencies": {"System.Runtime.Serialization.Xml": "4.3.0","System.Runtime.Serialization.Json": "4.3.0"}}}}

My code file is below:

usingSystem.Runtime.Serialization;usingSystem.Runtime.Serialization.Json;namespaceNetCoreTests{publicclassClass1{publicClass1(){XmlObjectSerializerser=newDataContractJsonSerializer(typeof(int));}}}

And this is the error I get when I try to build the solution:

CS0029	Cannot implicitly convert type 'System.Runtime.Serialization.Json.DataContractJsonSerializer' to 'System.Runtime.Serialization.XmlObjectSerializer'	NetCoreTests..NETStandard,Version=v2.0

Looks like DataContractJsonSerializer class in System.Runtime.Serialization.Json nuget package doesn't inherit XmlObjectSerializer class in System.Runtime.Serialization.Xml nuget package. I can see that in general there's no dependency between these 2 nuget packages; however, if you check 4 and later versions of .Net Framework DataContractJsonSerializer always inherits from XmlObjectSerializer because as far as I know every DataContractSerializer inherits from XmlObjectSerializer. Even in this repository this inheritance exists:
https://github.com/dotnet/standard/blob/master/netstandard/ref/System.Runtime.Serialization.cs#L332

Can you please fix the nuget packages? Or what can you advice for me about this situation?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions