阅读背景:

Json。NET说,“操作可能会破坏。NET 4下的运行时”,而不是。NET 3.5下的运行时

来源:互联网 

This code:

这段代码:

namespace ConsoleApplication3
{
    class Program
    {
        static void Main(string[] args)
        {
            var client = new WebClient();
            client.Headers.Add("User-Agent", "Nobody");
            var response = client.DownloadString(new Uri("https://www.hanselman.com/smallestdotnet/json.ashx"));

            var j = JsonConvert.DeserializeObject<SmallestDotNetThing>(response);
        }

        public class SmallestDotNetThing
        {
            public DotNetVersion latestVersion { get; set; }
            public List<DotNetVersion> allVersions { get; set; }
            public List<DotNetVersion> downloadableVersions { get; set; }
        }

        public class DotNetVersion
        {
            public int major { get; set; }
            public int minor { get; set; }
            public string profile { get; set; }
            public int? servicePack { get; set; }
            public string url { get; set; }
        }

    }
}
namespace ConsoleApplicati



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: