TIP: Testing Custom SmartObject Services

A few weeks ago I was creating a custom SmartObject Service.  During the testing/debugging phase I found I was spending a lot of time stopping the K2 Hostserver, copying the service assembly, and starting the host server again for each change.  Being lazy, I eliminated the manual steps by adding these commands to the post build event in Visual Studio:


net stop "K2 blackpearl Server"
copy $(TargetPath) "C:\Program Files\K2 blackpearl\ServiceBroker\$(TargetFileName)"
net start "K2 blackpearl Server"

This works best if you are doing this in an isolated environment like a VPC.  You’ll drive your co-workers nuts if you restart your shared development server 20 times a day to test your service.  Also, keep in mind if you change the public interface of your service you will also need to refresh the service type definition using the BrokerManagement.exe tool or the SmartObject Service Tester (Amazing SmartObject tool).

I don't remember where I got the idea from, so apologies if it has already been posted somewhere else.


Posted Wed, Apr 1 2009 11:37 AM by DavidL