-
- Notifications
You must be signed in to change notification settings - Fork 88
Description
I'm encountering the following error when running as a self-contained .NET 5 single-file bundle:
System.ArgumentNullException: Value cannot be null. (Parameter 'path1') at System.IO.Path.Combine(String path1, String path2) at Ookii.Dialogs.Wpf.ComCtlv6ActivationContext.EnsureActivateContextCreated() at Ookii.Dialogs.Wpf.ComCtlv6ActivationContext..ctor(Boolean enable) at Ookii.Dialogs.Wpf.TaskDialog.ShowDialog(IntPtr owner) at Ookii.Dialogs.Wpf.TaskDialog.ShowDialog(Window owner) The code that's responsible just looks like this:
var dialog = new VistaFolderBrowserDialog(); dialog.ShowDialog(Application.Current.MainWindow); It looks like the ComCtlv6ActivationContext.EnsureActivateContextCreated method doesn't expect assemblyLoc to be an empty string, which it can be when running as a self-contained single-file bundle (see Remarks of Assembly.Location docs):
https://github.com/augustoproiete/ookii-dialogs-wpf/blob/2a64fea6c5c3d32f468814d205a337ce78afedab/src/Ookii.Dialogs.Wpf/ComCtlv6ActivationContext.cs#L70-L79
The Path.GetDirectoryName method returns null when passed an empty string (even though the docs for it suggest an ArgumentException instead).
I guess this will no longer be a problem when issue #31 is implemented, but thought it worth mentioning as there doesn't seem to be an easy workaround.