WPF App on Windows Server (RDP) – Error Sometimes When Opening New Window

3ColorCat 0 Reputation points
2025-08-04T17:30:01.3533333+00:00

Hi everyone,

 

I have a WPF app that runs from a network drive. It works fine on Windows 11 at the office. But when users run it through Remote Desktop on a Windows Server 2019 virtual machine (using the exact same .exe from the same network drive location), some of them get an error when opening a new window.

The app starts normally, but the error happens only when opening another window — and not for every user.

Strangely, the next day the same user can open the app and use it normally again without changing anything.

Has anyone seen this before or know how to fix it?

I’ve also attached:

  • A screenshot of the error message

 

  • The function that causes the error

Thanks a lot!

Windows for business | Windows Server | User experience | Remote desktop services and terminal services
{count} votes

1 answer

Sort by: Most helpful
  1. Harry Phan 1,225 Reputation points Independent Advisor
    2025-08-10T07:56:48.2366667+00:00

    Dear 3ColorCat,

    Thank you for sharing the details of the issue you're experiencing with your WPF application.

    We understand that the app runs smoothly from a network drive on Windows 11 at the office, but intermittently throws an error when accessed via Remote Desktop on a Windows Server 2019 virtual machine, specifically when users attempt to open a new window. Notably, the issue seems to resolve itself the following day without any changes.

    A. Possible Causes & Recommendations:

    User Profile or Session Caching

    The issue may be related to temporary user profile data or session caching. Try having affected users log off completely (not just disconnect) and log back in to refresh their session.

    Network Latency or Drive Access Timing

      Running WPF apps from a network location can be sensitive to latency. Remote Desktop sessions may introduce delays that affect how resources are loaded when opening new windows.
      
      **.NET Framework Trust Settings**
      
         Ensure the app has full trust permissions. WPF apps launched from network drives may be subject to **Code Access Security (CAS)** restrictions, especially on older server environments.
         
         **Graphics Rendering Differences**
         
    

    Remote Desktop sessions may use different rendering modes (software vs. hardware). You might try forcing software rendering in your app by setting: xml <RenderOptions.ProcessRenderMode>SoftwareOnly</RenderOptions.ProcessRenderMode>

    Event Logs and Exception Details

    If possible, capture the specific error message or stack trace when the issue occurs. This can help pinpoint whether it’s a UI, permissions, or resource-loading issue.

    B. Suggested Next Steps:

    Confirm that all users have the same permissions to access the network drive.

    Check if any group policies or session limits are applied to Remote Desktop users.

    Consider copying the app locally to the VM temporarily to test if the issue persists.

    I hope this helps.

    Best regards, 

    Harry Phan

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.