-
Notifications
You must be signed in to change notification settings - Fork 330
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug] Didn't open dialog in unity 2023.2 #135
Comments
I'm having the same issue. Any solutions? |
Have the same error here, urgent issue, needs to be fixed ASAP |
When I downloaded Ookii.Dialog.dll from below and replaced it, the following error message was output.
Currently, Ookii.Dialogs has been deprecated and has been migrated to Ookii.Dialogs-Wpf, so it does not work as is. |
Since the dialog can be opened in unity2023.1, it may be a bug in unity2023.2. |
I have suspect that it's about unity upgrade dotnet standard from 2.0 to 2.1, which ooki dialog may not been built for? |
@Thaina |
I have submitted a bug report to Unity regarding this error. |
A bug has been registered on the issue tracker. |
"In progress" on issue tracker🙏 |
Hi, is there any workaround? @shiena Did update to Ookii.Dialogs.WinForms help? Or we just need wait for unity fix? |
@zadinvit You can use OpenFileDialog with System.Windows.Forms.dll. However, the old style dialog is displayed. |
@shiena Were you able to use OpenFileDialog with System.Windows.Forms.dll? Even with only this simple code, I have the following exception (Unity 2023.2.7f1 and 2023.2.12f1): using System.Windows.Forms;
public class WindowsFileBrowser
{
public static string BrowseFolderPanel(string initialSelectedPath = "")
{
string filePath = string.Empty;
using (OpenFileDialog openFileDialog = new OpenFileDialog())
{
openFileDialog.InitialDirectory = initialSelectedPath;
if (openFileDialog.ShowDialog() == DialogResult.OK)
{
filePath = openFileDialog.FileName;
}
}
return filePath;
}
}
|
@anonymous2585 I tried it with Unity2023.2.12f1 and the dialog worked. |
Thanks a lot! |
@anonymous2585 Also, the mono version of System.Windows.Forms.dll exists in the following path.
|
Nice to know that there is a workaround, even if the UI is a bit outdated. Could you please create a branch (or Pull Request) for the workaround? Note that the workaround does not need to be merged into the master branch. Just having it available as a branch should suffice. And the branch can be deleted once Unity fixes the root problem. |
diff --git a/Assets/StandaloneFileBrowser/StandaloneFileBrowserWindows.cs b/Assets/StandaloneFileBrowser/StandaloneFileBrowserWindows.cs
index 2bdb8c218..b1e379220 100644
--- a/Assets/StandaloneFileBrowser/StandaloneFileBrowserWindows.cs
+++ b/Assets/StandaloneFileBrowser/StandaloneFileBrowserWindows.cs
@@ -4,7 +4,13 @@ using System;
using System.IO;
using System.Windows.Forms;
using System.Runtime.InteropServices;
+#if UNITY_2023_2_0 || UNITY_2023_2_1 || UNITY_2023_2_2 || UNITY_2023_2_3 || UNITY_2023_2_4 || UNITY_2023_2_5 || UNITY_2023_2_6 || UNITY_2023_2_7 || UNITY_2023_2_8 || UNITY_2023_2_9 || UNITY_2023_2_10 || UNITY_2023_2_11 || UNITY_2023_2_12 || UNITY_2023_2_13 || UNITY_2023_2_14 || UNITY_2023_2_15 || UNITY_2023_2_16 || UNITY_2023_2_17 || UNITY_2023_2_18 || UNITY_2023_2_19
+using VistaOpenFileDialog = System.Windows.Forms.OpenFileDialog;
+using VistaFolderBrowserDialog = System.Windows.Forms.FolderBrowserDialog;
+using VistaSaveFileDialog = System.Windows.Forms.SaveFileDialog;
+#else
using Ookii.Dialogs;
+#endif
namespace SFB {
// For fullscreen support
|
Yep, same issue with 2023.2+ 😔 Thanks @shiena for the workaround! This repo seems to have last been updated over 6 years ago... Are we hopeful that there's even a remote chance that this gets fixed? |
@MadStark |
With the Mono System.Windows.Forms, I have the issue of Unity editor crashing whenever I close it after using the old window UI. Do you have the same thing? |
@shiena Thanks! Unfortunately it didn't fix my issue... I think it might be interfering with other things in my project. After I open the browser, next time I will close Unity, it will crash instead! |
Perhaps Unity-Technologies/mono#2003 will fix it. |
Yes, that is exactly what that PR fixes :). |
Backports also merged into 2023.2 and 2023.3. |
I took some pull requests and repackaged them as upm. |
"Fixed in 6000.0.0b14" and "Fix In Review for 2023.2.20f1" on issue tracker |
UUM-62035 is included in the Fixes section of the release notes for Unity6000.0.0b15. |
Unity2023.2.20 also contains UUM-62035 in the Fixes section. |
Updated my project to 2023.2.20f1 and I confirm the issue is gone for me 😀 |
It seem
VistaOpenFileDialog
are not working in unity 2023, are there any fix?The text was updated successfully, but these errors were encountered: