码迷,mamicode.com
首页 > 其他好文 > 详细

查看Visual Studio异常内容

时间:2015-12-25 10:09:26      阅读:170      评论: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
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!