2

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

Olegs Jasjko
  • 2,128
  • 6
  • 27
  • 47

1 Answers1

3

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).

Community
  • 1
  • 1
Liam
  • 27,717
  • 28
  • 128
  • 190
  • Wow... I actually was looking into System.Runtime.Serialization.Primitives but wasnt sure about its containment. Gonna try it now. – Olegs Jasjko Dec 05 '16 at 09:29
  • Tried System.Runtime.Serialization.Primitives and still got a bunch of missing assembly references. Some of them are very strange. For example, 'System.Net.Mime'. Also, System.ServiceModel are still dead – Olegs Jasjko Dec 05 '16 at 09:38
  • They've moved a lot of stuff around in Core, it's pretty much the point of it TBH (break up the System namespace, etc.). Your likely going to need to find each missing assembly manually. Also don't neccasarily expect them all to be there. Core is pretty much a re-write and it's also still a work in progress. It appears [System.ServiceModel hasn't made it to Core yet](http://stackoverflow.com/a/30263354/542251). Personally I'm not touching Core until it's a couple of iterations in, I'm old enough to remember .Net 1.0 and it's missing....features... – Liam Dec 05 '16 at 09:47
  • 1
    Well, the funny thing is that I can move dependencies into `netcoreapp` and then make `net451` in framework just to get those references... and it will work... but by doing this it makes migrating so pointless... well I guess ill wait a little bit more. Thank for answer and for your time. – Olegs Jasjko Dec 05 '16 at 09:56
  • Yeah. I mean thats what I mean. Really it's still bedding in. IMO The only time I'd explicitly use core right now is if I needed it to run on Linux. – Liam Dec 05 '16 at 09:58