close
錯誤內容:The type initializer for 'your class Name' threw an exception
發生原因:
1.因為想從web.Config 取得<appsettings>參數值的時候,Web.config 卻沒有設定此參數,因此造成錯誤。
2.從其它地方取得參數時,卻取到空值。
解法:
1.在web.config 補上相對應的參數名稱就可以了。
2. 用InnerException 取得更多錯誤內容,進行偵錯。
文章標籤
全站熱搜