实体框架edmx点击图很慢 [英] Entity Framework edmx click on diagram very slow

查看:27
本文介绍了实体框架edmx点击图很慢的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

背景优先:我在 Windows 10 Pro 笔记本电脑上的 Visual Studio 2015(最新的 nuget 6.1.3 指向本地 SQL Server 2014 SP1 Express 数据库)中有一个数据库优先的 EF6 模型.在我从 Windows 8.1 和 Visual Studio 2013 升级之后.我也在大约 6 个月前从 EF5 升级了模型,但我认为这无关紧要,因为我也尝试过从头开始重建.

Background first: I have a database-first EF6 model in Visual Studio 2015 (latest nuget 6.1.3 pointing to a local SQL Server 2014 SP1 Express database) on a Windows 10 Pro laptop. After I upgraded from Windows 8.1 and Visual Studio 2013. I also upgraded the model from EF5 about 6 months ago as well, but I don't think this is relevant, as I've also tried rebuilding from scratch.

模型:包含大约 100 个表、50 个视图和 250 个关联.

The model: set of about 100 tables, 50 views and 250 associations.

问题是每次我想对我的模型进行更改时,.edmx 图上的任何类型的单击(左或右)都会导致 Visual Studio 在几分钟内无响应.我已经把我能做的一切都移到了另一个没有这个问题的图表上(大多数是没有关联的视图),所以我假设关联的数量是问题所在.其中大部分是从数据库中提取的所需外键关联.然而,连接 3 个 FK 关联以查看我的主图需要大约半小时.我可以理解模型中的实体是否存在限制,但我不明白为什么只需单击图表就会使 Visual Studio 变得无响应.任务管理器显示 CPU 使用率很高,并且没有磁盘使用.

The problem is every time I want to make changes to my model, any kind of click (left or right) on the .edmx diagram causes Visual Studio to become unresponsive for a few minutes. I've moved everything I can onto another diagram (views with no associations mostly) which does not have this problem, so I'm assuming the number of associations is the problem. Most of these are required foreign key associations pulled in from the database. It is however taking about half an hour to link up 3 FK associations for a view on my main diagram. I can understand if there is a limit on entities in a model, but I can't understand why simply clicking on the diagram should make Visual Studio become unresponsive. The task manager shows heavy CPU usage and no Disk use.

单击任何实体都可以,移动它们或编辑它们也是如此.问题在于点击背景画布.

Clicking on any of the entities is fine, as is moving them around or editing them. The problem is clicking on the background canvas.

我已经开始通过模型浏览器从数据库中更新模型,但我无法通过右键单击图表来创建新关联.

I have taken to updating the model from the database via the model browser, but I cannot get around using a right-click on the diagram to create new associations.

我在任何地方都没有看到任何关于这个问题的评论.任何原因或解决方法的建议?

I've not seen any comments about this problem anywhere. Any suggestions of cause or workarounds?

顺便说一句,我刚刚重新安装了 Windows 10 Pro,只安装了 SQL Server 2014 SP1 Express 和 Visual Studio 2105 Pro.所以我的系统上没有任何自定义.

BTW I have just reinstalled Windows 10 Pro and installed nothing but SQL Server 2014 SP1 Express and Visual Studio 2105 Pro. So there is nothing custom on my system.

更新:当 DevEnv.exe 变得无响应时,ProcDump 会提供此堆栈跟踪,建议使用本机代码搜索图形对象:

UPDATE: ProcDump provides this stacktrace when DevEnv.exe becomes unresponsive, suggesting native code search for graphic objects:

[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 有一个适用于某些人的解决方案,但不适用于我.感谢他的建议,我已将其排除为直接图形驱动程序问题.我的笔记本电脑中有英特尔高清显卡系列和 NVIdia GeForce GT 750M 显示适配器.英特尔是常用的主动适配器,但仅启用 NVidia 时也会出现问题.我也尝试过在 Visual Studio 中禁用硬件支持的建议,但如果有任何东西只会在打开 edmx 时使 VS 的性能更差.

UPDATE2: XtraSimplicity has a solution which works for some, but not me. Thanks to his suggestions I have ruled this out as a direct graphics driver issue. I have an Intel HD Graphics Family and NVIdia GeForce GT 750M display adapters in my laptop. Intel is the usual active adapter, but the problem also appears when only NVidia is enabled. I've also tried the suggestion of disabling hardware support in Visual Studio, but if anything that just makes the performance of VS when an edmx is open even worse.

推荐答案

我们在 2 台装有 Windows 10 和触摸屏的笔记本电脑上遇到了同样的问题.终止进程 TabTip.exe 似乎可以解决问题.

We had the same issue on 2 laptops with Windows 10 and touchscreens. Killing the process TabTip.exe seems to solve the issue.

来源:https://connect.microsoft.com/VisualStudio/Feedback/Details/2011437

TabTip.exe(触摸键盘和手写面板)上的任务管理器和结束进程.这样做之后,设计师会做出很好的反应.请注意,如果您单击或触摸任务栏中的键盘图标,TabTip.exe 将重新启动.

Go Task Manager and End Process on TabTip.exe (Touch Keyboard and Handwriting Panel). After doing that the designer will respond fine. Note if you click or touch the Keyboard icon in the TaskBar the TabTip.exe will re-start.

这篇关于实体框架edmx点击图很慢的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆