{"action":"created","issue":{"url":"https://api.github.com/repos/JamesNK/Newtonsoft.Json/issues/505","labels_url":"https://api.github.com/repos/JamesNK/Newtonsoft.Json/issues/505/labels{/name}","comments_url":"https://api.github.com/repos/JamesNK/Newtonsoft.Json/issues/505/comments","events_url":"https://api.github.com/repos/JamesNK/Newtonsoft.Json/issues/505/events","html_url":"https://github.com/JamesNK/Newtonsoft.Json/issues/505","id":60472330,"number":505,"title":"Error when deserializing static variable","user":{"login":"kassemshehady","id":3023747,"avatar_url":"https://avatars.githubusercontent.com/u/3023747?v=3","gravatar_id":"","url":"https://api.github.com/users/kassemshehady","html_url":"https://github.com/kassemshehady","followers_url":"https://api.github.com/users/kassemshehady/followers","following_url":"https://api.github.com/users/kassemshehady/following{/other_user}","gists_url":"https://api.github.com/users/kassemshehady/gists{/gist_id}","starred_url":"https://api.github.com/users/kassemshehady/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kassemshehady/subscriptions","organizations_url":"https://api.github.com/users/kassemshehady/orgs","repos_url":"https://api.github.com/users/kassemshehady/repos","events_url":"https://api.github.com/users/kassemshehady/events{/privacy}","received_events_url":"https://api.github.com/users/kassemshehady/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-03-10T09:35:14Z","updated_at":"2015-03-13T11:22:54Z","closed_at":null,"body":"# The code below contains a test that fails after deserializing an object.\r\n*Knowing that without the initialization of the [Status] property in the two constructors (program,episode) the problem disappears!*\r\n ```C#\r\n[TestClass]\r\n    public class JsonSerilizeEnumerationTest\r\n    {\r\n        [TestMethod]\r\n        public void TestMethod1()\r\n        {\r\n            var ep = new Episode\r\n            {\r\n                Name = \"episode1\",\r\n                Status = Enumeration.Published,\r\n                Program = new TvProgram\r\n                {\r\n                    Name = \"program1\",\r\n                    Status = Enumeration.Published\r\n                }\r\n            };\r\n            Assert.IsTrue(Enumeration.New.Value == 10);\r\n            var converted = JsonConvert.SerializeObject(ep);\r\n            Assert.IsTrue(Enumeration.New.Value == 10);\r\n            var newObject = JsonConvert.DeserializeObject<Episode>(converted);\r\n            Assert.IsTrue(Enumeration.New.Value == 10);//This fails\r\n        }\r\n        public class TvProgram\r\n        {\r\n            public TvProgram()\r\n            {\r\n                Status = Enumeration.New;\r\n            }\r\n            public string Name { get; set; }\r\n            public Enumeration Status { get; set; }\r\n        }\r\n        public class Episode\r\n        {\r\n            public Episode()\r\n            {\r\n                Status = Enumeration.New;\r\n            }\r\n            public string Name { get; set; }\r\n            public TvProgram Program { get; set; }\r\n            public Enumeration Status { get; set; }\r\n        }\r\n        public class Enumeration\r\n        {\r\n            public static readonly Enumeration NotSet = new Enumeration(-1, \"\");\r\n            public static readonly Enumeration New = new Enumeration(10, \"New\");\r\n            public static readonly Enumeration Published = new Enumeration(20, \"Published\");\r\n            public static readonly Enumeration Ended = new Enumeration(30, \"Ended\");\r\n            public Enumeration(int value, string text)\r\n            {\r\n                Value = value;\r\n                Text = text;\r\n            }\r\n            public int Value { get; set; }\r\n            public string Text { get; set; }\r\n        }\r\n    }\r\n```"},"comment":{"url":"https://api.github.com/repos/JamesNK/Newtonsoft.Json/issues/comments/78926298","html_url":"https://github.com/JamesNK/Newtonsoft.Json/issues/505#issuecomment-78926298","issue_url":"https://api.github.com/repos/JamesNK/Newtonsoft.Json/issues/505","id":78926298,"user":{"login":"skywalkery","id":6942002,"avatar_url":"https://avatars.githubusercontent.com/u/6942002?v=3","gravatar_id":"","url":"https://api.github.com/users/skywalkery","html_url":"https://github.com/skywalkery","followers_url":"https://api.github.com/users/skywalkery/followers","following_url":"https://api.github.com/users/skywalkery/following{/other_user}","gists_url":"https://api.github.com/users/skywalkery/gists{/gist_id}","starred_url":"https://api.github.com/users/skywalkery/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/skywalkery/subscriptions","organizations_url":"https://api.github.com/users/skywalkery/orgs","repos_url":"https://api.github.com/users/skywalkery/repos","events_url":"https://api.github.com/users/skywalkery/events{/privacy}","received_events_url":"https://api.github.com/users/skywalkery/received_events","type":"User","site_admin":false},"created_at":"2015-03-13T11:22:54Z","updated_at":"2015-03-13T11:22:54Z","body":"Same the #400 "}}