Runtime Error 217 sometimes on app exit

  • I get a "runtime error 217" when I close my application. However it does not happen all the time, only occasionally. Perhaps there is some kind of race condition?

    I found that it happens in a very simple new project that has no code, and simply is a WinForm with the text editor control embedded. run the app, close the app and occasionally you get the runtime error.

    I also have the following behaviour in the simple test app, which i think is probably related -

    Run the app in debug, then close the app, VSHost.exe crashes every time
    Embed the WPTextDynamic control inside a user control. Use that user control in an otherwise empty form. Save the form.
    Now close the form designer inside the VS IDE (in my case VS 2008 with all the service packs) and kaboom! the VS IDE crashes.... every time

    I think all of these are related as they all happen when the form is dismissed. They all happen with the simplest of apps, with no code behind them, just the control.

    This will affect anyone using this control in this manner will have problems submtting their app to microsoft for windows certification as one of the conditions is that your app, and any 3rd party tools that it uses must not crash.

    What solution can i use to get rid of these problems?

    i'm not so concerned about the VS IDE.
    i am concerned about the runtime error. It makes my otherwise polished app look very bad, and the window that comes up is in a style that doesnt look like a VS message, or a system message. It looks more like a custom exception handler within the control itself.

    • Offizieller Beitrag

    Hi,

    You should disable the VSHost.exe in the project options. The DLL istself is save and reliable. But you should avoid that the IDE and the application uses and loads different DLLs. Ther many be just ONE TextDynamic DLL loaded.

    Julian