Newtonsoft.Json設定類的屬性不序列化

來源:互聯網
上載者:User

標籤:屬性   set   serial   method   stack   參數   json   over   bapi   

參考頁面:

http://www.yuanjiaocheng.net/webapi/parameter-binding.html

http://www.yuanjiaocheng.net/webapi/action-method-returntype.html

http://www.yuanjiaocheng.net/webapi/web-api-reqresq-format.html

http://www.yuanjiaocheng.net/webapi/media-formatter.html

http://www.yuanjiaocheng.net/webapi/webapi-filters.html

 1,現象:網站應用程式程式池停止運行,系統日誌為:   1)

錯誤應用程式名稱: w3wp.exe,版本: 7.5.7601.17514,時間戳記: 0x4ce7a5f8
錯誤模組名稱: unknown,版本: 0.0.0.0,時間戳記: 0x00000000
異常代碼: 0xc00000fd
錯誤位移量: 0x36773800
錯誤進程 ID: 0x1b0c
錯誤應用程式啟動時間: 0x01d2626116b1ea92
錯誤應用程式路徑: C:\Windows\SysWOW64\inetsrv\w3wp.exe
錯誤模組路徑: unknown
報告 ID: 54a68ba9-ce54-11e6-aeff-1866dae93909

2)

問題籤名:
P1: w3wp.exe
P2: 7.5.7601.17514
P3: 4ce7a5f8
P4: *****
P5: 1.0.0.0
P6: 5865f074
P7: 72a
P8: 0
P9: System.StackOverflowException
P10:

  2,JsonConvert.SerializeObject(o, Formatting.Indented);這的時候報錯    o是一個對象。   最終報錯位置為     

public Decimal budget
{
set { _budget = value; }
get { return _budget; }
}

 未處理System.StackOverflowException Message: “System.StackOverflowException”類型的未處理的例外狀況在 *** 中發生   3,錯誤分析:Newtonsoft方法直接報錯,無法調試,難道是Newtonsoft無法序列化Decimal類型的屬性?   4,迂迴解決方案:設定budget不可被序列化。   5,跪求真正的可以序列化Decimal類型的屬性的方法

 

Newtonsoft.Json設定類的屬性不序列化

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.