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

问题描述

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



模型:设置约100个表,50个视图和250个关联。



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



点击任何一个实体都可以,或者移动它们或编辑它们。问题是点击背景画布。



我已经通过模型浏览器从数据库更新了模型,但是我无法使用右键单击图表创建新的关联。



我没有看到任何关于这个问题的任何意见。任何建议的原因或解决方法?



BTW我刚刚重新安装了Windows 10 Pro,只安装了SQL Server 2014 SP1 Express和Visual Studio 2105 Pro。所以在我的系统上没有任何自定义。



更新:当DevEnv.exe变得无响应时,ProcDump提供此堆栈跟踪,表示本地代码搜索图形对象:

  [外部代码] 
[管理到本机过渡]
Microsoft.VisualStudio.Modeling.Sdk.Diagrams.GraphObject.14.0 .dll!<模块> .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 ** ignoreIt ems,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。图.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 。空间方向,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.FindNextInCh il d b $ b 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()

更新2:XtraSimplicity有一个解决方案适用于一些,但不适用于我。感谢他的建议,我已经把这个定义为直接的图形驱动程序问题。我的笔记本电脑中有一个Intel HD Graphics Family和NVIdia GeForce GT 750M显示适配器。英特尔是通常的活动适配器,但只有启用NVidia时,问题也会出现。我也尝试过在Visual Studio中禁用硬件支持的建议,但是如果在edmx打开时只是使VS的性能更糟。

解决方案

我们在Windows 10和触摸屏的2台笔记本电脑上有同样的问题。杀死进程TabTip.exe似乎解决了这个问题。



资料来源:



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


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.

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

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?

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.

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 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.

解决方案

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

Source: https://connect.microsoft.com/VisualStudio/Feedback/Details/2011437

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点击图非常慢的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-06 12:31