Closed minisbett closed 1 year ago
Oh I should mention the STAThread exception is just the inner exception, the actual exception tells me that DragDrop could not be registered It's german but maybe it helps
Apparently the problem also exists if I just put the flyleaf host on the form, without creating any Player object or starting the engine
Hi @minisbett, I tried to create a new .NET 7 WinForms project and add FlyleafHost from toolbox to the form and everything was working fine. Are you doing something different because it does not make sense. From the error message that you share it seems that you initialize the Form1 from another thread.
You probably use async somewhere eg (restore that to void) :-
[STAThread]
static async Task Main()
{
}
Oh well that might be the problem, my Main function is async. But I can't change that, it has to be. That shouldn't be a problem when using your library tho.
Calling InitializeComponent() from non UI thread sounds like an issue for your design and not my library's
Well everything works except for your library. I feel like there's more something that should be handled differently in your library since an async entry point is very common nowadays
Well everything crashes if you enable AllowDrop initially still not my issue
I tried disabling AllowDrop but it didn't change anything
By default the library sets this in the constructor to true
.NET 7, newest nuget version, WinForms
Running the Engine start code from the wiki in the Program.Main method, in the constructor of the Form I have the code
On the last line, I get an
InvalidOperationException
that tells me the current thread is not in STA mode. I already tried putting the above code in a method and putting the[STAThread]
attribute there without success. Any ideas?