Gokul's Blog

Using Visual Studio “Build Events” scripts to facilitate development

Leave a comment

 
Exposing a pipeline component assembly to the Pipeline Designer with Visual Studio requires copying pipeline component assemblies to the Pipeline Components folder. You can automate this task by taking advantage of the Visual Studio “Build Events” functionality. The following steps explain this procedure.
  1. Inside Visual Studio, right-click the pipeline component project, and then select properties.
  2. In the properties window, select “Build Events” from the left-side navigation pane.
  3. Click the “Edit Post-build” button, and then insert the following script in the “Post build event command line” window. If you want to GAC the assembly make sure its signed or else remove the lines (3, 4) part below in the script
   1:  IF $(ConfigurationName) EQU Release GOTO done 
   2:   
   3:  call "C:\Program Files\Microsoft Visual Studio 8\VC\vcvarsall.bat" 
   4:  gacutil /if $(TargetPath) /nologo 
   5:   
   6:  xcopy "$(ProjectDir)$(Outdir)$(TargetFileName)" "C:\Program Files\Microsoft BizTalk Server 2006\Pipeline Components" /R /Y /F 
   7:   
   8:  IF %ERRORLEVEL% EQU 0 GOTO done 
   9:   
  10:  net stop "BizTalk Service BizTalk Group : BizTalkServerApplication" 
  11:   
  12:  iisreset 
  13:   
  14:  xcopy "$(ProjectDir)$(Outdir)$(TargetFileName)" "C:\Program Files\Microsoft BizTalk Server 2006\Pipeline Components" /R /Y /F 
  15:   
  16:  net start "BizTalk Service BizTalk Group : BizTalkServerApplication" 
  17:   
  18:  :done 
  

.csharpcode, .csharpcode pre
{
font-size: small;
color: black;
font-family: consolas, “Courier New”, courier, monospace;
background-color: #ffffff;
/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt
{
background-color: #f4f4f4;
width: 100%;
margin: 0em;
}
.csharpcode .lnum { color: #606060; }

This removes the need to manually copy the assembly to the “Pipeline Components” folder every time And also stopping and restarting of BizTalk host instances and IIS.

Edit:

With BizTalk Server 2006 Custom Pipeline components can be placed in GAC. Key can be generated using the command  ">sn -k MykeyFilename"

Refer this link for more information: http://geekswithblogs.net/sthomas/archive/2006/09/27/92513.aspx

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s