Deploying and Debugging of custom DSPI

Damir Dobric Posts

Next talks:

 

    

Follow me on Twitter: #ddobric



 

 

Archives

By developing of the custom Device Service Provider Interface, you will be required many times to re-install the the provider.
For example, you deploy one version and find some bug, which has to be fixed. After fixing of the bug, the new version has to be deployed. This
process is usually recurring for a while, until you get the final stable version. The problem at this place is that deployment (re-registering) of DSPI component
takes too many steps (clicks). Each time you have to register new provider, set some properties and attach to the process. This is just too slow and it does not make a fun.

The good thing is that there is a "fast" way to deploy the provider without of using of RFID-MMC at all. Usually, after registration of the provider, the RFID-management console
silently copies the provider's assembly from registering folder to following folder:

%programfiles%\BizTalk RFID\Providers\daenet filewatcher

In this example "file watcher" is the name of the custom provider which is registered. By each new version of the provider's assembly you should copy the assembly to that folder.
That means, if you deploy the new version just be sure that assembly is copied to the same location. This is exactly the assembly which will be loaded in the application domain.
Because the RFID infrastructure is hosted in the service BizTalkRfid the service has to be stopped before the assembly is copied. After copying of the assembly RFID service has to be
started. After all, attach to the process RfidServices.exe. This process hosts the BizTalkRfid service and your provider.

To perform all steps automatically following should be done:

  1. Create the batch file with the name DeployProvider.bat
  2. Paste following code in the new file:

    net stop biztalkrfid


    copy D:\RfidProjects\Daenet.Rfid.FileProvider\Daenet.Rfid.FileProvider\bin\Debug\Daenet.Rfid.FileProvider.dll
    "c:\program files\Biztalk rfid\Providers\daenet filewatcher"\Daenet.Rfid.FileProvider.dll

    net start biztalkrfid

     

  3. Open Visual Studio, go to menu Tools|External Tools and add new command. As a executable of the command enter the name of the previously created file: DeployProvider.bat.

One could ask why I have chosen to create the external tool instead of registering of Post-Build Event. The reason is of practical nature. Because starting and stopping of the process is relative slow operation it should not be started after each build. Finally, you do not want to deploy the assembly each time you perform a build.


Posted Jun 09 2007, 01:16 AM by Damir Dobric
Filed under:

Comments

Andreas Erben wrote re: Deploying and Debugging of custom DSPI
on 06-10-2007 0:15

I only recommend this procedure to people who know what they are doing :)

The post uses "re-registering" and"deploying" almost as synonyms and provides a "copy over old dll" pattern.

So - beware if you change anything in the DSPI that would affect what happens during the actual registration process.

developers.de is a .Net Community Blog powered by daenet GmbH.