Attach VS to Smart Object Tester Process

  • 12 May 2016
  • 1 reply
  • 0 views

Badge

Hello,

 

I'm currently developing a broker to K2 in Visual Studio and I kind of need to debug the code attaching the VS to the Smart Object Tester process to correct some errors. When I attach the VS debuger to the process it won't do anything when executing the broker in the SOT. It is possible to do this operation?

 

Best regards


1 reply

Userlevel 1
Badge +8

Yes! and it is used most often. :)

 

The trick is that you will need to attach VS's debugger to the K2HostService. This will either require a working setup of the Visual Studio Remote Debugger on the K2 Server or an installation of Visual Studio on the K2 Server.

 

You will then compile and register your broker. CRTL-ALT-P in Visual Studio (Debug menu) to attach to a process. Select the K2 Process (assuming you are in your open broker solution) and attach to that process.

 

Set break points in your code and the use the tester tool to invoke a Smart Object to exercise your broker.  Hit break points and step through code as needed.

 

Few caveats:

  • This makes K2 Server be singled threaded and all other activities on the K2 Server will be blocked while you are debugging, so make sure you have exclusive use of the K2 Server.
  • Ensure that your code hasn't changed since you compiled and updated the DLL. Visual Studio by default is very strict on code matching DLL so if you find you aren't hitting break points push out a fresh DLL and restart the tester tool.

 

That is all there is to it. Good luck on your development!

 

S.

Reply