question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[ 8.0.100-alpha.1.23060.3] mRemoteNg app Error creating window handle error while creating Combobox

See original GitHub issue

.NET version

.NET SDK:
 Version:   8.0.100-alpha.1.23060.3
 Commit:    c5ebd18478

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.19045
 OS Platform: Windows
 RID:         win10-x64
 Base Path:   C:\Program Files\dotnet\sdk\8.0.100-alpha.1.23060.3\

Host:
  Version:      8.0.0-alpha.1.23058.2
  Architecture: x64
  Commit:       5da4a9e919

.NET SDKs installed:
  8.0.100-alpha.1.23060.3 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 8.0.0-alpha.1.23058.7 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 8.0.0-alpha.1.23058.2 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.WindowsDesktop.App 8.0.0-alpha.1.23057.1 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Did it work in .NET Framework?

N/A

Did it work in any of the earlier releases of .NET Core or .NET 5+?

Verify Scenarios:

  1. Windows 10 21H2 AMD64 + 8.0.100-alpha.1.23061.8: Fail 2). Windows 10 21H2 AMD64 + dotnet-sdk-8.0.100-alpha.1.23060.31: Fail
  2. Windows 10 21H2 AMD64 + dotnet-sdk-7.0.102-win-x64: Pass 4). Windows 10 21H2 AMD64 + dotnet-sdk-6.0.405-win-x64: Pass

Issue description

When test 3rd party mRemoteNg app with .NET 8 runtime, exception “error creating window handle error” shows while creating Combobox.

Application Name: mRemoteNg(1.77.3) OS: Windows 10 21H2 CPU: X64 .NET Build Number: dotnet-sdk-8.0.100-alpha.1.23060.3 App or App Source checking at: https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1717274 Github Link: https://github.com/mRemoteNG/mRemoteNG

Steps to reproduce

The machine only has 8.0 installed. And DOTNET_ROLL_FORWARD_ON_NO_CANDIDATE_FX=2 is set.

1.Copy app from AppSource\SourceShare\mRemoteNG to machine 2.Launch the app from mRemoteNG.exe 3.If you see update window, click ask me later 4.Click Tools=>Port Scan

Expected Result: Port Scan Tab should open without error

Actual Result: image

Exception: Exception Message “Error creating window handle.”

Stack trace
   at System.Windows.Forms.NativeWindow.CreateHandle(CreateParams cp)
   at System.Windows.Forms.Control.CreateHandle()
   at System.Windows.Forms.ComboBox.CreateHandle()
   at System.Windows.Forms.Control.CreateControl(Boolean ignoreVisible)
   at System.Windows.Forms.Control.CreateControl(Boolean ignoreVisible)
   at System.Windows.Forms.Control.CreateControl()
   at System.Windows.Forms.Control.WmShowWindow(Message& m)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(HWND hWnd, WM msg, WPARAM wparam, LPARAM lparam)

Environment
OS: Microsoft Windows NT 10.0.19045.0
mRemoteNG Version: 1.77.3
Edition: MSI
Cmd line args:

Findings: We think this error happens when creating combobox control, app is overriding OnCreateControl, when we remove DrawMode = DrawMode.OwnerDrawFixed, issue does not repro. In this file: mRemoteNG-1.77.3-dev\mRemoteNG\UI\Controls\mrngComboBox.cs

 protected override void OnCreateControl()
  {
            base.OnCreateControl();
            _themeManager = ThemeManager.getInstance();
            if (!_themeManager.ActiveAndExtended) return;
            BackColor = _themeManager.ActiveTheme.ExtendedPalette.getColor("ComboBox_Background");
            ForeColor = _themeManager.ActiveTheme.ExtendedPalette.getColor("ComboBox_Foreground");
             DrawMode = DrawMode.OwnerDrawFixed;  //if we remove, issue does not repro
            SetStyle(ControlStyles.OptimizedDoubleBuffer |
                     ControlStyles.UserPaint, true);
}

@dotnet-actwx-bot @dotnet/compat

Issue Analytics

  • State:closed
  • Created 8 months ago
  • Comments:21 (18 by maintainers)

github_iconTop GitHub Comments

1reaction
Junjun-zhaocommented, Feb 24, 2023

@Cassie-Li01 Done. Please have a try and let me know if any questions. Refer to Devdiv bug for the specific path.

1reaction
Junjun-zhaocommented, Feb 15, 2023

@merriemcgaw Sure. We have setup a repro machine today, please get the repro machine information from https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1717274.

Read more comments on GitHub >

github_iconTop Results From Across the Web

No results found

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found