开发者

VS2008 : Start an external program on Debug

I have a solution with three projects:

  1. is a console (GUI app) for a device connected through Serial Port.
  2. Serial Port emulation (console app, self-hosted WCF service).
  3. Common interfaces.

To debug, I start SerialPortEmulator and then debug (F5) the main project.

Two problems:

开发者_高级运维
  1. It takes extra keystrokes to start the emulator.
  2. I need to remember to stop the emulator before compiling (in case there are breaking changes).

Question: Ideally I want to have emulator project be started on debug, and terminated on debug-stop. Is there easy way to do that?

I could have the emulator in a different solution, but then I need to ensure the interfaces definition library is always in sync.


You can try to write a macro to catch the OnEnterRunMode

Private Sub DebuggerEvents_OnEnterRunMode(ByVal Reason As EnvDTE.dbgEventReason) _
    Handles DebuggerEvents.OnEnterRunMode

    // Run emulator here
End Sub

As for the clean of stop, have a look at my previous answer (Executing clean up code when debugging stops)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜