3

I have a WPF application which will be used on tablets with Windows 10. In my development environment, the application runs very fast. However, if I run the application on tablet without admin rights, the application responds very slow : all animations are slow, the scrolling is not smooth, and touch problems are visible (cannot move the caret). If the application has admin rights all things are working fine.

I tried to disable the logs, I tried to decrease the FPS, nothing seems to help. My application is connected to a sqlite database, but even without accessing the database is very slow. There are no other connections that may require admin rights. What could be the problem?

EDIT: Also in my dev environment the app is running slower without admin rights. I was running the VS2015 with admin rights and for that reason the application worked fine.

Dragos Stoica
  • 1,753
  • 1
  • 21
  • 42
  • 1
    Can you profile the app twice, once with admin rights, and once without. This might hopefully help reduce where in your code the issue is coming from – keyboardP Jul 12 '16 at 10:59
  • I've tried to use remote profiler, but the rendering is very slow without admin, and parsing. – Dragos Stoica Jul 12 '16 at 11:00
  • Please tell Framework-Version and Target-Platform (x86/x64) – lokusking Jul 15 '16 at 07:41
  • Thank you for your time. The app is developed under .NET Framework 4.6.1 and is targeting all types of platforms (Any CPU) – Dragos Stoica Jul 15 '16 at 07:43
  • Some stuff to read and try: [First](http://stackoverflow.com/questions/20906195/wpf-low-performance-when-process-is-executed-under-system-account), [Second](http://stackoverflow.com/questions/2947118/wpf-slow-to-start-on-x64-in-net-framework-4-0). This seems to match your issue – lokusking Jul 15 '16 at 07:48
  • I saw that answers. For the first, my app is running always under a user with admin rights, never under SYSTEM, and right now, I will try the second approach. – Dragos Stoica Jul 15 '16 at 07:55
  • No, still no change. It works very slow on x86. I've updated the NGEN also... – Dragos Stoica Jul 15 '16 at 08:06
  • There's no magic bullet. Please develop your answer with profiler tests. What are the differences in those tests between admin vs non admin? – Simon Mourier Jul 17 '16 at 07:09
  • 1
    I think you need to add a manifest file to your project and set level to `requireAdministrator`. – Maria Jul 17 '16 at 20:37
  • I think the problem comes from your database queries. Are you on a domain? Are you on a local machine? – c_str Jul 21 '16 at 03:35

3 Answers3

2

WPF has settings under HKEY_CURRENT_USER that can disable hardware acceleration:

https://msdn.microsoft.com/en-us/library/aa970912(v=vs.110).aspx

If the Disable Hardware Acceleration Option or the Use Reference Rasterizer Option are set, a WPF application will run slowly for that user.

Kip Morgan
  • 728
  • 3
  • 12
  • Wooh, thats weird, but makes sense. Never heard of that. Good to know – Mafii Jul 19 '16 at 14:34
  • These options are set correctly on my PC, but if I use "Disable Hardware Acceleration", that application gives an error which is a little bit strange : "Cannot access external driver" – Dragos Stoica Jul 20 '16 at 07:23
  • Stating from that error, I've found out that one of the drivers that I've used needs rights on a file which is placed on AppData. After I've set the full rights for that file, the application immediately started to work well. I will give you the bounty, because was the answer that helped me, even though the settings that you proposed were in place. Thank you for your time! – Dragos Stoica Jul 21 '16 at 13:38
1

Try to trace your app with Process Monitor. Run 2 traces for app running with and without admin rights. Filter your app events only via Tools->Process Tree... -> right click on your process -> Add to Include filter and compare these trace logs (or just post them here). Pay attention on gaps between registry key readings or network access.

That literally could be anything. Mark Russinovich make a presentation almost every year about finding some interesting cases. Here's one of them.

P.S. I'm sorry to post that as an answer, but I don't have enough points to add comments right now.

0

To offer an answer for people that might face the same issue, now, after I've searched a lot for something helpful, I can say that this problem it is mainly a problem related to rights. If you encounter this issue, try to run Visual Studio without admin rights and try to isolate the region where the application begins to act very slow (or the place were it crashes) . In my case, wasn't the database, or the log files, but a file in AppData which was used by an external assembly. I've seen that, every time that dll was called, the application was freezing and using dotTrace, I've managed to find which file it is used. After setting the rights (r/w) on that file, everything was back to normal.

Dragos Stoica
  • 1,753
  • 1
  • 21
  • 42