Skip to content
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

ApplicationAlreadyRunning Exception #595

Closed
bainewedlock opened this issue Feb 22, 2024 · 4 comments
Closed

ApplicationAlreadyRunning Exception #595

bainewedlock opened this issue Feb 22, 2024 · 4 comments

Comments

@bainewedlock
Copy link

I tried to make the counter app from the tutorial, but when I start it there is an exception:

System.InvalidOperationException: 'Die Anwendung führt den Verteiler bereits aus.'

I guess this is the untranslated error: ApplicationAlreadyRunning | Application is already running the Dispatcher.

Note: I wasn't able to follow the tutorial exactly, because some functions did not exist with the suggested name.

    let main window =
        Program.mkSimpleWpf init update bindings
        |> Program.runWindow window
@TysonMN
Copy link
Member

TysonMN commented Feb 22, 2024

Can you share a GitHib repo with code that reproduces your problem?

@bainewedlock
Copy link
Author

Sure: https://github.com/bainewedlock/elmish-wpf-demo

let me know if you need more details to reproduce the behavior

@marner2
Copy link
Collaborator

marner2 commented Apr 3, 2024

@bainewedlock sorry about the delayed response.

This error happens when you use Program.mkWindow in a context where you already "made" the window with XAML.

Instead use Program.mkSimpleWpf init update bindings |> Program.startElmishLoop ElmConfig.Default window if you are using the Activated event on an already-existing App and Window.

@bainewedlock
Copy link
Author

@marner2 great it works, thanks for taking a look at my code!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants