久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

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

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

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

        .Net Core 3.0 中的 IMvcBuilder AddJsonOptions 去了哪里?

        Where did IMvcBuilder AddJsonOptions go in .Net Core 3.0?(.Net Core 3.0 中的 IMvcBuilder AddJsonOptions 去了哪里?)
            1. <small id='g6plb'></small><noframes id='g6plb'>

            2. <legend id='g6plb'><style id='g6plb'><dir id='g6plb'><q id='g6plb'></q></dir></style></legend>
                <bdo id='g6plb'></bdo><ul id='g6plb'></ul>
                  <tbody id='g6plb'></tbody>
                • <i id='g6plb'><tr id='g6plb'><dt id='g6plb'><q id='g6plb'><span id='g6plb'><b id='g6plb'><form id='g6plb'><ins id='g6plb'></ins><ul id='g6plb'></ul><sub id='g6plb'></sub></form><legend id='g6plb'></legend><bdo id='g6plb'><pre id='g6plb'><center id='g6plb'></center></pre></bdo></b><th id='g6plb'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='g6plb'><tfoot id='g6plb'></tfoot><dl id='g6plb'><fieldset id='g6plb'></fieldset></dl></div>
                  <tfoot id='g6plb'></tfoot>
                • 本文介紹了.Net Core 3.0 中的 IMvcBuilder AddJsonOptions 去了哪里?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我剛剛將我的 ASP Web API 項目從 .Net core 2.0 升級到 3.0.我正在使用

                  I've just upgraded my ASP web API project from .Net core 2.0 to 3.0. I was using

                       services.AddMvc()
                               .AddJsonOptions(options =>options.SerializerSettings.ContractResolver 
                                                         = new DefaultContractResolver());
                  

                  以前是為了確保序列化 JSON 的小寫.

                  previously to ensure lower-casing of the serialized JSON.

                  升級到 3.0 后出現(xiàn)此錯誤:

                  After the upgrade to 3.0 I get this error:

                  錯誤 CS1061 'IMvcBuilder' 不包含'AddJsonOptions' 并且沒有可訪問的擴展方法 'AddJsonOptions'可以找到接受IMvcBuilder"類型的第一個參數(shù)(是您缺少 using 指令或程序集引用?)

                  Error CS1061 'IMvcBuilder' does not contain a definition for 'AddJsonOptions' and no accessible extension method 'AddJsonOptions' accepting a first argument of type 'IMvcBuilder' could be found (are you missing a using directive or an assembly reference?)

                  根據(jù) AddJsonOptions for MvcJsonOptions in Asp.Net Core 2.2 AddJsonOptions 擴展方法由 Microsoft.AspNetCore.Mvc.Formatters.Json nuget 包提供.我已經嘗試安裝/重新安裝它,但仍然無法解決該方法.有趣的是,即使我添加了 Json nuget 包,當我嘗試添加 using 語句時,智能感知僅顯示 Microsoft.AspNetCore.Mvc.Formatters.Xml.

                  According to AddJsonOptions for MvcJsonOptions in Asp.Net Core 2.2 the AddJsonOptions extension method is/was provided by the Microsoft.AspNetCore.Mvc.Formatters.Json nuget package. I have tried installing/reinstalling this but still can't resolve the method. Interestingly, intellisense only shows Microsoft.AspNetCore.Mvc.Formatters.Xml when I try to add the using statement even though I added the Json nuget package.

                  有什么想法嗎?AddJsonOptions 的 noreferrer">文檔 僅適用于 .Net 2.2,因此該方法在 3.0 中可能已被棄用,而支持其他一些配置機制?

                  Any ideas what is going on? The documentation for AddJsonOptions only goes up to .Net 2.2 so perhaps the method has been deprecated in 3.0 in favor of some other configuration mechanism?

                  推薦答案

                  作為 ASP.NET Core 3.0 的一部分,團隊默認不再包含 Json.NET.您可以在 關于 Microsoft.AspNetCore.App 的重大更改的公告.

                  As part of ASP.NET Core 3.0, the team moved away from including Json.NET by default. You can read more about that in general in the announcement on breaking changes to Microsoft.AspNetCore.App.

                  ASP.NET Core 3.0 和 .NET Core 3.0 包含不同的 JSON API,而不是 Json.NET,它更加注重性能.您可以在關于.NET Core 3.0 中 JSON 的未來"的公告中了解更多信息.

                  Instead of Json.NET, ASP.NET Core 3.0 and .NET Core 3.0 include a different JSON API that focuses a bit more on performance. You can learn about that more in the announcement about "The future of JSON in .NET Core 3.0".

                  ASP.NET Core 的新模板將不再與 Json.NET 捆綁,但您可以輕松地重新配置項目以使用它而不是新的 JSON 庫.這對于與舊項目的兼容性都很重要,也因為新庫不應該完全替代,因此您不會在那里看到完整的功能集.

                  The new templates for ASP.NET Core will no longer bundle with Json.NET but you can easily reconfigure the project to use it instead of the new JSON library. This is important for both compatibility with older projects and also because the new library is not supposed to be a full replacement, so you won't see the full feature set there.

                  為了使用 Json.NET 重新配置您的 ASP.NET Core 3.0 項目,您需要添加對 Microsoft.AspNetCore.Mvc.NewtonsoftJson 的 NuGet 引用,該包包含所有必要的位.然后,在 Startup 的 ConfigureServices 中,您需要像這樣配置 MVC:

                  In order to reconfigure your ASP.NET Core 3.0 project with Json.NET, you will need to add a NuGet reference to Microsoft.AspNetCore.Mvc.NewtonsoftJson, which is the package that includes all the necessary bits. Then, in the Startup’s ConfigureServices, you will need to configure MVC like this:

                  services.AddControllers()
                      .AddNewtonsoftJson();
                  

                  這會設置 MVC 控制器并將其配置為使用 Json.NET 而不是新的 API.除了控制器,您還可以使用不同的 MVC 重載(例如,用于具有視圖的控制器或 Razor 頁面).AddNewtonsoftJson 方法有一個重載,允許您像在 ASP.NET Core 2.x 中使用 AddJsonOptions 一樣配置 Json.NET 選項.

                  This sets up MVC controllers and configures it to use Json.NET instead of that new API. Instead of controllers, you can also use a different MVC overload (e.g. for controllers with views, or Razor pages). That AddNewtonsoftJson method has an overload that allows you to configure the Json.NET options like you were used to with AddJsonOptions in ASP.NET Core 2.x.

                  services.AddControllers()
                      .AddNewtonsoftJson(options =>
                      {
                          options.SerializerSettings.ContractResolver = new DefaultContractResolver();
                      });
                  

                  這篇關于.Net Core 3.0 中的 IMvcBuilder AddJsonOptions 去了哪里?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯(lián)網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯(lián)系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  Ignore whitespace while reading XML(讀取 XML 時忽略空格)
                  XML to LINQ with Checking Null Elements(帶有檢查空元素的 XML 到 LINQ)
                  Reading XML with unclosed tags in C#(在 C# 中讀取帶有未閉合標簽的 XML)
                  Parsing tables, cells with Html agility in C#(在 C# 中使用 Html 敏捷性解析表格、單元格)
                  delete element from xml using LINQ(使用 LINQ 從 xml 中刪除元素)
                  Parse malformed XML(解析格式錯誤的 XML)

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

                    <bdo id='bmuE5'></bdo><ul id='bmuE5'></ul>
                    <legend id='bmuE5'><style id='bmuE5'><dir id='bmuE5'><q id='bmuE5'></q></dir></style></legend>
                      <i id='bmuE5'><tr id='bmuE5'><dt id='bmuE5'><q id='bmuE5'><span id='bmuE5'><b id='bmuE5'><form id='bmuE5'><ins id='bmuE5'></ins><ul id='bmuE5'></ul><sub id='bmuE5'></sub></form><legend id='bmuE5'></legend><bdo id='bmuE5'><pre id='bmuE5'><center id='bmuE5'></center></pre></bdo></b><th id='bmuE5'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='bmuE5'><tfoot id='bmuE5'></tfoot><dl id='bmuE5'><fieldset id='bmuE5'></fieldset></dl></div>

                          • <small id='bmuE5'></small><noframes id='bmuE5'>

                            主站蜘蛛池模板: 波多野吉衣久久 | 国产一区二区精品在线观看 | 国产一区二区三区免费 | 四虎影院在线播放 | 日韩电影中文字幕 | 日本亚洲精品 | 亚洲一区二区三区在线视频 | 91精品无人区卡一卡二卡三 | 91精品国产综合久久久久久丝袜 | 欧美精品三区 | 亚洲成人av在线播放 | 国产91在线观看 | 国产精品美女久久久久aⅴ国产馆 | av黄色在线 | 欧美毛片免费观看 | 97人澡人人添人人爽欧美 | 色婷婷激情综合 | 欧美性乱 | 日韩第一区| 中文字幕1区 | 狼人伊人影院 | 精品国产免费人成在线观看 | 久久9视频 | 久久久这里只有17精品 | 狠狠操操 | 成人影院一区二区三区 | 日韩免费 | 国产精品大片 | 成人黄色a | 国产日韩欧美 | www..com18午夜观看 | 亚洲免费一区 | 国产91综合| 韩国av影院 | 久久久久国产一级毛片高清网站 | 欧美一区二区三区久久精品视 | 久久宗合色 | 亚洲一区综合 | 97精品一区二区 | 日韩精品一区二区三区中文字幕 | 国产免费av在线 |