I would like to know at runtime in which of several possible host processes my current code is executing. The host processes have configured names at the Biztalk management level, but I need to know which process I'm in from inside the code.
I didn't find any supported way to do this and I'm even stuck with the search for an unsupported method :-)
Edit: Thanks to tomasr for the answer. I would need that mainly for logging/tracing purposes. Not only to display the host the ode is running in but also to determine the appropriate trace level.
That also means, I need this deep down on library level and it has to be fast. I can't go and get the call stack for example to find out which top-level-component (orchestration, pipeline, whatever) the code is running in.
On the other hand I could figure it out just once in a singleton constructor. That would be called once per AppDomain and thus could take a little while to look things up. But I probably don't have a very meaningful call stack there, so we are back on square one :-/
Edit2: The Biztalk Management DB must contain the information I need. It knows which hosts are started on which server and (probably) the process id's of these host processes. If someone has a pointer where I could start looking there, that would help me, too.