Skip to content
This repository was archived by the owner on Jun 23, 2025. It is now read-only.
This repository was archived by the owner on Jun 23, 2025. It is now read-only.

IL2CPP does not support marshaling delegates that point to instance methods to native code. #4

@R0N222

Description

@R0N222

Hello, I keep getting these Errors while trying to open the file browser in a standalone build.

using Unity 2021.2.17f1 Personal with IL2CPP.
I imported Mono.Posix and Mono.WebBrowser successfully, and it worked in the previous unity version.
After updating to the newer Unity version, there were some weird problems with plastic that got fixed after restarting.
It still works well in the unity editor, but on build accessing the file browser will always throw this exception

NotSupportedException: IL2CPP does not support marshaling delegates that point to instance methods to native code. The method we're attempting to marshal is: System.Windows.Forms.CommonDialog::OwnerWndProc
at System.Windows.Forms.CommonDialog.ShowDialog (System.Windows.Forms.IWin32Window owner) [0x00000] in <00000000000000000000000000000000>:0
at AnotherFileBrowser.Windows.FileBrowser.OpenFileBrowser (AnotherFileBrowser.Windows.BrowserProperties browserProperties, System.Action`1[T] filepath) [0x00000] in <00000000000000000000000000000000>:0

Does anybody know a fix?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions