Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I Can't find [Serializable] in DNX Core 5.0

I Can't find [Serializable] in DNX Core 5.0 I try with 'using System'. Its working for DNX 4.5.1 but not for 5.0 What packages should I add to make this work?

        [Serializable]
        public class WorkItem
        {
        }

My Project json

{
  "webroot": "wwwroot",
  "version": "1.0.0-*",

  "dependencies": {
    "Microsoft.AspNet.Server.IIS": "1.0.0-beta7",
    "Microsoft.AspNet.Server.WebListener": "1.0.0-beta7",
    "_my.DataAccess.Common": "1.0.0-*",
    "_my.DependencyInjection.Common": "1.0.0-*",
    "System.Runtime.Serialization": "4.0.0.0"
  },

  "commands": {
    "web": "Microsoft.AspNet.Hosting --config hosting.ini"
  },

  "frameworks": {
    "dnx451": {
      "frameworkAssemblies": {
        "System.Runtime.Serialization": "4.0.0.0"
      }
    },
    "dnxcore50": { }
  },

  "publishExclude": [
    "node_modules",
    "bower_components",
    "**.xproj",
    "**.user",
    "**.vspscc"
  ],
  "exclude": [
    "wwwroot",
    "node_modules",
    "bower_components"
  ]
}
like image 398
Raskolnikov Avatar asked Nov 10 '22 03:11

Raskolnikov


1 Answers

I got the same issue and tried DataContract attribute it worked for me.

like image 139
Rahul Sonone Avatar answered Nov 14 '22 22:11

Rahul Sonone