gkngkc / UnityStandaloneFileBrowser

A native file browser for unity standalone platforms
MIT License
2.01k stars 317 forks source link

System.Windows.Forms exception on windows build (exe) #71

Open hippogamesunity opened 4 years ago

hippogamesunity commented 4 years ago

ArgumentException: The Assembly System.Drawing is referenced by System.Windows.Forms ('Assets/StandaloneFileBrowser/Plugins/System.Windows.Forms.dll'). But the dll is not allowed to be included or could not be found.

A workaround suggested here doesn't work for me in Unity 2019.2.4

So I've made my own workaround and can suggest you to add it to the repo:

Hshan7 commented 4 years ago

It's works, thank very much. But after bulid the dialog can not show in program but only in the Unity editor. Have someone ever met the same problem?

hippogamesunity commented 4 years ago

@Hshan7 omg, you're right, I've forgot to test it outside of Unity. So the only solution I've found is targeting your project to .NET 3.5 and using original DLL. Hope @gkngkc will help us.

hippogamesunity commented 4 years ago

@Hshan7 System.Windows.Forms (.NET 4.0) works with Mono Scripting Backend!

Hshan7 commented 4 years ago

@Hshan7 System.Windows.Forms (.NET 4.0) works with Mono Scripting Backend! I switch my api compatibility level to .NET 4.x in player settings and the dialog can show. And no need to replace the System.Windows.Forms.dll or add System.Deployment.dll. Thanks for your answer.

veggiesaurus commented 4 years ago

Hoping there's some way to get this to work with IL2CPP as well.

kaninhot004 commented 4 years ago

Change Player Setting .NET to 4.0 can be solved this problem like @Hshan7 said.