我從來沒有見過這樣的事情。嘗試了我所能做的一切,沒有運氣搜索網絡,最後我完全不知道發生了什麼。我敢打賭,這將是一個很容易修復bug的傻瓜,儘管我沒有完全理解fif/gif關鍵問題 - 對我來說太過於超現實。'System.Web.MimeMapping'的類型初始值設定項引發異常:Item已被添加。鍵入字典:'.fif'添加鍵:'.gif'
更多信息:當前運行的MVC3(從1升級到2到3),問題是間歇性的(有時發生在網站負載上,有時需要幾分鐘或幾分鐘才能發生),直接在Visual Studio上運行網站。
任何幫助,非常感謝!
Server Error in '/' Application.
Item has already been added. Key in dictionary: '.fif' Key being added: '.gif'
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.ArgumentException: Item has already been added. Key in dictionary: '.fif' Key being added: '.gif'
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[ArgumentException: Item has already been added. Key in dictionary: '.fif' Key being added: '.gif']
System.Collections.Hashtable.Insert(Object key, Object nvalue, Boolean add) +9360827
System.Collections.Hashtable.Add(Object key, Object value) +11
System.Web.MimeMapping..cctor() +2038
[TypeInitializationException: The type initializer for 'System.Web.MimeMapping' threw an exception.]
System.Web.MimeMapping.GetMimeMapping(String FileName) +23
System.Web.StaticFileHandler.ProcessRequestInternal(HttpContext context, String overrideVirtualPath) +761
System.Web.DefaultHttpHandler.BeginProcessRequest(HttpContext context, AsyncCallback callback, Object state) +347
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +8862964
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +184
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.431
您是否考慮過展示您的代碼? – 2011-04-14 06:34:58
現在這是一個有趣的,沒有。我只能發現發生了什麼,因爲我沒有刷新頁面,而是複製了JavaScript文件的位置並從瀏覽器加載。 Visual Studio沒有發現任何問題,它只顯示上面複製問題的黃頁。我很高興分享特定的代碼段,如果有幫助,但我想不出什麼。 – Eddie 2011-04-14 10:09:40