Failure of second call to dll by the reflection RRS feed

  • Question

  • I have  a method "Start" in a dll which is invoked via reflection using the following code:

    StandAloneInstance.GetMethod("Start", new Type[] { }).Invoke(new object(), null))

    here StandAloneInstance is an object of   System.Type 

    Whenever I run the code for the first time all runs perfectly and when I invoke the same function without exiting the application it goes in an infinity wait.

    However if I stop the application and rerun it all is well again.

    While in debugging mode the debugger hangs after the execution of the above line.

    Please guide to crack this issue.

    • Edited by Pankneo84 Friday, December 7, 2012 5:12 AM
    • Moved by Chester Hong Monday, December 10, 2012 10:30 AM (From:Windows Forms General)
    Friday, December 7, 2012 5:06 AM


  • Are you sure Start method is something that can be called twice? Usually "Start" functionality is companied with "Stop" functionality and calling Start twice, depending on application, might lead to some strange behavior. Maybe that's the reason.
    • Proposed as answer by Mike Feng Tuesday, December 11, 2012 3:55 PM
    • Marked as answer by Mike Feng Tuesday, December 18, 2012 12:32 PM
    Friday, December 7, 2012 7:22 PM