dotnet / dotnet/winforms

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

Open
#9,443 25 comments 7 reactions 1 assignee Claimed by @KlausLoeffelmann View on GitHub
area-VSDesigner blocking-migration
Dominant language
C#
Stars
4.9k
Forks
1.1k
Avg merge
20h 23m
Merged PRs (30d)
103

Description

### 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](https://github.com/dotnet/winforms/assets/48544354/ea93a308-7bbf-4f7f-9ff2-5e41579af9ac)

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

![WpfControlCannotAdd](https://github.com/dotnet/winforms/assets/48544354/94d67e17-7ced-47c6-8c00-24ab76b66f1d)

### 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](https://github.com/dotnet/winforms/assets/48544354/80cff196-9d38-4022-af36-bab4f725776d)

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

### Diagnostics

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.