1

I have a C#/WPF application that's running on Win 10 machine. I connect to the machine via RDP from a different Win 10 machine and setup some properties in the application, minimize it and close the RDP connection.

After a couple of minutes, I reconnect and maximize the application only to find all the settings I made reverted back to their default states. I found out that it's because the default constructor of the responsible class gets invoked and rewrites all the changed values back to their default values.

Edit: I found the same question here: WPF: Prevent unload & load after RDP (dis)connect

However, the solution from that question doesn't seem to be suitable for me as I need to keep the Loaded/Unloaded event handling intact. Is there perhaps some setting in the Remote Desktop Session Host configuration that would prevent this behavior? I tried setting the different Session Time Limits but it didn't seem to help.

Community
  • 1
  • 1
  • 1
    Are you 100% sure this only happens over RDP? – Jcl Apr 01 '16 at 10:00
  • Had you put some code in your Loaded/Unloaded event? – Giangregorio Apr 01 '16 at 10:05
  • RDP is the only scenario I ever encountered the issue. It could possibly happen under other circumstances but it won't occur when I'm working directly on the computer that runs the application even after logout/login or after a long period of inactivity. And yes, I have some code in the Loaded/Unloaded events. – Tomáš Vomáčka Apr 01 '16 at 11:00
  • In some scenario Remote Desktop will trigger your loaded/unloaded event. – Giangregorio Apr 01 '16 at 13:04

0 Answers0