Olegs Jasjko
Olegs Jasjko

Reputation: 2088

System.Runtime.Serialization could not be resolved

Just as title says, trying to create ASP.NET Core application, or more correctly, migrating from RC2 to Core 1.0.

Got a second construction in project.json:

"frameworks": {
    "netcoreapp1.0": {
      "imports": [
        "dotnet5.6",
        "portable-net45+win8"
      ],
      "frameworkAssemblies": {
        "System.Runtime.Serialization": "4.0.0.0",
        "System.ServiceModel": "4.0.0.0"
      }
    }
  },

There are no problems if I remove imports and revert netcoreapp1.0 to net451 (just like it was before migration attempt) but in the current state I am receiving two issues:

NU1001  The dependency System.Runtime.Serialization >= 4.0.0 could not be resolved.
NU1001  The dependency System.ServiceModel >= 4.0.0 could not be resolved.

I also cant just remove them and hope that nothing will happen because after removal, I am receiving a bunch of are you missing an assembly reference issues.

What possibly am I missing to fix this issue?

EDIT

Tried to add to dependecies System.Runtime.Serialization.Primitives. Well, it worked out exactly as if I removed System.Runtime.Serialization.

In project I got such issues as:

The type or namespace name 'Mime' does not exist in the namespace 'System.Net' (are you missing an assembly reference?)
The type or namespace name 'ServiceModel' does not exist in the namespace 'System'

and others

Upvotes: 2

Views: 2023

Answers (1)

Liam
Liam

Reputation: 29654

A quick google search shows

this GitHub issue

According to a Microsoft blog post, binary serialization was purposefully removed from .NET Core, yet the namespace for it is still documented.

Answer from there:

Binary serialization was removed, but the types listed are still included. According to package search, a lot of the types are in the System.Runtime.Serialization.Primitives package. And after adding "System.Runtime.Serialization.Primitives": "4.1.0-beta-23516" to dependencies in project.json, using System.Runtime.Serialization; compiles fine for me.


It appears System.ServiceModel hasn't made it to Core yet, quote below:

System.ServiceModel hasn't been ported to ASP.NET 5 yet so you can't use it as part of the core library.

You should be able to include the reference for a standard aspnet50 project (Not core).

Upvotes: 3

Related Questions