2016-07-26 24 views
-2

我有一個WebApi 2服務設置。它一直在美麗的工作。無法爲「System.Web.UI.BaseParser的類型初始值設定項引發內部異常」引發異常。「

但我做了什麼(我似乎無法找出)導致它,當我瀏覽到index.html或我的任何服務的行爲給予以下異常頁面:

Parser Error

Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.

Parser Error Message: The type initializer for 'System.Web.UI.BaseParser' threw an exception.

Source Error:

Line 1: <%@ Application Codebehind="Global.asax.cs" Inherits="WebHost.WebApiApplication" Language="C#" %>

即使我認爲我在調試器中運行,Visual Studio也沒有突破執行(就像異常被捕獲並拋出一樣)。

我在Global.asax.cs的第一行放了一個斷點,其編號爲Application_Start(),並且沒有命中。

我不知道如何生成屏幕,所以我不知道如何看到內部的異常,看看到底發生了什麼。

關於什麼是錯的或我如何看到內部異常的任何想法?

+0

第一件事,第一,你有你所有的例外設置爲「打破時,將引發?」在Visual Studio中按Ctrl + Alt + E,並確保選中公共語言運行時例外 –

+0

@ 2位 - 我打開了所有常見的語言運行時異常。但它從來沒有打破任何東西。一定是一個小故障。當我重新啓動Visual Studio時,錯誤不會再現。 – Vaccano

回答

0

我重新啓動Visual Studio和該固定它....

相關問題