close

錯誤內容:The type initializer for 'your class Name' threw an exception

發生原因:

1.因為想從web.Config 取得<appsettings>參數值的時候,Web.config 卻沒有設定此參數,因此造成錯誤。

2.從其它地方取得參數時,卻取到空值。

解法:

1.在web.config 補上相對應的參數名稱就可以了。

2. 用InnerException 取得更多錯誤內容,進行偵錯。

arrow
arrow

    阿駿 發表在 痞客邦 留言(0) 人氣()