Code Monkey home page Code Monkey logo

Comments (8)

M-Lipin avatar M-Lipin commented on June 1, 2024 1

The issue has been fixed in 899206 and the fix should be available in the latest .NET 4.8.

from dotnet-framework-early-access.

EngAJ avatar EngAJ commented on June 1, 2024 1

If you download .NET 4.8 you should have the fix.

This was introduced in .NET 4.8, and there isn't a new build available yet.
I downloaded again and the install fails:
.NET Framework 4.8 or a later update is already installed on this computer.

I the issue persists.

from dotnet-framework-early-access.

vivmishra avatar vivmishra commented on June 1, 2024

@Tanya-Solyanik @merriemcgaw
CC: @vatsan-madhavan

from dotnet-framework-early-access.

vatsan-madhavan avatar vatsan-madhavan commented on June 1, 2024

When Enter is pressed, S.W.Forms.Application looks up Control.FromChildHandleInternal(msg.hwnd) and retrieves the previously closed ElementHost instance, and forwards the keypress to it.

While this is happening, Form.Close() => S.W.Forms.Form.WmClose() is also called, which leads to the ElementHost being Dispose()'d

        WindowsFormsIntegration.dll!System.Windows.Forms.Integration.ElementHost.Dispose(bool disposing) Line 831	C#
 	System.dll!System.ComponentModel.Component.Dispose() Line 120	C#
 	System.Windows.Forms.dll!System.Windows.Forms.Control.Dispose(bool disposing) Line 6045	C#
 	System.Windows.Forms.dll!System.Windows.Forms.Form.Dispose(bool disposing) Line 3842	C#
 	recreateelementhostprocesscmdkeybug.exe!RecreateElementHostProcessCmdKeyBug.FormHostingWPF.Dispose(Boolean disposing) Line 13	Basic
 	System.Windows.Forms.dll!System.Windows.Forms.Form.WmClose(ref System.Windows.Forms.Message m) Line 7115	C#
 	System.Windows.Forms.dll!System.Windows.Forms.Form.WndProc(ref System.Windows.Forms.Message m) Line 7550	C#
 	System.Windows.Forms.dll!System.Windows.Forms.Control.ControlNativeWindow.OnMessage(ref System.Windows.Forms.Message m) Line 14606	C#
 	System.Windows.Forms.dll!System.Windows.Forms.Control.ControlNativeWindow.WndProc(ref System.Windows.Forms.Message m) Line 14661	C#
 	System.Windows.Forms.dll!System.Windows.Forms.NativeWindow.DebuggableCallback(System.IntPtr hWnd, int msg, System.IntPtr wparam, System.IntPtr lparam) Line 795	C#

By the time the keypress reaches the ElementHost, it is no longer valid, and it throws.

	WindowsFormsIntegration.dll!System.Windows.Forms.Integration.ElementHost.ProcessCmdKey(ref System.Windows.Forms.Message msg, System.Windows.Forms.Keys keyData) Line 468	C#
 	System.Windows.Forms.dll!System.Windows.Forms.Control.PreProcessMessage(ref System.Windows.Forms.Message msg) Line 10163	C#
 	System.Windows.Forms.dll!System.Windows.Forms.Control.PreProcessControlMessageInternal(System.Windows.Forms.Control target, ref System.Windows.Forms.Message msg) Line 10262	C#
 	System.Windows.Forms.dll!System.Windows.Forms.Application.ThreadContext.PreTranslateMessage(ref System.Windows.Forms.NativeMethods.MSG msg) Line 3666	C#
 	System.Windows.Forms.dll!System.Windows.Forms.Application.ThreadContext.System.Windows.Forms.UnsafeNativeMethods.IMsoComponent.FPreTranslateMessage(ref System.Windows.Forms.NativeMethods.MSG msg) Line 3798	C#

So WinForms should either...

  • .. not close the ElementHost before sending ProcessCmdKey, or
  • ... not send messages to the ElementHost after Close-ing it.

from dotnet-framework-early-access.

EngAJ avatar EngAJ commented on June 1, 2024

The issue has been fixed in 899206 and the fix should be available in the latest .NET 4.8.

When will that happen?

from dotnet-framework-early-access.

merriemcgaw avatar merriemcgaw commented on June 1, 2024

If you download .NET 4.8 you should have the fix.

from dotnet-framework-early-access.

merriemcgaw avatar merriemcgaw commented on June 1, 2024

@M-Lipin can you please validate what update this is in?
@EngAJ - can you attach the setup logs so I can confirm precisely what you've got on your system. You can run http://aka.ms/vscollect.exe and then attach the resulting vslogs.cab (from your temp directory).

from dotnet-framework-early-access.

EngAJ avatar EngAJ commented on June 1, 2024

@merriemcgaw Here are the files.
vslogs.zip

from dotnet-framework-early-access.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.