Search code examples
wpf.net-6.0

Is it possible to use FolderBrowserDialog in a WPF Net 6 application?


In a .NET 5 application I can use WinForms so I can use this controls, but I would like to migrate to .NET 6, but I don't see the way to use WinForms controls.

I don't know if it is possible, or if it would be possible to use another file browser in my WPF .NET 6 application.


Solution

  • .NET 5 and .NET 6 are still .NET Core and don't require a specific IDE to compile. Project settings are stored in the csproj file and can be edited even with any text editor.

    You can inspect the contents of the .NET 5 project and copy any settings you need to the .NET 6 project. Or you can simply change the project's target from net5.0 to net6.0.

    In this case the setting is

    <UseWindowsForms>true</UseWindowsForms>