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.

ElementHost control (Wpf Interoperability) do not display in Toolbox WinForms designer And Can not add Wpf UserControl in winform designer

See original GitHub issue

Environment

VisualStudio 17.6.4

.NET version

  • Windows Form App template
  • .NET core 7.0

Did this work in a previous version of Visual Studio and/or previous .NET release?

It works in .NET framework 4.8

Issue description

  • Can not display ElementHost (Wpf Interoperability)

ElemenHostNotFound

  • Can not add Wpf UserControl in the Winform in design mode

WpfControlCannotAdd

Steps to reproduce

  • Create a new Windows Form App project with a target framework 7.0.
  • Open Form1.cs in design mode
  • Open Toolbox then search ElementHost (not found this control)

Image WinFormApp .net core 7.0

image

But with .net framework 4.8 has it and works fine Untitled

Diagnostics

No response

Issue Analytics

  • State:open
  • Created 2 months ago
  • Reactions:2
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
elachlancommented, Jul 10, 2023

@MauNguyenVan the designer repo is currently closed source.

1reaction
Olina-Zhangcommented, Jul 10, 2023

@Olina-Zhang can you check if this repros in .net 6 please?

There are known issues in Winforms designer repo: https://github.com/microsoft/winforms-designer/issues/919, https://github.com/microsoft/winforms-designer/issues/2626.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Select WPF controls for Windows Forms
Walkthrough: Assign WPF content on Windows Forms at design time ... You can select any WPF control types that are included in your...
Read more >
WPF control not displaying in ElementHost in WinForms app
I have a problem with a WPF control that I'm trying to host in an ElementHost in a WinForms app. The control is...
Read more >
Can't add WPF components to toolbox
I was trying to establish that the toolbox itself was not having an issue and that the WPF Designer surface was activated since...
Read more >
Embed WPF User Controls in WinForms Applications
At last, host the WPF UserControl on ElementHost. First, rebuild your solution, so the WpfUserControl is visible in the Toolbox. Now, open the ......
Read more >
Mixing WPF and WinForms - Simple Talk
To add an ElementHost, then, you can drag it from the toolbox onto the designer or enter it in your code-behind file.
Read more >

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