首先了解背景:我在 Windows 10 Pro 笔记本电脑上的 Visual Studio 2015(最新的 nuget 6.1.3 指向本地 SQL Server 2014 SP1 Express 数据库)中有一个数据库优先的 EF6 模型。在我从 Windows 8.1 和 Visual Studio 2013 升级后。大约 6 个月前,我也从 EF5 升级了模型,但我认为这不相关,因为我也尝试过从头开始重建。
该模型:由大约 100 个表、50 个视图和 250 个关联组成。
问题是每次我想要更改我的模型时,在.edmx
图导致 Visual Studio 在几分钟内无响应。我已将所有内容移至另一个图表(大多数情况下没有关联的视图)上,该图表不存在此问题,因此我假设关联的数量是问题所在。其中大部分是从数据库中提取的必需外键关联。然而,连接 3 个 FK 关联以查看我的主图表需要大约半个小时。我可以理解模型中的实体是否存在限制,但我无法理解为什么只需单击图表就会使 Visual Studio 变得无响应。任务管理器显示 CPU 使用率很高,但没有磁盘使用。
单击任何实体都可以,移动它们或编辑它们也可以。问题是单击背景画布。
我已开始通过模型浏览器从数据库更新模型,但我无法使用右键单击图表来创建新关联。
我在任何地方都没有看到任何关于这个问题的评论。有任何原因或解决方法的建议吗?
顺便说一句,我刚刚重新安装了 Windows 10 Pro,只安装了 SQL Server 2014 SP1 Express 和 Visual Studio 2105 Pro。所以我的系统上没有任何自定义内容。
更新:当 DevEnv.exe 变得无响应时,ProcDump 提供此堆栈跟踪,建议本机代码搜索图形对象:
[External Code]
[Managed to Native Transition]
Microsoft.VisualStudio.Modeling.Sdk.Diagrams.GraphObject.14.0.dll!<Module>.GeoSCursor.search(GeoSCursor* value)
Microsoft.VisualStudio.Modeling.Sdk.Diagrams.GraphObject.14.0.dll!Microsoft.VisualStudio.Modeling.Diagrams.GraphObject.VGGraph.GetObjectsInRect(LRECT bbox, Microsoft.VisualStudio.Modeling.Diagrams.GraphObject.VGLayoutObjectList items, VSGLayoutObject** ignoreItems, int numberItems, int numbertypes, int* types, bool searchSubGraphs)
Microsoft.VisualStudio.Modeling.Sdk.Diagrams.GraphObject.14.0.dll!Microsoft.VisualStudio.Modeling.Diagrams.GraphObject.VGGraph.GetObjectsInRect(LRECT bbox, Microsoft.VisualStudio.Modeling.Diagrams.GraphObject.VGLayoutObjectList items, VSGLayoutObject** ignoreItems, int numberItems, int numbertypes, int* types, bool searchSubGraphs)
Microsoft.VisualStudio.Modeling.Sdk.Diagrams.GraphObject.14.0.dll!Microsoft.VisualStudio.Modeling.Diagrams.GraphObject.VGGraph.get_ObjectsInRectangle(double x0, double y0, double x1, double y1, bool searchSubGraphs)
Microsoft.VisualStudio.Modeling.Sdk.Diagrams.14.0.dll!Microsoft.VisualStudio.Modeling.Diagrams.GraphWrapper.HitTest(Microsoft.VisualStudio.Modeling.Diagrams.RectangleD hitArea, bool requireCompleteContainment, bool searchSubGraphs)
Microsoft.VisualStudio.Modeling.Sdk.Diagrams.14.0.dll!Microsoft.VisualStudio.Modeling.Diagrams.GraphWrapper.SpatialQuery(Microsoft.VisualStudio.Modeling.Diagrams.GraphWrapper.SpatialDirection direction, Microsoft.VisualStudio.Modeling.Diagrams.ShapeElement currentShape, Microsoft.VisualStudio.Modeling.Diagrams.ShapeElement parentShape)
Microsoft.VisualStudio.Modeling.Sdk.Diagrams.14.0.dll!Microsoft.VisualStudio.Modeling.Diagrams.ShapeElement.FindNextInChildShapes(Microsoft.VisualStudio.Modeling.Diagrams.ShapeElement startFromChildShape, bool focusableRequired)
Microsoft.VisualStudio.Modeling.Sdk.Diagrams.14.0.dll!Microsoft.VisualStudio.Modeling.Diagrams.ShapeAccessibleObject.GetChild(int index)
System.Windows.Forms.dll!System.Windows.Forms.AccessibleObject.GetFocused()
System.Windows.Forms.dll!System.Windows.Forms.AccessibleObject.Accessibility.IAccessible.accFocus.get()
System.Windows.Forms.dll!System.Windows.Forms.InternalAccessibleObject.System.Windows.Forms.UnsafeNativeMethods.IAccessibleInternal.get_accFocus()
UPDATE2:XtraSimplicity 有一个适用于某些人的解决方案,但不适用于我。感谢他的建议,我已将其排除为直接图形驱动程序问题。我的笔记本电脑配备了 Intel HD Graphics 系列和 NVIdia GeForce GT 750M 显示适配器。 Intel 是常见的主动适配器,但仅启用 NVidia 时也会出现该问题。我还尝试过在 Visual Studio 中禁用硬件支持的建议,但如果有什么只会让 edmx 打开时 VS 的性能变得更糟。