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异常内容的更多相关文章

  1. 使用visual studio 2015调用阿里云oss .net sdk 2.2的putobject接口抛出outofmemory异常

    问题描述: 使用阿里云oss .net sdk 2.2版本,使用putobject接口上传文件时,抛出outofmemory异常. 原因分析: 上传时,用于准备上传的数据缓冲区内存分配失败.与应用软件 ...

  2. 最强 IDE Visual Studio 2017 正式版发布

    Visual Studio 2017 正式版发布,该版本不仅添加了实时单元测试.实时架构依赖关系验证等新特性,还对许多实用功能进行了改进,如代码导航.IntelliSense.重构.代码修复和调试等等 ...

  3. Visual Studio 2017 Enterprise (15.3)

    版本15.3更新在用户离线下载时更加人性化,包含了进度显示,下载出错可以输入R,进行下载的重新尝试,并在当前下载框下继续下载为完成的作业,结合 --layout 参数的离线文件的检查和修复,并且在下载 ...

  4. 【转】【UML】使用Visual Studio 2010 Team System中的架构师工具(设计与建模)

    Lab 1: 应用程序建模 实验目标 这个实验的目的是展示如何在Visual Studio 2010旗舰版中进行应用程序建模.团队中的架构师会通过建模确定应用程序是否满足客户的需求. 你可以创建不同级 ...

  5. 使用Visual Studio Code开发.NET Core看这篇就够了

    作者:依乐祝 原文地址:https://www.cnblogs.com/yilezhu/p/9926078.html 在本文中,我将带着大家一步一步的通过图文的形式来演示如何在Visual Studi ...

  6. Create A .NET Core Development Environment Using Visual Studio Code

    https://www.c-sharpcorner.com/article/create-a-net-core-development-environment-using-visual-studio- ...

  7. 微软发布Visual Studio Online公共预览版和ML.NET 1.4

    在今天的Ignite 2019上,Microsoft启动了 Visual Studio Online 公共预览版.Visual Studio Online将Visual Studio,云托管的开发人员 ...

  8. Visual Studio中的主题定制变得更加容易

    有时Visual Studio的默认主题是不够的.幸运的是,我们刚刚重新设计了创建和导入自定义主题的过程. 导入主题的唯一方法之一是下载旧的Color Theme Editor扩展.如果你足够勇敢地创 ...

  9. Visual Studio 2017 针对移动开发的新特性介绍

    欢迎大家持续关注葡萄城控件技术团队博客,更多更好的原创文章尽在这里~~ Visual Studio是世界上最好的IDE之一,如果是 .NET世界,那就没有之一了(^_^),而最近推出的Visual S ...

随机推荐

  1. linux编译c文件

    1.创建.c文件,比如在firstmake文件夹创建了一个a.c文件,那么编译语句为: gcc -o firstmake a.c //格式为文件夹名 文件名 2.然后就会生成一个firstmake.o ...

  2. autolayout sizeclass 资料集锦

    http://www.raywenderlich.com/20881/beginning-auto-layout-part-1-of-2 Core Animation Programming Guid ...

  3. 一个简单的app自动登录Python脚本案例

  4. Android上传图片到服务器

    一.android需要导入异步请求的jar包 AsyncHttpClient  public static void reg(final Context cont,Bitmap photodata,S ...

  5. Java中长度为0的数组与null的区别

    有如下两个变量定义,这两种定义有什么区别呢? 1. int[] zero = new int[0]; 2. int[] nil = null; zero是一个长度为0的数组,我们称之为“空数组”,空数 ...

  6. 点击其它地方DIV隐藏

    $(document).bind('click',function(e){ var e = e || window.event; //浏览器兼容性 var elem = e.target || e.s ...

  7. C# 将对象保存为文件 读取文件并转为对象 压缩文件 解压缩文件

    using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.I ...

  8. RealProxy深入

    Program.cs class Program { static void Main(string[] args) { NoMethodLogging(); Console.WriteLine(&q ...

  9. python 抓取百度音乐

    # coding:utf-8 import urllib2 import re import urllib import chardet from json import * category = ' ...

  10. python中try except执行顺序

    python中try except finally的执行顺序 先执行try中语句 如果try中抛出异常, 执行异常中语句. 如果try 或 except 中没有return语句,执行完try 或者 e ...