WCF異常跟蹤調試

來源:互聯網
上載者:User

以前伺服器端有異常,老是提示

The server was unable to process the request due to an internal error. For more information about the error,
either turn on IncludeExceptionDetailInFaults (either from ServiceBehaviorAttribute or 
from the <serviceDebug> configuration behavior) on the server in order to send the exception information 
back to the client, or turn on tracing as per the Microsoft .NET Framework 3.0 SDK documentation and 
inspect the server trace logs.

這個等於沒有說,一方面這是為了安全,但是在開發階段,這個就太痛苦了。

如下的檔案

  <behavior name="calculatorServiceBehavior">
                  <serviceDebug includeExceptionDetailInFaults="true" />
          </behavior>

添加serviceDebug ,可以使異常拋到用戶端來,直接查看就可以了。

伺服器端有個異常折騰了我一天,原來是檔案找不到,要是能看到這個技巧,幾分種就搞定了。

另外,還有一個技巧,直接用Attach To Process 附加進程的辦法,把伺服器處理序加進來,也可以調試,不知道怎麼的,今天的自己真是太聰明了,這個辦法也能想到。

大部分工作的時候,精力集中,大腦缺氧,反應遲鈍,看來還是要好好休息才行。

 

工作累了就要好好休息,把工作時間縮短,提高效率。但是,老闆在你身邊,你還是要老實的幹活,沒法縮短工作時間。要是在家裡,估計8個小時的活,4個小時可以搞定,

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.