Charles Young

  Home  |   Contact  |   Syndication    |   Login
  196 Posts | 64 Stories | 510 Comments | 373 Trackbacks

News

Twitter












Article Categories

Archives

Post Categories

Image Galleries

Alternative Feeds

BizTalk Bloggers

BizTalk Sites

CEP Bloggers

CMS Bloggers

Fun

Other Bloggers

Rules Bloggers

SharePoint Bloggers

Utilities

WF Bloggers

The BizTalk Server 2004 File Dump utility can be downloaded from the User Samples section of www.gotdotnet.com.   Please provide any feedback (bugs, suggestions etc.,) via this page.

ReadMe

What does the File Dumper utility do?

The BizTalk Server 2004 File Dumper utility allows you to dump the generated output of the Visual Studio BizTalk project to a selected folder. BizTalk Server 2004 does not provide a true compiler. Instead, it generates C# code for schemas, maps, pipelines, orchestrations, in-line functoids, XMLSerializers etc., and then shells out to the C# compiler in order to create assemblies. These C# files are highly transient, and are deleted as soon as compilation is complete. The File Dumper utility allows you to capture copies of the C# code, together with the command line and output used during C# compilation. The utility also produces a batch file based on the generated command line, and adapted to point to the copies of the C# source code.

Why would I use this utility?

Good question! You can rely on BizTalk Server 2004 and Visual Studio to generate assemblies for you without ever having to see the generated C# source code. This is what Microsoft intended. Although it is certainly possible to amend and rebuild the C# code outside of a BizTalk project, your code will be harder to maintain, and there is a danger you may introduce code which conflicts with the functioning of the BizTalk engine. It is not recommended that you use the source code directly in this way unless there is a compelling reason to do so.

Most users of this utility will dump the C# code simply to learn more about how BizTalk Server 2004 works behind the scenes. Studying the C# source code can prove highly instructive, allowing you to see precisely how, for example, XLANG/s script is used to generate Orchestration code and expressions, or how an Orchestration interacts with the engine. This utility is designed to support the BizTalk learning curve and complex troubleshooting, debugging and problem-hunting scenarios.

How do I use the utility?

First install the utility by running the BTSFileDumpInstall.msi package. Then use as follows:

  • Launch the utility by selecting 'BizTalk File Dump Utility' from 'Start/All Programs' or by double-clicking the desktop shortcut.
  • Click the 'Select...' button and select your chosen output directory. Alternatively, type in the name of the output directory. If the directory does not exist, it will be created.
  • Click the 'Start dumping files' button once to start 'listening'. The panel to the right of the button should turn red.
  • Open a BizTalk Server 2004 project in Visual Studio and select 'Build/Rebuild solution' from the menus.
  • Once the rebuild is complete, click the 'View output folder' button to view the dumped files using Windows Explorer.

In addition....

  • You can stop and restart listening to the temp folder at any time using the 'Start dumping files' button.
  • To delete all files in the output folder, click the 'Delete all files in output path' button.
  • If you don't want the utility to generate additional batch files, unselect the 'Auto-generate Make files' option.
  • Click the 'Clear list' button to clear the contents of the log output list.

How does the File Dumper utility work?

Very simply! The code uses the FileSystemWatcher .NET class to respond to any changes made to certain files in the Local Settings\Temp folder in the current user's profile.

When BizTalk Server 2004 generates C# code, it places this code into a Temp directory (as specified by the TMP or TEMP environment variables), compiles it, and then deletes the code. Because there is a short delay while the code is compiled, the File Dumper utility has an opportunity to copy these files to another location.

This mechanism is not foolproof. It is possible for files to be deleted by the BizTalk compiler before they are copied successfully by the File Dumper utility. You will be warned then this has happened. If you simply rebuild the BizTalk project again, it is likely that the timing problem will not reoccur. However, there can be no absolute guarantee that all files will be dumped by the utility.

You must 'Rebuild' rather than 'Build' your BizTalk project in order to dump the entire project.

What types of file are created?

  • C# source files (.cs)
  • Command Line files (.cmdline)
  • Command output files (.out)
  • Error output files (.err)
  • Make files (.bat)

The .out and .err files are created during compilation of the original source code file. There may not be any .err file generated.

'Make' files are created by the utility by copying the contents of .cmdline lines and replacing paths to the original source code with paths to the output folder. In addition, the command line is appended to a call to the csc.exe (C#) compiler. The Make files do not change the assembly output location. This location is the 'obj' folder under the BizTalk project folder.

Why are there several Make files?

When BizTalk Server 2004 creates a new assembly, it generates a number of temporary assemblies during the process. These include assemblies containing in-line functoid code, maps and XMLSerialisation code, as well as assemblies containing schema definitions. Schema assemblies are created in the 'obj' folder. Other assemblies are created in the Temp folder. The utility does not attempt to analyze the dumped files to determine which are for temporary assemblies. Instead, it dumps everything. The last Make file generated is for the final assembly produced by BizTalk projects.

There are additional aspects of code generation in BizTalk Server 2004.  For example, HAT generates and compiles temporary code in order to instantiate classes which populate property grids.  This code is dumped to the output folder. 

Who's responsible for this?

The utility was written by Charles Young. Charles works for SolidSoft Ltd., a UK-based BizTalk Integration specialist company and Microsoft Gold Partner.

Copyright © 2004 Charles Young. All rights reserved.

THIS SOFTWARE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.

You may not distribute this software in any form without express written permission of Charles Young. To report any problems, provide feedback, raise queries or download the latest version, please visit Charles' weblog site.
posted on Thursday, May 13, 2004 8:02 PM

Feedback

# BizTalk Server 2004 File Dump utility 5/13/2004 3:50 PM Charles Young
This utility dumps BizTalk-generated C# source code to an output folder of your choice. BizTalk server 2004 compiles assemblies containing orchestrations, schemas, pipelines, maps, etc., by first generating transitory C# source code. This utility allows you to save copies of that source code for post-compilation inspection. The source code can be used to gain a deeper understanding of BizTalk Server 2004, or as a tool to troubleshoot and debug deeper problems in BizTalk-generated code.

# re: BizTalk Server 2004 File Dump utility 5/16/2004 7:48 AM Steef
I've created a command-line utility who does exaclty the same your tool does. If anyone is interrested, drop me a mail at stephandeckers@hotmail.com.


# re: BizTalk Server 2004 File Dump utility 5/20/2004 7:15 AM Charles Young
To single-step through orchestration code, you will need to do the following:

a) Create a new empty VS.NET C# project
b) Add the source code files to the project
c) Add the required project references. You can work out the list from the .cmdline file
d) Use Project properties to set the assembly name. The rest of the strong name should be correct thanks to the Assembly attributes in one of the source files.
e) Set the Configuration Properties/Debugging/Debug Mode option in Project properties to 'Wait to Attach to an External Process'.
f) Recompile the code using Debug configuration
g) Undeploy any existing assembly and deploy the compiled code using BTSDeploy. Alternatively, copy the compiled code and .pdb to the obj\development folder of the original BizTalk project and use the BizTalk explorer to redeploy (don't rebuild!!)
h) Bind, enlist and start the orchestration(s) in the normal way
i) And now the important bit! You can't debug your code until it has been loaded into the BTS process. To do this, run a message throguh one of the orchestrations. This will load the code.
j) Now, in your .NET C# project, use the Debug/Processes... box to attack to BTSNTSvc.exe.
k) Set a breakpoint in an Orchestration 'segment', and then run a message through that orchestration. You should now be able to single step through the code


# re: BizTalk Server 2004 File Dump utility 12/7/2004 5:06 PM Nasreen
Is this utility still available for download? I get a "requested sample not available" page when attempting to download

# re: BizTalk Server 2004 File Dump utility 12/7/2004 11:02 PM Charles Young
I've just downloaded it OK. If you still can't download it, give me your email address and I'll send it to you.

# re: BizTalk Server 2004 File Dump utility 1/24/2005 7:19 AM Mangai
Hi,

I tried downloading it from gotdotnet website.But there was some Problem.Can yu send it to mangai_dotnet@yahoo.com

Thanks in Advance
Mangai

# re: BizTalk Server 2004 File Dump utility 2/3/2005 2:31 PM Selvan
Hi Charles,
This is a wonderful utility!!!! this what i expected to work on...
But I want to compile the source and work with some Windows form in .NET.
How can i create an instance of it?.

Any idea Pls..

Regards
selvan

# re: BizTalk Server 2004 File Dump utility 2/3/2005 2:40 PM Charles Young
If I understand you correctly, you are wanting to invoke your BizTalk code from a Windows form app. The instructions for creating a compilable VS project are in an earlier feedback item on this page.

You should understand that items such as BizTalk orchestrations are not designed to be invoked directly from custom code. There is nothing that technically prevents you from doing this, of course, but the point is that orchestration code is designed to work very closely with the BizTalk orchestration engine There is a large amount of handshaking and interaction between the engine and an instance of an orchestration class, with state being transmitted between them. To run an orchestration directly from your own code would require you to emulate the engine and support all this interaction. This is not really feasible.

# BizTalk 2004 Debugging Tip 6/6/2005 4:22 PM CedarLogic
Symbolic Debugging for Orchestrations...
http://www.traceofthought.net/PermaLink,guid,75e22eec-348d-4880-bea4-6c7a5316e2dd.aspx...

# re: BizTalk Server 2004 File Dump utility 1/21/2006 4:18 AM LAm Trung
I want to analyze file dump in Window

# re: BizTalk Server 2004 File Dump utility 7/21/2006 8:01 AM flan
Hi Charles,
Do you know whether this utility will also work on BT 2006?

Thanks in anticipation
flan

# re: BizTalk Server 2004 File Dump utility 7/21/2006 2:23 PM Sudhir
Charles,
Thats an excellent utility from you. I think this will not only help me in understanding innards of BizTalk but also hunt down some performance issues, which is cool.
I have a couple of questions for you:
1. When I added all the generated .cs files in a VC# 2003 project, I got a "type definition already exists" error. When I looked at those source code files, I found more than 1 class file containing definitions for Message type, orchestration etc. Is this a normal behavior? If so, how do we know which files to add to the project?
But finally I got the project to compile by adding only a set of files.
2. My orchestrations actually write data using updategrams via SQL Adapter. The very first time I invoke the orchestration, I can debug and step thru everything fine. But from the next request onwards, it throws the following error message:

The adapter "SQL" raised an error message. Details "HRESULT="0x80040e14" Description="Distributed transaction completed. Either enlist this session in a new transaction or the NULL transaction."

Is this is a known issue that I am missing something here? To not get this error, I need to undeploy it and redeploy this again to debug normally.

But in anycase, this is a great tool!
Thanks,
Sudhir.

# re: BizTalk Server 2004 File Dump utility 7/21/2006 2:23 PM Sudhir
Charles,
Thats an excellent utility from you. I think this will not only help me in understanding innards of BizTalk but also hunt down some performance issues, which is cool.
I have a couple of questions for you:
1. When I added all the generated .cs files in a VC# 2003 project, I got a "type definition already exists" error. When I looked at those source code files, I found more than 1 class file containing definitions for Message type, orchestration etc. Is this a normal behavior? If so, how do we know which files to add to the project?
But finally I got the project to compile by adding only a set of files.
2. My orchestrations actually write data using updategrams via SQL Adapter. The very first time I invoke the orchestration, I can debug and step thru everything fine. But from the next request onwards, it throws the following error message:

The adapter "SQL" raised an error message. Details "HRESULT="0x80040e14" Description="Distributed transaction completed. Either enlist this session in a new transaction or the NULL transaction."

Is this is a known issue that I am missing something here? To not get this error, I need to undeploy it and redeploy this again to debug normally.

But in anycase, this is a great tool!
Thanks,
Sudhir.

# re: BizTalk Server 2004 File Dump utility 7/21/2006 2:24 PM Sudhir
Charles,
Thats an excellent utility from you. I think this will not only help me in understanding innards of BizTalk but also hunt down some performance issues, which is cool.
I have a couple of questions for you:
1. When I added all the generated .cs files in a VC# 2003 project, I got a "type definition already exists" error. When I looked at those source code files, I found more than 1 class file containing definitions for Message type, orchestration etc. Is this a normal behavior? If so, how do we know which files to add to the project?
But finally I got the project to compile by adding only a set of files.
2. My orchestrations actually write data using updategrams via SQL Adapter. The very first time I invoke the orchestration, I can debug and step thru everything fine. But from the next request onwards, it throws the following error message:

The adapter "SQL" raised an error message. Details "HRESULT="0x80040e14" Description="Distributed transaction completed. Either enlist this session in a new transaction or the NULL transaction."

Is this is a known issue that I am missing something here? To not get this error, I need to undeploy it and redeploy this again to debug normally.

But in anycase, this is a great tool!
Thanks,
Sudhir.

Post A Comment
Title:
Name:
Email:
Comment:
Verification: