1
由於升級到ASP.NET MVC2,我們已經注意到了Windows應用程序事件日誌已滿的條目如下:防止Asp.net MVC2例外應用程序事件日誌
Event code: 3005
Event message: An unhandled exception has occurred.
Event time: 11/4/2010 3:29:16 PM
Event time (UTC): 11/4/2010 7:29:16 PM
Event ID: 2039870297302976340236
Event sequence: 6422
Event occurrence: 864
Event detail code: 0
...
Exception information:
Exception type: ArgumentException
Exception message: The parameters dictionary contains a null entry for parameter 'someParam' of non-nullable type 'System.Int32' for method 'System.Web.Mvc.ActionResult Index(System.String, Int32)' in 'SomeNameSpace.SomeController'. An optional parameter must be a reference type, a nullable type, or be declared as an optional parameter.
請求是壞的,所以我們得到這個錯誤。太好了,但我想在我的應用程序中處理這個問題,而不是讓它將事件日誌冒出來。有什麼建議麼?
編輯
看答案this question,這將是更明智的建立Route Constraints來處理這個問題呢?