<bdo id='Zw7e4'></bdo><ul id='Zw7e4'></ul>

    <i id='Zw7e4'><tr id='Zw7e4'><dt id='Zw7e4'><q id='Zw7e4'><span id='Zw7e4'><b id='Zw7e4'><form id='Zw7e4'><ins id='Zw7e4'></ins><ul id='Zw7e4'></ul><sub id='Zw7e4'></sub></form><legend id='Zw7e4'></legend><bdo id='Zw7e4'><pre id='Zw7e4'><center id='Zw7e4'></center></pre></bdo></b><th id='Zw7e4'></th></span></q></dt></tr></i><div id='Zw7e4'><tfoot id='Zw7e4'></tfoot><dl id='Zw7e4'><fieldset id='Zw7e4'></fieldset></dl></div>

    <small id='Zw7e4'></small><noframes id='Zw7e4'>

    1. <tfoot id='Zw7e4'></tfoot>
      <legend id='Zw7e4'><style id='Zw7e4'><dir id='Zw7e4'><q id='Zw7e4'></q></dir></style></legend>

      找不到方法'无效 Newtonsoft.Json.Serialization.DefaultContractRe

      Method not found #39;Void Newtonsoft.Json.Serialization.DefaultContractResolver.set_IgnoreSerializableAttribute(Boolean)(找不到方法无效 Newtonsoft.Json.Serialization.DefaultContractResolver.set_IgnoreSerializableAttribute(Boolean)) - IT屋-

        • <tfoot id='OGwST'></tfoot>
            <tbody id='OGwST'></tbody>

            <i id='OGwST'><tr id='OGwST'><dt id='OGwST'><q id='OGwST'><span id='OGwST'><b id='OGwST'><form id='OGwST'><ins id='OGwST'></ins><ul id='OGwST'></ul><sub id='OGwST'></sub></form><legend id='OGwST'></legend><bdo id='OGwST'><pre id='OGwST'><center id='OGwST'></center></pre></bdo></b><th id='OGwST'></th></span></q></dt></tr></i><div id='OGwST'><tfoot id='OGwST'></tfoot><dl id='OGwST'><fieldset id='OGwST'></fieldset></dl></div>

                <bdo id='OGwST'></bdo><ul id='OGwST'></ul>

                <small id='OGwST'></small><noframes id='OGwST'>

              • <legend id='OGwST'><style id='OGwST'><dir id='OGwST'><q id='OGwST'></q></dir></style></legend>
                本文介绍了找不到方法'无效 Newtonsoft.Json.Serialization.DefaultContractResolver.set_IgnoreSerializableAttribute(Boolean)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                限时送ChatGPT账号..

                我下载了 webapi 的示例代码,我得到了这个异常我使用 Visual Studio 2012 Ultimate Version 打开了这个示例,并且我安装了最新版本的 newtonsoft.运行此应用程序时出现此错误.编译成功.知道为什么会出现这个错误,有没有办法解决这个异常.

                I downloaded a sample code for webapi and I am getting this exception I opened this sample using Visual Studio 2012 Ultimate Version and I have latest verion of newtonsoft installed.I am getting this error when I run this application.Its compiling successfully. Any idea why this error and is there a way to resolve this exception.

                System.MissingMethodException was unhandled by user code
                  HResult=-2146233069
                  Message=Method not found: 'Void Newtonsoft.Json.Serialization.DefaultContractResolver.set_IgnoreSerializableAttribute(Boolean)'.
                  Source=System.Net.Http.Formatting
                  StackTrace:
                       at System.Net.Http.Formatting.JsonContractResolver..ctor(MediaTypeFormatter formatter)
                       at System.Net.Http.Formatting.JsonMediaTypeFormatter..ctor()
                       at System.Net.Http.Formatting.MediaTypeFormatterCollection.CreateDefaultFormatters()
                       at System.Net.Http.Formatting.MediaTypeFormatterCollection..ctor()
                       at System.Web.Http.HttpConfiguration.DefaultFormatters()
                       at System.Web.Http.HttpConfiguration..ctor(HttpRouteCollection routes)
                       at System.Web.Http.GlobalConfiguration.<.cctor>b__0()
                       at System.Lazy`1.CreateValue()
                       at System.Lazy`1.LazyInitValue()
                       at System.Lazy`1.get_Value()
                       at System.Web.Http.GlobalConfiguration.get_Configuration()
                       at System.Web.Http.RouteCollectionExtensions.MapHttpRoute(RouteCollection routes, String name, String routeTemplate, Object defaults, Object constraints, HttpMessageHandler handler)
                       at System.Web.Http.RouteCollectionExtensions.MapHttpRoute(RouteCollection routes, String name, String routeTemplate, Object defaults)
                       at WebAPIRc.RouteConfig.RegisterRoutes(RouteCollection routes) in c:UsersviemonDownloadsWebAPIRcWebAPIRcWebAPIRcApp_StartRouteConfig.cs:line 17
                       at WebAPIRc.WebApiApplication.Application_Start() in c:UsersviemonDownloadsWebAPIRcWebAPIRcWebAPIRcGlobal.asax.cs:line 36
                  InnerException: 
                

                这是失败的代码

                public class RouteConfig
                    {
                        public static void RegisterRoutes(RouteCollection routes)
                        {
                            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
                          //Exception error start
                            routes.MapHttpRoute(
                                name: "DefaultApi",
                                routeTemplate: "api/{controller}/{id}",
                                defaults: new { id = RouteParameter.Optional }
                            );
                          //exception error end
                
                            routes.MapRoute(
                                name: "Default",
                                url: "{controller}/{action}/{id}",
                                defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
                            );
                        }
                    }
                

                我知道我需要为 NuGet 打开包含预发布"来自这篇文章,但是如何开启如何开启 NuGet 的Include Prerelease"?

                I came to know that I need to turn on "Include prerelease" for NuGet from this post, but how do I turn on how to turn on the "Include Prerelease" for NuGet ?

                推荐答案

                如何开启如何开启 NuGet 的包括预发布"?

                how do I turn on how to turn on the "Include Prerelease" for NuGet ?

                要使用包含预发行版" 安装 Json.NET,请在 包管理器控制台

                To install Json.NET with "Include Prerelease", run the following command in the Package Manager Console

                Install-Package Newtonsoft.Json –IncludePrerelease
                

                这篇关于找不到方法'无效 Newtonsoft.Json.Serialization.DefaultContractResolver.set_IgnoreSerializableAttribute(Boolean)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                相关文档推荐

                Force JsonConvert.SerializeXmlNode to serialize node value as an Integer or a Boolean(强制 JsonConvert.SerializeXmlNode 将节点值序列化为整数或布尔值)
                Using JSON to Serialize/Deserialize TimeSpan(使用 JSON 序列化/反序列化 TimeSpan)
                Could not determine JSON object type for type quot;Classquot;(无法确定类型“Class的 JSON 对象类型.)
                How to deserialize a JSONP response (preferably with JsonTextReader and not a string)?(如何反序列化 JSONP 响应(最好使用 JsonTextReader 而不是字符串)?)
                how to de-serialize JSON data in which Timestamp it-self contains fields?(如何反序列化时间戳本身包含字段的JSON数据?)
                JSON.Net custom contract serialization and Collections(JSON.Net 自定义合约序列化和集合)
                  <tbody id='kUGuj'></tbody>

                1. <tfoot id='kUGuj'></tfoot>
                  • <legend id='kUGuj'><style id='kUGuj'><dir id='kUGuj'><q id='kUGuj'></q></dir></style></legend>
                      <bdo id='kUGuj'></bdo><ul id='kUGuj'></ul>

                      <small id='kUGuj'></small><noframes id='kUGuj'>

                      1. <i id='kUGuj'><tr id='kUGuj'><dt id='kUGuj'><q id='kUGuj'><span id='kUGuj'><b id='kUGuj'><form id='kUGuj'><ins id='kUGuj'></ins><ul id='kUGuj'></ul><sub id='kUGuj'></sub></form><legend id='kUGuj'></legend><bdo id='kUGuj'><pre id='kUGuj'><center id='kUGuj'></center></pre></bdo></b><th id='kUGuj'></th></span></q></dt></tr></i><div id='kUGuj'><tfoot id='kUGuj'></tfoot><dl id='kUGuj'><fieldset id='kUGuj'></fieldset></dl></div>