首页 > 其他 > 详细

查看Visual Studio异常内容

时间:2015-12-25 10:06:33      阅读:272      评论:0      收藏:0      [点我收藏+]

If Entity Framework throws a validation exception when saving, Visual Studio reports the message,

Validation failed for one or more entities. See ‘EntityValidationErrors’ property for more details.

But the in-built ‘View Detail’ dialog doesn’t let you drill into the EntityValidationErrors property.

To view the EntityValidationErrors collection, add the following Watch expression to the Watch window.

((System.Data.Entity.Validation.DbEntityValidationException)$exception).EntityValidationErrors

Which displays a similar to,
技术分享

 

The watch expression ‘$exception’ displays any exception thrown in the current context, even if it has not been caught and assigned to a variable.

查看Visual Studio异常内容

原文:http://www.cnblogs.com/JasonLiao/p/VisualStudioExceptionExpress.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!