22

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.

Tree
  • 223
  • 2
  • 7
  • EF7 will remove the edmx so you might try moving to a code-first solution for now. – jamesSampica Nov 25 '15 at 15:33
  • 1
    Using code-first was never really an option to maintain a DB model when only part of the database is used via EF and many of the internal triggers, views, functions and stored procedures related to caching and data building are pretty complicated. A database project and using EF database-first is more productive in this case. Be completely happy to not use the edmx though, so will look into EF7 for our rebuild next year. – Tree Nov 27 '15 at 09:27
  • Use the "EF Reverse POCO" template with EF6 today! – ErikEJ Apr 08 '16 at 09:25

7 Answers7

33

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.

Claudio Cauchi
  • 443
  • 4
  • 7
  • This is the solution that actually worked for me, as I have a touchscreen laptop. It's probably not the solution for VMs, so if anyone finds a solution for that problem please post that too. – Tree Apr 09 '16 at 11:47
  • This also totally resolved the issue for me, the EDMX designer immediately began to respond normally after killing the process. Hope this gets fixed in an update soon! – SelAromDotNet Apr 13 '16 at 16:26
  • It was a different app on the Dell XPS 15 9550, but it was still an app related to the touchscreen keyboard. Amazing find, and personally I hate the touchscreen anyway. Just wanted the 4k, so the two come as a pair on this laptop. – Scott Smith May 17 '16 at 14:14
  • This has been bugging me for MONTHS but this fix worked for me on an HP Envy touchscreen laptop. How they discovered the source is beyond me. – moomoo May 27 '16 at 23:03
  • Can confirm this is bang on the money the equivalent on Dell XPS 15 9550 @ScottSmith is called `TabletInputService` just stopped it and disabled it in `services.msc` on Windows 10 and the EDMX springs into life! Great find! – user692942 Nov 15 '16 at 14:44
  • what if we are using Windows 7 and VS 13? – Dawood Ahmed Mar 31 '17 at 06:20
5

I tried the accepted answer and it did work for me, however the issue returned on restart. I also tried the other answers with no success. I found the offending windows service and used Windows 10 services management screen to disable the service. I hope this is helpful to others with this issue.


How to disable the service fully

Disable the service:

  1. User windows start search (by the start menu) and type in: Services
  2. You should see a windows desktop app called Services (open it).
  3. Find the services called "Touch Keyboard and Handwriting Panel Service".
  4. Open its properties, (by right clicking it).
  5. Under the General tab set the startup type to "Disabled".
  6. Stop the service if if it has not stooped already.

Verification:

  1. Open Visual Studio's EDMX and you should notice the difference right-away, if not then you may not have the same issue as me.
  2. Restart your computer and test the EDMX again, it should not be slow.

Note: This does mess with your gesture and touch pad a bit, so if you use that a lot then don't do this. This guide is for windows 10, and worked for me but may not work for you. Also I have not tested if Windows update will re-enable the service.

Gram
  • 376
  • 1
  • 7
  • 19
4

I can't comment as I'm just under the minimum comment reputation, however I have been having exactly the same issue.

Like you, I re-installed Windows 10 (Enterprise) and Visual Studio (both 2013 Pro and 2015 Pro) to no avail.

For the moment, I've put this on the back-burner and am working around it by using a combination of DevArt's Entity Developer (https://www.devart.com/entitydeveloper/) and manually editing the classes to match database changes.

It is tedious, and not a lot of fun - but it works for me (for the moment).

Hopefully this helps someone.

Edit:

For anyone who may come across this post in the future, the following appears to have solved this issue for me:

  • Navigate to Tools > Options > General
  • Untick "Automatically adjust visual experience based on client performance"
  • Untick "Use graphics acceleration if available"

Though you may not have to, I left "Enable rich client visual experience" unticked.

If this doesn't work, take a look at the comments below this answer - it might be of use. :)

Source: http://pinter.org/?p=2611

Edit 2:

My issue came back, and after further investigation it appears that it was caused by Remote Desktop (I am currently using an ESXi-hosted Windows 10 VM). Switching to VNC or using the VMWare VSphere Web Console results in Visual Studio running perfectly fine. Hopefully this helps someone! :)

XtraSimplicity
  • 5,704
  • 1
  • 28
  • 28
  • Thanks for the suggestion of entitydeveloper, I will take a look at that. The problem we're having really doesn't seem that common or there would be more questions like this around. I have wondered if it might be a graphics driver bug but when it's heavily using CPU it doesn't look like it's using any more time for kernel processes than usual, so that sounds doubtful. Do you remember if you had this issue on Windows 8? I don't think I did, and my colleague on Windows 7 for the same edmx doesn't have this problem at all. – Tree Nov 25 '15 at 09:51
  • I never had this issue with Windows 8, no. Interestingly, my CPU usage hasn't increased above about 40%, and I have just over 4GB of RAM left - so it doesn't look like it is a resource issue, on my setup. – XtraSimplicity Nov 25 '15 at 11:03
  • I've just started logging the devenv.exe process using SysInternals Process Monitor and captured a little over 2,400 IO events throughout the time the Entity Designer (and consequently, Visual Studio) was 'frozen'. In the same period of time, there was also 192 registry read/write events, and 17 TCP/IP events. The latter was most likely to the SQL Server (destination ports 49154, 49155). – XtraSimplicity Nov 25 '15 at 11:16
  • A number of IO events are interacting with C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df_6.0.10240.16384_none_3bccb1ff6bcd1849\comctl32.dll, whilst the others are repeatedly opening and closing other miscellaneous DLLs and some of my application's source files. I downgraded from EF 6.1.3 to 6.0.0, as I was experiencing other issues, but this downgrade has not had an effect on this freezing. I'm going to run sfc on the machine to see if it makes a difference. I'll report back when I have more info. :) – XtraSimplicity Nov 25 '15 at 11:19
  • Running SFC yielded no change, unfortunately. I'll take a look at this again tomorrow (it's 11pm here in Melbourne, AU), but hopefully some of the above is useful to someone. FWIW, There's another user with this issue, [here](http://stackoverflow.com/questions/32335900/ef6-refreshing-large-db-first-entity-model-taking-forever-in-vs-2015-on-windows), but he/she has yet to receive any comments. – XtraSimplicity Nov 25 '15 at 12:13
  • CPU is in line with what I get (2 busy CPU units). Process Monitor didn't show any VS-attached processes doing anything time-consuming for me; all threads open and close fairly quickly. Interacting with the control library makes sense for Visual Studio in general but it's not clear what it's doing in this case.It's probably worth running ProcDump on the main VS process during the hang. I will try that when I've got my current release out. – Tree Nov 25 '15 at 14:31
  • Ran procdump when DevEnv became unresponsive and tried to debug the file, but have no source info. Only info it gave me was dump is a stacktrace inside something which I think might be looking at what is at the cursor: will add stacktrace to question – Tree Nov 25 '15 at 15:19
  • 1
    I've just found a few things which might help - I'll try them out tomorrow morning when I'm back at work, but I figured it'd be worth posting them here in case they may help you or someone else. [here](http://pinter.org/?p=2611) and [here](http://answers.microsoft.com/en-us/insider/forum/insider_apps-insider_other/bad-performance-of-visual-studio-20132015-on/0246eeb7-9f53-4ee0-8303-484c186237e8?auth=1) (or perhaps MS SQL Server Standard, if that's what you're using -- this could make sense, given that EF Designer does appear to communicate with the SQL Server (according to Process Monitor)) – XtraSimplicity Nov 26 '15 at 10:36
  • I tried turning off the gfx hardware acceleration as suggested in first link, but that actually made the problem worse, with CPU getting busy if you even put the mouse cursor over the edmx window, and not just click. I don't think a reinstall of SqlServer will make any difference, as the problem remains after clean reinstall of Windows 10 (plus I had tried using SQLServer developer edition previously too). Interesting though I do have a Intel HD Graphics Family adapter. Device manager shows I have that and an NVidia GeForce GT 750M. Does any of that match you too? – Tree Nov 26 '15 at 13:23
  • Strange.. I just tried the first link (disabling hardware acceleration), which _appears_ to have resolved my issue. If you can, try to disable the onboard graphics card in your BIOS, and see if that makes a difference. I'm running a virtualized copy of Windows 10 Enterprise on an ESXi host, so the graphics card is also virtualized. I've updated my answer to reflect what solved my issue. Good luck! Hopefully disabling the onboard graphics card resolves your issues. :) – XtraSimplicity Nov 26 '15 at 21:29
  • I've tried just to disable one of the gfx adapters and just use NVidia, but that is no better and I then only can use one monitor. But I think this is on the right lines so I will continue to investigate over the weekend. Glad to hear you are sorted, and I think I am closer to a solution too. – Tree Nov 27 '15 at 09:44
  • Good luck! Please post back with what you find -- it's one heck of a strange issue! – XtraSimplicity Nov 29 '15 at 03:20
  • As an update, I've updated BIOS and graphics drivers for Intel and NVidia devices.I've tried every combination of disabling them and the hardware support toggle in VS but still no luck. The fact I am getting this on both GFX systems suggests it's not directly a driver issue. I'm pretty stumped. I think I'll have to go to Microsoft support for this one next. – Tree Nov 29 '15 at 12:02
  • How did you go? My issue has come back and it appears that it may be caused by Remote Desktop (I'm using a Windows 10 VM on an ESXi 5.5 host), as connecting directly via the VSphere Web interface results in the Entity Designer working *almost* perfectly. I've tried a number of different RDP clients for OS X, all of which yield the same result. If you're running RDP, maybe try switching to VNC (if at all possible), to see whether that helps? – XtraSimplicity Dec 04 '15 at 02:38
  • 1
    I've just put a bug issue onto CodePlex, as it sounds like MSDN forum is not longer in use. If you want to follow if I get a response there the issue is here: https://entityframework.codeplex.com/workitem/2861 – Tree Dec 07 '15 at 10:24
  • Awesome; I'll be sure to keep an eye on it. Cheers! :) – XtraSimplicity Dec 07 '15 at 10:30
2

This is an issue with Microsoft.VisualStudio.Modeling.Sdk on Windows 10 and also affects the LINQ to SQL (DBML) designer. The team that owns the VS Modeling SDK is currently working on this. We have an issue tracking it on the EF project site https://entityframework.codeplex.com/workitem/2861. We will keep that issue updated with progress, availability of a fix, workarounds, etc.

Rowan Miller
  • 2,090
  • 15
  • 15
0

if you have installed the extension productivity power tools, then disable it before you start to work with entityframework diagrams, then inable it when your done. i dont get into my entityframework diagrams very often, so this worked for me.

iqworks
  • 441
  • 2
  • 5
  • 9
0
  • First of open your ProjectName.edmx.diagram file which is under the ProjectName.edmx.

  • Now scroll down, if you see any random lines of code after the </edmx:Diagrams> un</edmx:Designer> </edmx:Edmx>. which are repeated for more than thousands of time then that is the reason.

  • Remove that or delete database and create again.

chandresh
  • 1
  • 1
0

If this helps anybody. Having same problem. When I try to generate model from db it takes roughly 18 minutes. I am running EF 6.1.3. Sql Server 2014 management studio. VS 2015. I ran this command and now it is super fast like a couple of seconds. "ALTER DATABASE ROW SET COMPATIBILITY_LEVEL = 110" You need to restart the sql server service.

Tipu
  • 1