Cleaning up your Biztalk development box

Here’s a command-line script to complete erase alle messages in biztalk messagebox and also clean the tracking database


net stop BTSSvc$BizTalkServerApplication
 IISRESET
 sqlcmd -E -S localhost -d BizTalkMsgBoxDb -Q "EXEC [dbo].[bts_CleanupMsgbox]"
 sqlcmd -E -S localhost -d BizTalkMsgBoxDb -Q "EXEC [dbo].[bts_PurgeSubscriptions]"
 sqlcmd -E -S localhost -d BizTalkDTADb -Q "EXEC [dbo].[dtasp_CleanHMData]"
 net start BTSSvc$BizTalkServerApplication

Remember that bts_CleanupMsgbox is a dummy empty stored procedure after install. First create the stored procedure bts_CleanupMsgBox by running the sql script found in <BizTalk Installation Folder>\Schema\msgbox_cleanup_logic.sql against your MessageBox database(BizTalkMsgBoxDb).

These are the steps the script will execute:

  • Stop all BizTalk services.
  • Reset IIS server (run iisreset from start/run) if you are running any webservices
  • Execute stored procedure bts_CleanupMsgbox on your message box database
  • Execute stored procedure bts_PurgeSubscriptions on your message box database
  • Execute stored procedure dtasp_CleanHMData on your tracking database (BizTalkDTADb)
  • Restart all BizTalk services

Biztalk wcf-sql not able to configure

After installing the biztalk adapter package a colleague stumbled upon the following error when opening the configure button:

Exception has been thrown by the target of an invocation. (mscorblib)
Additional information: Binding not found: sqlBinding (Microsoft.Adapters.Common.Biztalk).

Someone here had the same problem. First we looked at a 32-64 bit issue. What version of BizTalk was installed? We had a 64 bits OS, the BizTalk install looked like a 32 bits?!?! A easy check found here, when you have both these files:
1. BtsNTSvc.exe.config, and
2. BtsNTSvc64.exe.config.
than 64 bits is installed. BizTalk can run multiple hosts in both versions. You can set it in the host properties:

To get the adapter working, you need to install it with the BizTalk Adapter pack setup, exactly as described:

Follow the installation guide here. Finally the configuration of the WCF-SQL worked!

Build event pipeline component.

Another note. Pipeline components also have to be copied to the pipeline components folder in the biztalk program files folder.


IF $(ConfigurationName) EQU Release GOTO done

call "C:\Program Files\Microsoft Visual Studio 8\VC\vcvarsall.bat"
gacutil /if $(TargetPath) /nologo

xcopy "$(ProjectDir)$(Outdir)$(TargetFileName)" "C:\Program Files\Microsoft BizTalk Server 2006\Pipeline Components" /R /Y /F

IF %ERRORLEVEL% EQU 0 GOTO done

net stop "BizTalk Service BizTalk Group : BizTalkServerApplication"

iisreset

xcopy "$(ProjectDir)$(Outdir)$(TargetFileName)" "C:\Program Files\Microsoft BizTalk Server 2006\Pipeline Components" /R /Y /F

net start "BizTalk Service BizTalk Group : BizTalkServerApplication"

:done

This way you can faster debug your pipelines. Attach the biztalk host and go!

How to install assembly to GAC on build event

I keep forgetting this line, and end up having to dig it out from other projects. I am putting it in here so that I can access it faster.

Basically, every time you build/rebuild your .NET assembly, it needs to be in the GAC for BizTalk to be able to use it. So, I put this code on the Build Events to move the assembly to the GAC.

“C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin\gacutil.exe” /i $(TargetFileName)

there. Now I won’t forget.