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来处理这个问题呢?