Search code examples
c#.net-coreopenfiledialog

OpenFileDialog on .NET Core


On .NET Framework you can use System.Windows.Forms.OpenFileDialog for open files with the native Windows UI but that only works on Windows.

There is a System.Windows.Forms.OpenFileDialog implementation for .Net Core or another alternative?


Solution

  • .NET Core itself does not include APIs for any UI. For example, https://learn.microsoft.com/en-us/dotnet/api/?view=netcore-2.0&term=File shows nothing relevant. This is also the current stance of .NET Core developers: https://github.com/dotnet/core/issues/374

    There are several external libraries that may work on specific platforms:

    If you are not really tied to .NET Core itself. UWP (which builds on top of .NET Standard but is different from .NET Core) may be an option too.