<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0">
  <channel>
    <title>Carlos Medina's Blog</title>
    <link>http://blogs.devdeo.com/carlos.medina/</link>
    <description />
    <language>en-us</language>
    <copyright>Carlos Medina</copyright>
    <lastBuildDate>Tue, 08 May 2007 04:42:30 GMT</lastBuildDate>
    <generator>newtelligence dasBlog 1.9.7174.0</generator>
    <managingEditor>carlos.medina@devdeo.com</managingEditor>
    <webMaster>carlos.medina@devdeo.com</webMaster>
    <atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/carlosmedina" type="application/rss+xml" /><item>
      <trackback:ping>http://blogs.devdeo.com/carlos.medina/Trackback.aspx?guid=29c4564a-7a49-4269-8648-1ccad6a59628</trackback:ping>
      <pingback:server>http://blogs.devdeo.com/carlos.medina/pingback.aspx</pingback:server>
      <pingback:target>http://blogs.devdeo.com/carlos.medina/PermaLink,guid,29c4564a-7a49-4269-8648-1ccad6a59628.aspx</pingback:target>
      <dc:creator>Carlos Medina</dc:creator>
      <wfw:comment>http://blogs.devdeo.com/carlos.medina/CommentView,guid,29c4564a-7a49-4269-8648-1ccad6a59628.aspx</wfw:comment>
      <wfw:commentRss>http://blogs.devdeo.com/carlos.medina/SyndicationService.asmx/GetEntryCommentsRss?guid=29c4564a-7a49-4269-8648-1ccad6a59628</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
          <strong>
            <u>Symptom</u>
          </strong>
        </p>
        <p>
You receive the following error message when you try to compile one BizTalk
Server 2006 project that contains map files:
</p>
        <p>
          <font color="#ff0000">
            <strong>Error: Build failed. Compiler for file type '*.btm'
failed. Unable to load wrapper:C:\Program Files\Microsoft BizTalk Server 2006\Developer
Tools\Mapper Extensions\Microsoft.BizTalk.Security.SSPI.dll.</strong>
          </font>
        </p>
        <p>
          <strong>
            <u>Resolution</u>
          </strong>
        </p>
        <p>
The BizTalk Server 2006 compiler load this assembly from the GAC, therefore to
fix this problem you must delete the <strong><em>Microsoft.BizTalk.Sercurity.SSPI.dll</em></strong> assembly
from the <strong><em>%biztalk_install%\Developer Tools\Mapper Extensions</em></strong> folder.
</p>
        <img width="0" height="0" src="http://blogs.devdeo.com/carlos.medina/aggbug.ashx?id=29c4564a-7a49-4269-8648-1ccad6a59628" />
      </body>
      <title>Error: Compiler for file type '*.btm' failed</title>
      <guid isPermaLink="false">http://blogs.devdeo.com/carlos.medina/PermaLink,guid,29c4564a-7a49-4269-8648-1ccad6a59628.aspx</guid>
      <link>http://blogs.devdeo.com/carlos.medina/PermaLink,guid,29c4564a-7a49-4269-8648-1ccad6a59628.aspx</link>
      <pubDate>Tue, 08 May 2007 04:42:30 GMT</pubDate>
      <description>&lt;p&gt;
&lt;strong&gt;&lt;u&gt;Symptom&lt;/u&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;p&gt;
You receive&amp;nbsp;the following&amp;nbsp;error message when you try to compile one BizTalk
Server 2006 project that contains map files:
&lt;/p&gt;
&lt;p&gt;
&lt;font color="#ff0000"&gt;&lt;strong&gt;Error: Build failed. Compiler for file type '*.btm'
failed. Unable to load wrapper:C:\Program Files\Microsoft BizTalk Server 2006\Developer
Tools\Mapper Extensions\Microsoft.BizTalk.Security.SSPI.dll.&lt;/strong&gt; &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;&lt;u&gt;Resolution&lt;/u&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;p&gt;
The BizTalk Server 2006 compiler load this assembly from the GAC,&amp;nbsp;therefore to
fix this problem you must delete the &lt;strong&gt;&lt;em&gt;Microsoft.BizTalk.Sercurity.SSPI.dll&lt;/em&gt;&lt;/strong&gt; assembly
from the &lt;strong&gt;&lt;em&gt;%biztalk_install%\Developer Tools\Mapper Extensions&lt;/em&gt;&lt;/strong&gt;&amp;nbsp;folder.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://blogs.devdeo.com/carlos.medina/aggbug.ashx?id=29c4564a-7a49-4269-8648-1ccad6a59628" /&gt;</description>
      <comments>http://blogs.devdeo.com/carlos.medina/CommentView,guid,29c4564a-7a49-4269-8648-1ccad6a59628.aspx</comments>
      <category>biztalk</category>
    </item>
    <item>
      <trackback:ping>http://blogs.devdeo.com/carlos.medina/Trackback.aspx?guid=b3bff742-0ec9-4f5c-a178-625220a46652</trackback:ping>
      <pingback:server>http://blogs.devdeo.com/carlos.medina/pingback.aspx</pingback:server>
      <pingback:target>http://blogs.devdeo.com/carlos.medina/PermaLink,guid,b3bff742-0ec9-4f5c-a178-625220a46652.aspx</pingback:target>
      <dc:creator>Carlos Medina</dc:creator>
      <wfw:comment>http://blogs.devdeo.com/carlos.medina/CommentView,guid,b3bff742-0ec9-4f5c-a178-625220a46652.aspx</wfw:comment>
      <wfw:commentRss>http://blogs.devdeo.com/carlos.medina/SyndicationService.asmx/GetEntryCommentsRss?guid=b3bff742-0ec9-4f5c-a178-625220a46652</wfw:commentRss>
      <slash:comments>14</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
In WCF service, one service can send managed exception information in the detail SOAP
faults from service to client using the <a href="http://msdn2.microsoft.com/en-us/library/system.servicemodel.description.servicedebugbehavior.includeexceptiondetailinfaults.aspx">IncludeExceptionDetailInFaults</a> property.  By
default its value is <strong><em>false</em></strong>, but you can chage it; in
this post I'll show the possible ways to change this value using different techniques.
</p>
        <p>
          <strong>
            <u>Using config file</u>
          </strong>
        </p>
        <p>
This is the most common way, to do it you must specify in the config file of the WCF
service the <a href="http://msdn2.microsoft.com/en-us/library/ms788993.aspx">includeExceptionDetailFaults</a> attribute
to <strong><em>true</em></strong>.  With this action every endpoint associated
to WCF service will send managed exception information. 
</p>
        <pre class="csharpcode">
          <span class="kwrd">&lt;</span>
          <span class="html">system.serviceModel</span>
          <span class="kwrd">&gt;</span>
          <span class="kwrd">&lt;</span>
          <span class="html">services</span>
          <span class="kwrd">&gt;</span>
          <span class="kwrd">&lt;</span>
          <span class="html">service</span>
          <span class="attr">name</span>
          <span class="kwrd">="devdeo.WCF.DebugService"</span>
          <span class="attr">behaviorConfiguration</span>
          <span class="kwrd">="DebugServiceConfiguration"</span>
          <span class="kwrd">&gt;</span>
          <span class="kwrd">&lt;/</span>
          <span class="html">service</span>
          <span class="kwrd">&gt;</span>
          <span class="kwrd">&lt;/</span>
          <span class="html">services</span>
          <span class="kwrd">&gt;</span>
          <span class="kwrd">&lt;</span>
          <span class="html">behaviors</span>
          <span class="kwrd">&gt;</span>
          <span class="kwrd">&lt;</span>
          <span class="html">serviceBehaviors</span>
          <span class="kwrd">&gt;</span>
          <span class="kwrd">&lt;</span>
          <span class="html">behavior</span>
          <span class="attr">name</span>
          <span class="kwrd">="DebugServiceConfiguration"</span>
          <span class="kwrd">&gt;</span>
          <span class="kwrd">&lt;</span>
          <span class="html">serviceDebug</span>
          <span class="attr">includeExceptionDetailInFaults</span>
          <span class="kwrd">="true"</span>
          <span class="kwrd">/&gt;</span>
          <span class="kwrd">&lt;/</span>
          <span class="html">behavior</span>
          <span class="kwrd">&gt;</span>
          <span class="kwrd">&lt;/</span>
          <span class="html">serviceBehaviors</span>
          <span class="kwrd">&gt;</span>
          <span class="kwrd">&lt;/</span>
          <span class="html">behaviors</span>
          <span class="kwrd">&gt;</span>
          <span class="kwrd">&lt;/</span>
          <span class="html">system.serviceModel</span>
          <span class="kwrd">&gt;</span>
        </pre>
        <style type="text/css">.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; }
</style>
        <p>
          <strong>
            <u>Using code</u>
          </strong>
        </p>
        <p>
One way is setting the <a href="http://msdn2.microsoft.com/en-us/library/system.servicemodel.servicebehaviorattribute.includeexceptiondetailinfaults.aspx">IncludeExceptionDatailInFaults</a> property to <strong><em>true</em></strong> using
the ServiceBehaviorAttribute. 
</p>
        <pre class="csharpcode">[ServiceContract(Namespace=<span class="str">"http://wcf.devdeo.com/debug/"</span>)]
[ServiceBehavior(IncludeExceptionDetailInFaults=<span class="kwrd">true</span>)] <span class="kwrd">public</span><span class="kwrd">class</span> DebugService
{ }</pre>
        <style type="text/css">.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; }
</style>
        <p>
Also, you can get the behaviors associated to WCF service using the <a href="http://msdn2.microsoft.com/en-us/library/system.servicemodel.description.servicedescription.behaviors.aspx">Behaviors</a> property
and search the behavior that is related with the ServiceDebugBehavior object
and set its property to true.
</p>
        <pre class="csharpcode">[ServiceContract(Namespace=<span class="str"><a href="http://wcf.devdeo.com/debug/">http://wcf.devdeo.com/debug/</a></span>)] 
<br /><span class="kwrd">public</span><span class="kwrd">class</span> DebugService { } <span class="kwrd">using</span> (ServiceHost
host = <span class="kwrd">new</span> ServiceHost(<span class="kwrd">typeof</span>(DebugService)))
{ ServiceDescription svcDesc = host.Description.Behaviors; ServiceDebugBehavior svcDebug
= svcDesc.Behaviors.Find&lt;ServiceDebugBehavior&gt;(); svcDebug.IncludeExceptionDetailInFaults
= <span class="kwrd">true</span>; host.Open(); }</pre>
        <style type="text/css">.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; }
</style>
        <p>
          <strong>
            <u>Enable the property partially</u>
          </strong>
        </p>
        <p>
Supose that you have a WCF service with two endpoint: <strong><em>debubep1</em></strong> and <strong><em>debugep2</em></strong> 
(see below the config file that represent the configuration), now you need that only
the endpoint called <strong><em>debugep1</em></strong> sends managed exception information. 
</p>
        <pre class="csharpcode">
          <span class="kwrd">&lt;</span>
          <span class="html">system.serviceModel</span>
          <span class="kwrd">&gt;</span>
          <span class="kwrd">&lt;</span>
          <span class="html">services</span>
          <span class="kwrd">&gt;</span>
          <span class="kwrd">&lt;</span>
          <span class="html">service</span>
          <span class="attr">name</span>
          <span class="kwrd">="devdeo.WCF.DebugService"</span>
          <span class="attr">behaviorConfiguration</span>
          <span class="kwrd">="DebugServiceConfiguration"</span>
          <span class="kwrd">&gt;</span>
          <span class="kwrd">&lt;</span>
          <span class="html">endpoint</span>
          <span class="attr">address</span>
          <span class="kwrd">="net.tcp://localhost:8009/wcf/debugep1"</span>
          <span class="attr">binding</span>
          <span class="kwrd">="netTcpBinding"</span>
          <span class="attr">bindingName</span>
          <span class="kwrd">="debugep1"</span>
          <span class="attr">bindingNamespace</span>
          <span class="kwrd">="http://wcf.devdeo.com/binding/"</span>
          <span class="attr">contract</span>
          <span class="kwrd">="devdeo.WCF.DebugService"</span>
          <span class="kwrd">/&gt;</span>
          <span class="kwrd">&lt;</span>
          <span class="html">endpoint</span>
          <span class="attr">address</span>
          <span class="kwrd">="net.tcp://localhost:8009/wcf/debugep2"</span>
          <span class="attr">binding</span>
          <span class="kwrd">="netTcpBinding"</span>
          <span class="attr">bindingName</span>
          <span class="kwrd">="debugep2"</span>
          <span class="attr">bindingNamespace</span>
          <span class="kwrd">="http://wcf.devdeo.com/binding/"</span>
          <span class="attr">contract</span>
          <span class="kwrd">="devdeo.WCF.DebugService"</span>
          <span class="kwrd">/&gt;</span>
          <span class="kwrd">&lt;/</span>
          <span class="html">service</span>
          <span class="kwrd">&gt;</span>
          <span class="kwrd">&lt;</span>
          <span class="html">behaviors</span>
          <span class="kwrd">&gt;</span>
          <span class="kwrd">&lt;</span>
          <span class="html">serviceBehaviors</span>
          <span class="kwrd">&gt;</span>
          <span class="kwrd">&lt;</span>
          <span class="html">behavior</span>
          <span class="attr">name</span>
          <span class="kwrd">="DebugServiceConfiguration"</span>
          <span class="kwrd">&gt;</span>
          <span class="kwrd">&lt;</span>
          <span class="html">serviceDebug</span>
          <span class="attr">includeExceptionDetailInFaults</span>
          <span class="kwrd">="false"</span>
          <span class="kwrd">/&gt;</span>
          <span class="kwrd">&lt;/</span>
          <span class="html">behavior</span>
          <span class="kwrd">&gt;</span>
          <span class="kwrd">&lt;/</span>
          <span class="html">serviceBehaviors</span>
          <span class="kwrd">&gt;</span>
          <span class="kwrd">&lt;/</span>
          <span class="html">behaviors</span>
          <span class="kwrd">&gt;</span>
          <span class="kwrd">&lt;/</span>
          <span class="html">services</span>
          <span class="kwrd">&gt;</span>
          <span class="kwrd">&lt;/</span>
          <span class="html">system.serviceModel</span>
          <span class="kwrd">&gt;</span>
        </pre>
        <style type="text/css">.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; }
</style>
        <p>
To implement this, you must create a custom service class that
derives from Attribute class and <a href="http://msdn2.microsoft.com/en-us/library/ms599118.aspx">IServiceBehavior</a> interface. 
After it, override the <a href="http://msdn2.microsoft.com/en-us/library/ms576779.aspx">ApplyDispatcherBehavior</a> method
to evaluate each endpoint reprensted by the <a href="http://msdn2.microsoft.com/en-us/library/ms522338.aspx">ChannelDispatcher</a> class and
change the IncludeExceptionDetailInFaults to <strong><em>true</em></strong>.
</p>
        <p>
The <a href="http://msdn2.microsoft.com/en-us/library/ms576779.aspx">ApplyDispatcherBehavior</a> method allows
to change run-time property values or insert custom extension objects such as error
handlers, message or parameter interceptors, security extensions, and other custom
extension objects. 
</p>
        <pre class="csharpcode">[ServiceContract(Namespace = <span class="str">"http://wcf.devdeo.com/debug/"</span>)]
[CustomDebugBehavior] <span class="kwrd">public</span><span class="kwrd">class</span> DebugService
{ } <span class="kwrd">public</span><span class="kwrd">class</span> CustomDebugBehaviorAttribute
: Attribute, IServiceBehavior { <span class="preproc">#region</span> IServiceBehavior
Members <span class="kwrd">public</span><span class="kwrd">void</span> AddBindingParameters(ServiceDescription
serviceDescription, ServiceHostBase serviceHostBase, System.Collections.ObjectModel.Collection&lt;ServiceEndpoint&gt;
endpoints, System.ServiceModel.Channels.BindingParameterCollection bindingParameters)
{ <span class="rem">// to-do...</span> } <span class="kwrd">public</span><span class="kwrd">void</span> ApplyDispatchBehavior(ServiceDescription
serviceDescription, ServiceHostBase serviceHostBase) { <span class="kwrd">foreach</span> (ChannelDispatcher
cd <span class="kwrd">in</span> serviceHostBase.ChannelDispatchers) <span class="kwrd">if</span> (cd.BindingName.Equals(<span class="str">"http://wcf.devdeo.com/binding/:debugep1"</span>))
cd.IncludeExceptionDetailInFaults = <span class="kwrd">true</span>; } <span class="kwrd">public</span><span class="kwrd">void</span> Validate(ServiceDescription
serviceDescription, ServiceHostBase serviceHostBase) { <span class="rem">// to-do...</span> } <span class="preproc">#endregion</span> }</pre>
        <style type="text/css">.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; }
</style>
        <p>
At the end, start the WCF service normally. 
</p>
        <pre class="csharpcode">
          <span class="kwrd">using</span> (ServiceHost host = <span class="kwrd">new</span> ServiceHost(<span class="kwrd">typeof</span>(DebugService)))
{ host.Open(); ... }</pre>
        <style type="text/css">.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; }
</style>
        <p>
 
</p>
        <p>
Remember that returning managed exception information to services can be a <strong>security
risk</strong>.  This is because exception details expose information about the
internal client implementation that could be used by unauthorized services.
</p>
        <p>
NOTE: you can read the spanish version of this post at <a href="http://blogs.msdn.com/biztalklatam/archive/2007/04/26/propiedad-includeexceptiondetailinfaults-en-wcf.aspx">Propiedad
IncludeExceptionDetailInFaults en WCF</a></p>
        <img width="0" height="0" src="http://blogs.devdeo.com/carlos.medina/aggbug.ashx?id=b3bff742-0ec9-4f5c-a178-625220a46652" />
      </body>
      <title>How to change the IncludeExceptionDetailInFaults property value</title>
      <guid isPermaLink="false">http://blogs.devdeo.com/carlos.medina/PermaLink,guid,b3bff742-0ec9-4f5c-a178-625220a46652.aspx</guid>
      <link>http://blogs.devdeo.com/carlos.medina/PermaLink,guid,b3bff742-0ec9-4f5c-a178-625220a46652.aspx</link>
      <pubDate>Fri, 04 May 2007 15:20:34 GMT</pubDate>
      <description>&lt;p&gt;
In WCF service, one service can send managed exception information in the detail SOAP
faults from service to client using the &lt;a href="http://msdn2.microsoft.com/en-us/library/system.servicemodel.description.servicedebugbehavior.includeexceptiondetailinfaults.aspx"&gt;IncludeExceptionDetailInFaults&lt;/a&gt; property.&amp;nbsp;&amp;nbsp;By
default&amp;nbsp;its value is &lt;strong&gt;&lt;em&gt;false&lt;/em&gt;&lt;/strong&gt;, but you can chage it; in
this post I'll show the possible ways to change this value using different techniques.
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;&lt;u&gt;Using config file&lt;/u&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;p&gt;
This is the most common way, to do it you must specify in the config file of the WCF
service the &lt;a href="http://msdn2.microsoft.com/en-us/library/ms788993.aspx"&gt;includeExceptionDetailFaults&lt;/a&gt; attribute
to &lt;strong&gt;&lt;em&gt;true&lt;/em&gt;&lt;/strong&gt;.&amp;nbsp; With this action every endpoint&amp;nbsp;associated
to&amp;nbsp;WCF service will send&amp;nbsp;managed exception information.&amp;nbsp;
&lt;/p&gt;
&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;system.serviceModel&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt; &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;services&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt; &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;service&lt;/span&gt; &lt;span class="attr"&gt;name&lt;/span&gt;&lt;span class="kwrd"&gt;="devdeo.WCF.DebugService"&lt;/span&gt; &lt;span class="attr"&gt;behaviorConfiguration&lt;/span&gt;&lt;span class="kwrd"&gt;="DebugServiceConfiguration"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt; &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;service&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt; &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;services&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt; &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;behaviors&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt; &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;serviceBehaviors&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt; &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;behavior&lt;/span&gt; &lt;span class="attr"&gt;name&lt;/span&gt;&lt;span class="kwrd"&gt;="DebugServiceConfiguration"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt; &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;serviceDebug&lt;/span&gt; &lt;span class="attr"&gt;includeExceptionDetailInFaults&lt;/span&gt;&lt;span class="kwrd"&gt;="true"&lt;/span&gt;&lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt; &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;behavior&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt; &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;serviceBehaviors&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt; &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;behaviors&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt; &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;system.serviceModel&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt; &lt;/pre&gt;
&lt;style type="text/css"&gt;.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; }
&lt;/style&gt;
&lt;p&gt;
&lt;strong&gt;&lt;u&gt;Using code&lt;/u&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;p&gt;
One way is setting the &lt;a href="http://msdn2.microsoft.com/en-us/library/system.servicemodel.servicebehaviorattribute.includeexceptiondetailinfaults.aspx"&gt;IncludeExceptionDatailInFaults&lt;/a&gt; property&amp;nbsp;to &lt;strong&gt;&lt;em&gt;true&lt;/em&gt;&lt;/strong&gt; using
the ServiceBehaviorAttribute.&amp;nbsp;
&lt;/p&gt;
&lt;pre class="csharpcode"&gt;[ServiceContract(Namespace=&lt;span class="str"&gt;"http://wcf.devdeo.com/debug/"&lt;/span&gt;)]
[ServiceBehavior(IncludeExceptionDetailInFaults=&lt;span class="kwrd"&gt;true&lt;/span&gt;)] &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; DebugService
{ }&lt;/pre&gt;
&lt;style type="text/css"&gt;.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; }
&lt;/style&gt;
&lt;p&gt;
Also,&amp;nbsp;you can&amp;nbsp;get the behaviors associated&amp;nbsp;to WCF service using the &lt;a href="http://msdn2.microsoft.com/en-us/library/system.servicemodel.description.servicedescription.behaviors.aspx"&gt;Behaviors&lt;/a&gt; property
and&amp;nbsp;search the behavior that is related with the ServiceDebugBehavior object
and set its property to true.
&lt;/p&gt;
&lt;pre class="csharpcode"&gt;[ServiceContract(Namespace=&lt;span class="str"&gt;&lt;a href="http://wcf.devdeo.com/debug/"&gt;http://wcf.devdeo.com/debug/&lt;/a&gt;&lt;/span&gt;)] 
&lt;br&gt;
&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; DebugService { } &lt;span class="kwrd"&gt;using&lt;/span&gt; (ServiceHost
host = &lt;span class="kwrd"&gt;new&lt;/span&gt; ServiceHost(&lt;span class="kwrd"&gt;typeof&lt;/span&gt;(DebugService)))
{ ServiceDescription svcDesc = host.Description.Behaviors; ServiceDebugBehavior svcDebug
= svcDesc.Behaviors.Find&amp;lt;ServiceDebugBehavior&amp;gt;(); svcDebug.IncludeExceptionDetailInFaults
= &lt;span class="kwrd"&gt;true&lt;/span&gt;; host.Open(); }&lt;/pre&gt;
&lt;style type="text/css"&gt;.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; }
&lt;/style&gt;
&lt;p&gt;
&lt;strong&gt;&lt;u&gt;Enable&amp;nbsp;the property partially&lt;/u&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;p&gt;
Supose that you have a WCF service with two endpoint: &lt;strong&gt;&lt;em&gt;debubep1&lt;/em&gt;&lt;/strong&gt; and &lt;strong&gt;&lt;em&gt;debugep2&lt;/em&gt;&lt;/strong&gt;&amp;nbsp;
(see below the config file that represent the configuration), now you need that only
the endpoint called &lt;strong&gt;&lt;em&gt;debugep1&lt;/em&gt;&lt;/strong&gt; sends managed exception information.&amp;nbsp;
&lt;/p&gt;
&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;system.serviceModel&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt; &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;services&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt; &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;service&lt;/span&gt; &lt;span class="attr"&gt;name&lt;/span&gt;&lt;span class="kwrd"&gt;="devdeo.WCF.DebugService"&lt;/span&gt; &lt;span class="attr"&gt;behaviorConfiguration&lt;/span&gt;&lt;span class="kwrd"&gt;="DebugServiceConfiguration"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt; &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;endpoint&lt;/span&gt; &lt;span class="attr"&gt;address&lt;/span&gt;&lt;span class="kwrd"&gt;="net.tcp://localhost:8009/wcf/debugep1"&lt;/span&gt; &lt;span class="attr"&gt;binding&lt;/span&gt;&lt;span class="kwrd"&gt;="netTcpBinding"&lt;/span&gt; &lt;span class="attr"&gt;bindingName&lt;/span&gt;&lt;span class="kwrd"&gt;="debugep1"&lt;/span&gt; &lt;span class="attr"&gt;bindingNamespace&lt;/span&gt;&lt;span class="kwrd"&gt;="http://wcf.devdeo.com/binding/"&lt;/span&gt; &lt;span class="attr"&gt;contract&lt;/span&gt;&lt;span class="kwrd"&gt;="devdeo.WCF.DebugService"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt; &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;endpoint&lt;/span&gt; &lt;span class="attr"&gt;address&lt;/span&gt;&lt;span class="kwrd"&gt;="net.tcp://localhost:8009/wcf/debugep2"&lt;/span&gt; &lt;span class="attr"&gt;binding&lt;/span&gt;&lt;span class="kwrd"&gt;="netTcpBinding"&lt;/span&gt; &lt;span class="attr"&gt;bindingName&lt;/span&gt;&lt;span class="kwrd"&gt;="debugep2"&lt;/span&gt; &lt;span class="attr"&gt;bindingNamespace&lt;/span&gt;&lt;span class="kwrd"&gt;="http://wcf.devdeo.com/binding/"&lt;/span&gt; &lt;span class="attr"&gt;contract&lt;/span&gt;&lt;span class="kwrd"&gt;="devdeo.WCF.DebugService"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt; &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;service&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt; &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;behaviors&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt; &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;serviceBehaviors&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt; &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;behavior&lt;/span&gt; &lt;span class="attr"&gt;name&lt;/span&gt;&lt;span class="kwrd"&gt;="DebugServiceConfiguration"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt; &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;serviceDebug&lt;/span&gt; &lt;span class="attr"&gt;includeExceptionDetailInFaults&lt;/span&gt;&lt;span class="kwrd"&gt;="false"&lt;/span&gt;&lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt; &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;behavior&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt; &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;serviceBehaviors&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt; &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;behaviors&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt; &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;services&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt; &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;system.serviceModel&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;style type="text/css"&gt;.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; }
&lt;/style&gt;
&lt;p&gt;
To implement this, you must&amp;nbsp;create a&amp;nbsp;custom&amp;nbsp;service class&amp;nbsp;that
derives from Attribute class and &lt;a href="http://msdn2.microsoft.com/en-us/library/ms599118.aspx"&gt;IServiceBehavior&lt;/a&gt; interface.&amp;nbsp;
After it, override the &lt;a href="http://msdn2.microsoft.com/en-us/library/ms576779.aspx"&gt;ApplyDispatcherBehavior&lt;/a&gt; method
to evaluate each endpoint reprensted by&amp;nbsp;the &lt;a href="http://msdn2.microsoft.com/en-us/library/ms522338.aspx"&gt;ChannelDispatcher&lt;/a&gt; class&amp;nbsp;and
change the&amp;nbsp;IncludeExceptionDetailInFaults to &lt;strong&gt;&lt;em&gt;true&lt;/em&gt;&lt;/strong&gt;.
&lt;/p&gt;
&lt;p&gt;
The &lt;a href="http://msdn2.microsoft.com/en-us/library/ms576779.aspx"&gt;ApplyDispatcherBehavior&lt;/a&gt; method&amp;nbsp;allows
to change run-time property values or insert custom extension objects such as error
handlers, message or parameter interceptors,&amp;nbsp;security extensions, and other custom
extension objects.&amp;nbsp;
&lt;/p&gt;
&lt;pre class="csharpcode"&gt;[ServiceContract(Namespace = &lt;span class="str"&gt;"http://wcf.devdeo.com/debug/"&lt;/span&gt;)]
[CustomDebugBehavior] &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; DebugService
{ } &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; CustomDebugBehaviorAttribute
: Attribute, IServiceBehavior { &lt;span class="preproc"&gt;#region&lt;/span&gt; IServiceBehavior
Members &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; AddBindingParameters(ServiceDescription
serviceDescription, ServiceHostBase serviceHostBase, System.Collections.ObjectModel.Collection&amp;lt;ServiceEndpoint&amp;gt;
endpoints, System.ServiceModel.Channels.BindingParameterCollection bindingParameters)
{ &lt;span class="rem"&gt;// to-do...&lt;/span&gt; } &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; ApplyDispatchBehavior(ServiceDescription
serviceDescription, ServiceHostBase serviceHostBase) { &lt;span class="kwrd"&gt;foreach&lt;/span&gt; (ChannelDispatcher
cd &lt;span class="kwrd"&gt;in&lt;/span&gt; serviceHostBase.ChannelDispatchers) &lt;span class="kwrd"&gt;if&lt;/span&gt; (cd.BindingName.Equals(&lt;span class="str"&gt;"http://wcf.devdeo.com/binding/:debugep1"&lt;/span&gt;))
cd.IncludeExceptionDetailInFaults = &lt;span class="kwrd"&gt;true&lt;/span&gt;; } &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; Validate(ServiceDescription
serviceDescription, ServiceHostBase serviceHostBase) { &lt;span class="rem"&gt;// to-do...&lt;/span&gt; } &lt;span class="preproc"&gt;#endregion&lt;/span&gt; }&lt;/pre&gt;
&lt;style type="text/css"&gt;.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; }
&lt;/style&gt;
&lt;p&gt;
At the end, start the WCF service normally.&amp;nbsp;
&lt;/p&gt;
&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;using&lt;/span&gt; (ServiceHost host = &lt;span class="kwrd"&gt;new&lt;/span&gt; ServiceHost(&lt;span class="kwrd"&gt;typeof&lt;/span&gt;(DebugService)))
{ host.Open(); ... }&lt;/pre&gt;
&lt;style type="text/css"&gt;.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; }
&lt;/style&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
Remember&amp;nbsp;that returning managed exception information to services can be a &lt;strong&gt;security
risk&lt;/strong&gt;.&amp;nbsp; This is because exception details expose information about the
internal client implementation that could be used by unauthorized services.
&lt;/p&gt;
&lt;p&gt;
NOTE: you can read the spanish version of this post at &lt;a href="http://blogs.msdn.com/biztalklatam/archive/2007/04/26/propiedad-includeexceptiondetailinfaults-en-wcf.aspx"&gt;Propiedad
IncludeExceptionDetailInFaults en WCF&lt;/a&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://blogs.devdeo.com/carlos.medina/aggbug.ashx?id=b3bff742-0ec9-4f5c-a178-625220a46652" /&gt;</description>
      <comments>http://blogs.devdeo.com/carlos.medina/CommentView,guid,b3bff742-0ec9-4f5c-a178-625220a46652.aspx</comments>
      <category>WCF</category>
    </item>
    <item>
      <trackback:ping>http://blogs.devdeo.com/carlos.medina/Trackback.aspx?guid=66f1d16f-1027-4422-96d6-8f5692b4c3d2</trackback:ping>
      <pingback:server>http://blogs.devdeo.com/carlos.medina/pingback.aspx</pingback:server>
      <pingback:target>http://blogs.devdeo.com/carlos.medina/PermaLink,guid,66f1d16f-1027-4422-96d6-8f5692b4c3d2.aspx</pingback:target>
      <dc:creator>Carlos Medina</dc:creator>
      <wfw:comment>http://blogs.devdeo.com/carlos.medina/CommentView,guid,66f1d16f-1027-4422-96d6-8f5692b4c3d2.aspx</wfw:comment>
      <wfw:commentRss>http://blogs.devdeo.com/carlos.medina/SyndicationService.asmx/GetEntryCommentsRss?guid=66f1d16f-1027-4422-96d6-8f5692b4c3d2</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
WCF uses SOAP fault objects to transmit exceptions from a service to a client and,
in the duplex case, from a client to a service in an interoperable way.
Inside this scope, there are two types of SOAP faults that can be sent, declared and
undeclared SOAP faults.  Declared SOAP faults are those in which an operation
has a <a href="http://msdn2.microsoft.com/en-us/library/ms576187.aspx">System.ServiceModel.FaultContractAttribute</a> that
specifies a custom SOAP fault type.  Undeclared SOAP faults are those that are
not specified in the contract for an operation.
</p>
        <p>
This post shows the implementation of declared SOAP fault objects using both
scenarios: one-way and duplex.
</p>
        <p>
          <strong>
            <u>One-way scenario</u>
          </strong>
        </p>
        <p>
This example shows a simple code that use a WCF service to publish a post.  To
do it, one interface called <em><strong>IBlogs</strong></em> defines a <em><strong>CreatePost(</strong>string
post<strong>)</strong></em> method and, to support declared SOAP faults, this method
specifies the <a href="http://msdn2.microsoft.com/en-us/library/ms576187.aspx">FaultContractAttribute</a> to transmit <em><strong>BlogsFault</strong></em> exceptions.
</p>
        <pre class="csharpcode">[ServiceContract(Namespace=<span class="str">"http://wcf.devdeo.com/excepciones"</span>)] <span class="kwrd">interface</span> IBlogs
{ [OperationContract] [FaultContract(<span class="kwrd">typeof</span>(BlogsFault))] <span class="kwrd">void</span> CrearPost(<span class="kwrd">string</span> post);
} [DataContract(Namespace=<span class="str">"http://schemas.devdeo.com/excepciones"</span>)] <span class="kwrd">class</span> BlogsFault
{ [DataMember] <span class="kwrd">public</span><span class="kwrd">string</span> CustomError; <span class="kwrd">public</span> BlogsFault(<span class="kwrd">string</span> error)
{ CustomError = error; } } <span class="kwrd">class</span> BlogsService : IBlogs { <span class="kwrd">public</span><span class="kwrd">void</span> CreatePost(<span class="kwrd">string</span> post)
{ <span class="kwrd">if</span> (post == <span class="kwrd">null</span> || post.Length
== 0) { Console.WriteLine(<span class="str">"Error trying to read the post"</span>); <span class="kwrd">throw</span><span class="kwrd">new</span> FaultException&lt;BlogsFault&gt;(<span class="kwrd">new</span> BlogsFault(<span class="str">"The
post was incorrect"</span>)); } Console.WriteLine(<span class="kwrd">string</span>.Format(<span class="str">"The
post: \"{0}\" was published"</span>, post)); } }</pre>
        <style type="text/css">.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; }
</style>
        <style type="text/css">.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; }
</style>
        <p>
 
</p>
        <p>
The client invokes the WCF service two times; the first time the client
try to publish the post <em>"First post"</em>, and the WCF service doesn't generate
any error.  The second time the client try to publish an empty post, but at this
time the WCF service generates an error and sent it as a SOAP fault object represented
by the <strong><em>BlogsFault</em></strong> class.  At this time, the client
capture the error using a try..catch... block with the <a href="http://msdn2.microsoft.com/en-us/library/ms576199.aspx">FaultException&lt;&gt;</a> class.
</p>
        <pre class="csharpcode">
          <span class="kwrd">class</span> Program { <span class="kwrd">static</span><span class="kwrd">void</span> Main(<span class="kwrd">string</span>[]
args) { BlogsClient client = <span class="kwrd">new</span> BlogsClient(); client.CreatePost(<span class="str">"First
post"</span>); <span class="kwrd">try</span> { client.CreatePost(<span class="str">""</span>);
} <span class="kwrd">catch</span> (FaultException&lt;BlogsFault&gt; e) { Console.WriteLine(<span class="kwrd">string</span>.Format(<span class="str">"Error:
{0}"</span>, e.Detail.CustomError)); } } }</pre>
        <style type="text/css">.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; }
</style>
        <p>
          <strong>
            <u>Duplex scenario</u>
          </strong>
        </p>
        <p>
Now, to simulate a duplex scenario, the WCF service will need a confirmation from
client before to publish the post.  In this case, a new interface called <strong><em>IBlogsCallback</em></strong> is
implemented and specifyed as a <a href="http://msdn2.microsoft.com/en-us/library/ms575923.aspx">CallbackContract</a> property
in the service.
</p>
        <p>
If the client doesn't confirm the post, a <strong><em>BlogsFault</em></strong> exception
is generated and sent to service as a SOAP fault object.
</p>
        <pre class="csharpcode">[ServiceContract(Namespace=<span class="str">"http://wcf.devdeo.com/excepciones"</span>,CallbackContract=<span class="kwrd">typeof</span>(IBlogsCallback))] <span class="kwrd">interface</span> IBlogs
{ [OperationContract] [FaultContract(<span class="kwrd">typeof</span>(BlogsFault))] <span class="kwrd">void</span> CreatePost(<span class="kwrd">string</span> post);
} <span class="kwrd">interface</span> IBlogsCallback { [OperationContract] [FaultContract(<span class="kwrd">typeof</span>(BlogsFault))] <span class="kwrd">void</span> ConfirmPost(<span class="kwrd">string</span> post);
} [ServiceBehavior(ConcurrencyMode=ConcurrencyMode.Reentrant)] <span class="kwrd">class</span> BlogsService
: IBlogs { <span class="kwrd">public</span><span class="kwrd">void</span> CreatePost(<span class="kwrd">string</span> post)
{ <span class="kwrd">if</span> (post == <span class="kwrd">null</span> || post.Length
== 0) { Console.WriteLine(<span class="str">"Error trying to read the post"</span>); <span class="kwrd">throw</span><span class="kwrd">new</span> FaultException&lt;BlogsFault&gt;(<span class="kwrd">new</span> BlogsFault(<span class="str">"The
post was incorrect"</span>)); } <span class="kwrd">try</span> { Callback.ConfirmarPost(post);
} <span class="kwrd">catch</span>(FaultException&lt;BlogsFault&gt; e) { Console.WriteLine(<span class="kwrd">string</span>.Format(<span class="str">"The
post: \"{0}\" cannot be published"</span>, e.Detail.CustomError)); <span class="kwrd">return</span>;
} Console.WriteLine(<span class="kwrd">string</span>.Format(<span class="str">"The
post: \"{0}\" was published"</span>, post)); } <span class="kwrd">public</span> IBlogsCallback
Callback { get { <span class="kwrd">return</span> OperationContext.Current.GetCallbackChannel&lt;IBlogsCallback&gt;();
} } } [DataContract(Namespace=<span class="str">"http://schemas.devdeo.com/excepciones"</span>)] <span class="kwrd">class</span> BlogsFault
{ [DataMember] <span class="kwrd">public</span><span class="kwrd">string</span> CustomError; <span class="kwrd">public</span> BlogsFault(<span class="kwrd">string</span> error)
{ CustomError = error; } }</pre>
        <style type="text/css">.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; }
</style>
        <p>
At last, the client must implement the <em><strong>ConfirmPost(</strong>string post<strong>)</strong></em> method
to confirm the post.
</p>
        <pre class="csharpcode">
          <span class="kwrd">public</span>
          <span class="kwrd">class</span> Blogs
: IBlogsCallback { <span class="kwrd">public</span><span class="kwrd">void</span> ConfirmPost(<span class="kwrd">string</span> post)
{ Console.WriteLine(<span class="kwrd">string</span>.Format(<span class="str">"Do
you really want publish the post: \"{0}\" ? Y/N"</span>, post)); <span class="kwrd">string</span> result
= Console.ReadLine(); <span class="kwrd">if</span> (result == <span class="str">"N"</span>)
{ BlogsFault fault = <span class="kwrd">new</span> BlogsFault(); fault.CustomError
= <span class="str">"The user doesn't publish the post"</span>; <span class="kwrd">throw</span><span class="kwrd">new</span> FaultException&lt;BlogsFault&gt;(fault);
} } } <span class="kwrd">class</span> Program { <span class="kwrd">static</span><span class="kwrd">void</span> Main(<span class="kwrd">string</span>[]
args) { Blogs confirm = <span class="kwrd">new</span> Blogs(); InstanceContext ctx
= <span class="kwrd">new</span> InstanceContext(confirm); BlogsClient client = <span class="kwrd">new</span> BlogsClient(ctx);
client.CreatePost(<span class="str">"First post"</span>); <span class="kwrd">try</span> {
cliente.CreatePost(<span class="str">""</span>); } <span class="kwrd">catch</span> (FaultException&lt;BlogsFault&gt;
e) { Console.WriteLine(<span class="kwrd">string</span>.Format(<span class="str">"Error:
{0}"</span>, e.Detail.CustomError)); } } }</pre>
        <style type="text/css">.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; }
</style>
        <p>
 
</p>
        <p>
NOTE: you can read the spanish version of this post at <a href="http://blogs.msdn.com/biztalklatam/archive/2007/04/23/manejando-excepciones-en-wcf.aspx">Manejando
excepciones en WCF</a></p>
        <img width="0" height="0" src="http://blogs.devdeo.com/carlos.medina/aggbug.ashx?id=66f1d16f-1027-4422-96d6-8f5692b4c3d2" />
      </body>
      <title>Managing exceptions in WCF</title>
      <guid isPermaLink="false">http://blogs.devdeo.com/carlos.medina/PermaLink,guid,66f1d16f-1027-4422-96d6-8f5692b4c3d2.aspx</guid>
      <link>http://blogs.devdeo.com/carlos.medina/PermaLink,guid,66f1d16f-1027-4422-96d6-8f5692b4c3d2.aspx</link>
      <pubDate>Mon, 30 Apr 2007 12:33:08 GMT</pubDate>
      <description>&lt;p&gt;
WCF uses SOAP fault objects to transmit exceptions from a service to a client and,
in the duplex case,&amp;nbsp;from a client to a&amp;nbsp;service in an interoperable way.
Inside this scope, there are two types of SOAP faults that can be sent, declared and
undeclared SOAP faults.&amp;nbsp; Declared SOAP faults are those in which an operation
has a &lt;a href="http://msdn2.microsoft.com/en-us/library/ms576187.aspx"&gt;System.ServiceModel.FaultContractAttribute&lt;/a&gt; that
specifies a custom SOAP fault type.&amp;nbsp; Undeclared SOAP faults are those that are
not specified in the contract for an operation.
&lt;/p&gt;
&lt;p&gt;
This post shows the implementation of declared SOAP fault objects&amp;nbsp;using&amp;nbsp;both
scenarios: one-way and duplex.
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;&lt;u&gt;One-way scenario&lt;/u&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;p&gt;
This example shows a simple code that use a WCF service to publish a post.&amp;nbsp; To
do it, one interface called &lt;em&gt;&lt;strong&gt;IBlogs&lt;/strong&gt;&lt;/em&gt;&amp;nbsp;defines a&amp;nbsp;&lt;em&gt;&lt;strong&gt;CreatePost(&lt;/strong&gt;string
post&lt;strong&gt;)&lt;/strong&gt;&lt;/em&gt; method and, to support declared SOAP faults, this method
specifies the &lt;a href="http://msdn2.microsoft.com/en-us/library/ms576187.aspx"&gt;FaultContractAttribute&lt;/a&gt; to&amp;nbsp;transmit &lt;em&gt;&lt;strong&gt;BlogsFault&lt;/strong&gt;&lt;/em&gt; exceptions.
&lt;/p&gt;
&lt;pre class=csharpcode&gt;[ServiceContract(Namespace=&lt;span class=str&gt;"http://wcf.devdeo.com/excepciones"&lt;/span&gt;)] &lt;span class=kwrd&gt;interface&lt;/span&gt; IBlogs
{ [OperationContract] [FaultContract(&lt;span class=kwrd&gt;typeof&lt;/span&gt;(BlogsFault))] &lt;span class=kwrd&gt;void&lt;/span&gt; CrearPost(&lt;span class=kwrd&gt;string&lt;/span&gt; post);
} [DataContract(Namespace=&lt;span class=str&gt;"http://schemas.devdeo.com/excepciones"&lt;/span&gt;)] &lt;span class=kwrd&gt;class&lt;/span&gt; BlogsFault
{ [DataMember] &lt;span class=kwrd&gt;public&lt;/span&gt; &lt;span class=kwrd&gt;string&lt;/span&gt; CustomError; &lt;span class=kwrd&gt;public&lt;/span&gt; BlogsFault(&lt;span class=kwrd&gt;string&lt;/span&gt; error)
{ CustomError = error; } } &lt;span class=kwrd&gt;class&lt;/span&gt; BlogsService : IBlogs { &lt;span class=kwrd&gt;public&lt;/span&gt; &lt;span class=kwrd&gt;void&lt;/span&gt; CreatePost(&lt;span class=kwrd&gt;string&lt;/span&gt; post)
{ &lt;span class=kwrd&gt;if&lt;/span&gt; (post == &lt;span class=kwrd&gt;null&lt;/span&gt; || post.Length
== 0) { Console.WriteLine(&lt;span class=str&gt;"Error trying to read the post"&lt;/span&gt;); &lt;span class=kwrd&gt;throw&lt;/span&gt; &lt;span class=kwrd&gt;new&lt;/span&gt; FaultException&amp;lt;BlogsFault&amp;gt;(&lt;span class=kwrd&gt;new&lt;/span&gt; BlogsFault(&lt;span class=str&gt;"The
post was incorrect"&lt;/span&gt;)); } Console.WriteLine(&lt;span class=kwrd&gt;string&lt;/span&gt;.Format(&lt;span class=str&gt;"The
post: \"{0}\" was published"&lt;/span&gt;, post)); } }&lt;/pre&gt;
&lt;style type=text/css&gt;.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; }
&lt;/style&gt;
&lt;style type=text/css&gt;.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; }
&lt;/style&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
The&amp;nbsp;client&amp;nbsp;invokes the WCF service two times; the first time the client
try to publish the post &lt;em&gt;"First post"&lt;/em&gt;, and the WCF service doesn't generate
any error.&amp;nbsp; The second time the client try to publish an empty post, but at this
time the WCF service generates an error and sent it as a SOAP fault object represented
by the &lt;strong&gt;&lt;em&gt;BlogsFault&lt;/em&gt;&lt;/strong&gt; class.&amp;nbsp; At this time, the client
capture the error using&amp;nbsp;a try..catch... block&amp;nbsp;with the &lt;a href="http://msdn2.microsoft.com/en-us/library/ms576199.aspx"&gt;FaultException&amp;lt;&amp;gt;&lt;/a&gt; class.
&lt;/p&gt;
&lt;pre class=csharpcode&gt;&lt;span class=kwrd&gt;class&lt;/span&gt; Program { &lt;span class=kwrd&gt;static&lt;/span&gt; &lt;span class=kwrd&gt;void&lt;/span&gt; Main(&lt;span class=kwrd&gt;string&lt;/span&gt;[]
args) { BlogsClient client = &lt;span class=kwrd&gt;new&lt;/span&gt; BlogsClient(); client.CreatePost(&lt;span class=str&gt;"First
post"&lt;/span&gt;); &lt;span class=kwrd&gt;try&lt;/span&gt; { client.CreatePost(&lt;span class=str&gt;""&lt;/span&gt;);
} &lt;span class=kwrd&gt;catch&lt;/span&gt; (FaultException&amp;lt;BlogsFault&amp;gt; e) { Console.WriteLine(&lt;span class=kwrd&gt;string&lt;/span&gt;.Format(&lt;span class=str&gt;"Error:
{0}"&lt;/span&gt;, e.Detail.CustomError)); } } }&lt;/pre&gt;
&lt;style type=text/css&gt;.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; }
&lt;/style&gt;
&lt;p&gt;
&lt;strong&gt;&lt;u&gt;Duplex scenario&lt;/u&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;p&gt;
Now, to simulate a duplex scenario, the WCF service will need a confirmation from
client before to publish the post.&amp;nbsp; In this case, a new interface called &lt;strong&gt;&lt;em&gt;IBlogsCallback&lt;/em&gt;&lt;/strong&gt; is
implemented and specifyed as a &lt;a href="http://msdn2.microsoft.com/en-us/library/ms575923.aspx"&gt;CallbackContract&lt;/a&gt;&amp;nbsp;property
in&amp;nbsp;the&amp;nbsp;service.
&lt;/p&gt;
&lt;p&gt;
If the client doesn't confirm the post, a &lt;strong&gt;&lt;em&gt;BlogsFault&lt;/em&gt;&lt;/strong&gt; exception
is generated and sent to service as a SOAP fault object.
&lt;/p&gt;
&lt;pre class=csharpcode&gt;[ServiceContract(Namespace=&lt;span class=str&gt;"http://wcf.devdeo.com/excepciones"&lt;/span&gt;,CallbackContract=&lt;span class=kwrd&gt;typeof&lt;/span&gt;(IBlogsCallback))] &lt;span class=kwrd&gt;interface&lt;/span&gt; IBlogs
{ [OperationContract] [FaultContract(&lt;span class=kwrd&gt;typeof&lt;/span&gt;(BlogsFault))] &lt;span class=kwrd&gt;void&lt;/span&gt; CreatePost(&lt;span class=kwrd&gt;string&lt;/span&gt; post);
} &lt;span class=kwrd&gt;interface&lt;/span&gt; IBlogsCallback { [OperationContract] [FaultContract(&lt;span class=kwrd&gt;typeof&lt;/span&gt;(BlogsFault))] &lt;span class=kwrd&gt;void&lt;/span&gt; ConfirmPost(&lt;span class=kwrd&gt;string&lt;/span&gt; post);
} [ServiceBehavior(ConcurrencyMode=ConcurrencyMode.Reentrant)] &lt;span class=kwrd&gt;class&lt;/span&gt; BlogsService
: IBlogs { &lt;span class=kwrd&gt;public&lt;/span&gt; &lt;span class=kwrd&gt;void&lt;/span&gt; CreatePost(&lt;span class=kwrd&gt;string&lt;/span&gt; post)
{ &lt;span class=kwrd&gt;if&lt;/span&gt; (post == &lt;span class=kwrd&gt;null&lt;/span&gt; || post.Length
== 0) { Console.WriteLine(&lt;span class=str&gt;"Error trying to read the post"&lt;/span&gt;); &lt;span class=kwrd&gt;throw&lt;/span&gt; &lt;span class=kwrd&gt;new&lt;/span&gt; FaultException&amp;lt;BlogsFault&amp;gt;(&lt;span class=kwrd&gt;new&lt;/span&gt; BlogsFault(&lt;span class=str&gt;"The
post was incorrect"&lt;/span&gt;)); } &lt;span class=kwrd&gt;try&lt;/span&gt; { Callback.ConfirmarPost(post);
} &lt;span class=kwrd&gt;catch&lt;/span&gt;(FaultException&amp;lt;BlogsFault&amp;gt; e) { Console.WriteLine(&lt;span class=kwrd&gt;string&lt;/span&gt;.Format(&lt;span class=str&gt;"The
post: \"{0}\" cannot be published"&lt;/span&gt;, e.Detail.CustomError)); &lt;span class=kwrd&gt;return&lt;/span&gt;;
} Console.WriteLine(&lt;span class=kwrd&gt;string&lt;/span&gt;.Format(&lt;span class=str&gt;"The post:
\"{0}\" was published"&lt;/span&gt;, post)); } &lt;span class=kwrd&gt;public&lt;/span&gt; IBlogsCallback
Callback { get { &lt;span class=kwrd&gt;return&lt;/span&gt; OperationContext.Current.GetCallbackChannel&amp;lt;IBlogsCallback&amp;gt;();
} } } [DataContract(Namespace=&lt;span class=str&gt;"http://schemas.devdeo.com/excepciones"&lt;/span&gt;)] &lt;span class=kwrd&gt;class&lt;/span&gt; BlogsFault
{ [DataMember] &lt;span class=kwrd&gt;public&lt;/span&gt; &lt;span class=kwrd&gt;string&lt;/span&gt; CustomError; &lt;span class=kwrd&gt;public&lt;/span&gt; BlogsFault(&lt;span class=kwrd&gt;string&lt;/span&gt; error)
{ CustomError = error; } }&lt;/pre&gt;
&lt;style type=text/css&gt;.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; }
&lt;/style&gt;
&lt;p&gt;
At last, the client must implement the &lt;em&gt;&lt;strong&gt;ConfirmPost(&lt;/strong&gt;string post&lt;strong&gt;)&lt;/strong&gt;&lt;/em&gt; method
to confirm the post.
&lt;/p&gt;
&lt;pre class=csharpcode&gt;&lt;span class=kwrd&gt;public&lt;/span&gt; &lt;span class=kwrd&gt;class&lt;/span&gt; Blogs
: IBlogsCallback { &lt;span class=kwrd&gt;public&lt;/span&gt; &lt;span class=kwrd&gt;void&lt;/span&gt; ConfirmPost(&lt;span class=kwrd&gt;string&lt;/span&gt; post)
{ Console.WriteLine(&lt;span class=kwrd&gt;string&lt;/span&gt;.Format(&lt;span class=str&gt;"Do you
really want publish the post: \"{0}\" ? Y/N"&lt;/span&gt;, post)); &lt;span class=kwrd&gt;string&lt;/span&gt; result
= Console.ReadLine(); &lt;span class=kwrd&gt;if&lt;/span&gt; (result == &lt;span class=str&gt;"N"&lt;/span&gt;)
{ BlogsFault fault = &lt;span class=kwrd&gt;new&lt;/span&gt; BlogsFault(); fault.CustomError = &lt;span class=str&gt;"The
user doesn't publish the post"&lt;/span&gt;; &lt;span class=kwrd&gt;throw&lt;/span&gt; &lt;span class=kwrd&gt;new&lt;/span&gt; FaultException&amp;lt;BlogsFault&amp;gt;(fault);
} } } &lt;span class=kwrd&gt;class&lt;/span&gt; Program { &lt;span class=kwrd&gt;static&lt;/span&gt; &lt;span class=kwrd&gt;void&lt;/span&gt; Main(&lt;span class=kwrd&gt;string&lt;/span&gt;[]
args) { Blogs confirm = &lt;span class=kwrd&gt;new&lt;/span&gt; Blogs(); InstanceContext ctx = &lt;span class=kwrd&gt;new&lt;/span&gt; InstanceContext(confirm);
BlogsClient client = &lt;span class=kwrd&gt;new&lt;/span&gt; BlogsClient(ctx); client.CreatePost(&lt;span class=str&gt;"First
post"&lt;/span&gt;); &lt;span class=kwrd&gt;try&lt;/span&gt; { cliente.CreatePost(&lt;span class=str&gt;""&lt;/span&gt;);
} &lt;span class=kwrd&gt;catch&lt;/span&gt; (FaultException&amp;lt;BlogsFault&amp;gt; e) { Console.WriteLine(&lt;span class=kwrd&gt;string&lt;/span&gt;.Format(&lt;span class=str&gt;"Error:
{0}"&lt;/span&gt;, e.Detail.CustomError)); } } }&lt;/pre&gt;
&lt;style type=text/css&gt;.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; }
&lt;/style&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
NOTE: you can&amp;nbsp;read the spanish version of this post&amp;nbsp;at&amp;nbsp;&lt;a href="http://blogs.msdn.com/biztalklatam/archive/2007/04/23/manejando-excepciones-en-wcf.aspx"&gt;Manejando
excepciones en WCF&lt;/a&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://blogs.devdeo.com/carlos.medina/aggbug.ashx?id=66f1d16f-1027-4422-96d6-8f5692b4c3d2" /&gt;</description>
      <comments>http://blogs.devdeo.com/carlos.medina/CommentView,guid,66f1d16f-1027-4422-96d6-8f5692b4c3d2.aspx</comments>
      <category>WCF</category>
    </item>
    <item>
      <trackback:ping>http://blogs.devdeo.com/carlos.medina/Trackback.aspx?guid=40a467c8-2335-4a49-a628-59db525462a1</trackback:ping>
      <pingback:server>http://blogs.devdeo.com/carlos.medina/pingback.aspx</pingback:server>
      <pingback:target>http://blogs.devdeo.com/carlos.medina/PermaLink,guid,40a467c8-2335-4a49-a628-59db525462a1.aspx</pingback:target>
      <dc:creator>Carlos Medina</dc:creator>
      <wfw:comment>http://blogs.devdeo.com/carlos.medina/CommentView,guid,40a467c8-2335-4a49-a628-59db525462a1.aspx</wfw:comment>
      <wfw:commentRss>http://blogs.devdeo.com/carlos.medina/SyndicationService.asmx/GetEntryCommentsRss?guid=40a467c8-2335-4a49-a628-59db525462a1</wfw:commentRss>
      <slash:comments>2</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
The Commerce Server team has announced that a Technology Preview of the Commerce Server
2007 Starter Site is now available.   This CS2007 Starter Site CTP will <em>NOT
FOR PRODUCTION USAGE</em>, and will <em>NOT</em> supported by Microsoft.
</p>
        <p>
If you are an existing beta tester from the CS2007 beta progam, in <a href="https://connect.microsoft.com/site/sitehome.aspx?SiteID=64" target="_blank">Connect:
CS2007 Starter Site CTP</a> you can find more information and download the product.
</p>
        <p>
If you have not participated in the CS2007 beta program, go to <a href="http://connect.microsoft.com">http://connect.microsoft.com</a> and
sign-in using your Passport Account.  After it, you will need to choose CS2007Starter
Site CTP from the list of available programs by clicking the link for "Available Connections"
in the menu on the left side of the page. From the list of available programs, click
on the link to "Apply" next to the CS2007 Starter Site CTP. After completing registration,
you will be automatically given access to the Connect site to download the starter
site. From the CS2007 Starter Site CTP home page you can click on the "Downloads"
link on the left side of the page, which will load a page showing all downloads currently
available on the site for Commerce Server.
</p>
        <img width="0" height="0" src="http://blogs.devdeo.com/carlos.medina/aggbug.ashx?id=40a467c8-2335-4a49-a628-59db525462a1" />
      </body>
      <title>CS2007 Starter Site CTP available</title>
      <guid isPermaLink="false">http://blogs.devdeo.com/carlos.medina/PermaLink,guid,40a467c8-2335-4a49-a628-59db525462a1.aspx</guid>
      <link>http://blogs.devdeo.com/carlos.medina/PermaLink,guid,40a467c8-2335-4a49-a628-59db525462a1.aspx</link>
      <pubDate>Fri, 25 Aug 2006 21:05:12 GMT</pubDate>
      <description>&lt;p&gt;
The Commerce Server team has announced that a Technology Preview of the Commerce Server
2007 Starter Site is now available.&amp;nbsp;&amp;nbsp; This CS2007 Starter Site CTP will&amp;nbsp;&lt;em&gt;NOT
FOR PRODUCTION USAGE&lt;/em&gt;, and&amp;nbsp;will&amp;nbsp;&lt;em&gt;NOT&lt;/em&gt; supported by Microsoft.
&lt;/p&gt;
&lt;p&gt;
If you are an existing beta tester from the CS2007 beta progam, in &lt;a href="https://connect.microsoft.com/site/sitehome.aspx?SiteID=64" target="_blank"&gt;Connect:
CS2007 Starter Site CTP&lt;/a&gt; you can find more information and download the product.
&lt;/p&gt;
&lt;p&gt;
If you have not participated in the CS2007 beta program, go to &lt;a href="http://connect.microsoft.com"&gt;http://connect.microsoft.com&lt;/a&gt; and
sign-in using your Passport Account.&amp;nbsp; After it, you will need to choose CS2007Starter
Site CTP from the list of available programs by clicking the link for "Available Connections"
in the menu on the left side of the page. From the list of available programs, click
on the link to "Apply" next to the CS2007 Starter Site CTP. After completing registration,
you will be automatically given access to the Connect site to download the starter
site. From the CS2007 Starter Site CTP home page you can click on the "Downloads"
link on the left side of the page, which will load a page showing all downloads currently
available on the site for Commerce Server.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://blogs.devdeo.com/carlos.medina/aggbug.ashx?id=40a467c8-2335-4a49-a628-59db525462a1" /&gt;</description>
      <comments>http://blogs.devdeo.com/carlos.medina/CommentView,guid,40a467c8-2335-4a49-a628-59db525462a1.aspx</comments>
    </item>
    <item>
      <trackback:ping>http://blogs.devdeo.com/carlos.medina/Trackback.aspx?guid=9423b134-1db8-4306-8694-0562cecde913</trackback:ping>
      <pingback:server>http://blogs.devdeo.com/carlos.medina/pingback.aspx</pingback:server>
      <pingback:target>http://blogs.devdeo.com/carlos.medina/PermaLink,guid,9423b134-1db8-4306-8694-0562cecde913.aspx</pingback:target>
      <dc:creator>Carlos Medina</dc:creator>
      <wfw:comment>http://blogs.devdeo.com/carlos.medina/CommentView,guid,9423b134-1db8-4306-8694-0562cecde913.aspx</wfw:comment>
      <wfw:commentRss>http://blogs.devdeo.com/carlos.medina/SyndicationService.asmx/GetEntryCommentsRss?guid=9423b134-1db8-4306-8694-0562cecde913</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
        </p>
        <p>
          <u>
            <b>Explanation</b>
          </u>
        </p>
        <p>
The execution mode value defined for some stage in the policy file is <b>None</b>.
The value <b>None</b> is not available for execution mode, the available values are <b>FirstMatch</b> or <b>All</b> only. 
</p>
        <p>
          <u>
            <b>User Action</b>
          </u>
        </p>
        <p>
All pipeline templates have an associated policy file that determines pipeline’s stages,
the number of components allowed per stage, and the execution mode of each stage,
among others. To specify that one stage can not execute components, use minimum and
maximum occurs instead of execution mode. 
</p>
        <p>
To resolve this problem is necessary to edit the pipeline’s policy file. The file
name can be found in pipeline’s properties windows in Visual Studio 2005 (see figure
below), this policy file is stored in <i>&lt;Biztalk Server Installation Directory&gt;\Developer
Tools\Pipeline Policy Files</i> directory. 
</p>
        <p>
          <a href="http://blogs.devdeo.com/carlos.medina/content/binary/18e01883d967_D4E6/PolicyFilePath1.jpg" atomicselection="true">
            <img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="153" src="http://blogs.devdeo.com/carlos.medina/content/binary/18e01883d967_D4E6/PolicyFilePath.jpg" width="259" border="0" />
          </a>
        </p>
        <p>
After the file is opened, you must change the value for execution mode in policy file
to <b>All</b> or <b>FirstMatch</b>. 
</p>
        <p>
          <em>
            <u>Changing the execution mode value</u>
          </em>
        </p>
        <p>
The execution mode is represented in the policy file by the execMethod attribute;
it is in the node <i>/Document/Stages/Stage</i>. Open the pipeline’s policy file and
identify where this attribute is with value equals to <b>None</b> and replace it by <b>All</b> or <b>FirstMatch</b> as
we shown: 
</p>
        <p>
          <i>Before:</i>
        </p>
        <pre class="csharpcode">&lt;?xml version=<span class="str">"1.0"</span> encoding=<span class="str">"utf-8"</span>?&gt;
&lt;Document xmlns:xsd=<span class="str">""</span> xmlns:xsi=<span class="str">""</span> CategoryId=<span class="str">""</span> FriendlyName=<span class="str">""</span>&gt;
&lt;Stages&gt; &lt;Stage Name=<span class="str">"Decode"</span> minOccurs=<span class="str">"0"</span> maxOccurs=<span class="str">"-1"</span> execMethod=<span class="str">"None"</span>&gt;&lt;/Stage&gt;
&lt;/Stages&gt; &lt;/Document&gt;</pre>
        <p>
          <i>After:</i>
        </p>
        <pre class="csharpcode">&lt;?xml version=<span class="str">"1.0"</span> encoding=<span class="str">"utf-8"</span>?&gt;
&lt;Document xmlns:xsd=<span class="str">""</span> xmlns:xsi=<span class="str">""</span> CategoryId=<span class="str">""</span> FriendlyName=<span class="str">""</span>&gt;
&lt;Stages&gt; &lt;Stage Name=<span class="str">"Decode"</span> minOccurs=<span class="str">"0"</span> maxOccurs=<span class="str">"-1"</span> execMethod=<span class="str">"All"</span>&gt;&lt;/Stage&gt;
&lt;/Stages&gt; &lt;/Document&gt;</pre>
        <p>
At last, close and open the pipeline file in Visual Studio 2005 to see these changes
replicated. The following is the explanation step by step. 
</p>
        <p>
          <strong>
            <u>One way, but not the right way</u>
          </strong>
        </p>
        <p>
If you want that one stage can not execute any component, you must setting the
minimum and maximum occurs to 0 for the specific stage or simply delete it from the
policy file.  
</p>
        <p>
          <strong>
            <font color="#ff0000">CAUTION</font>
          </strong>: if you change any of the following
values, the next pipelines files that you create based on the current policy files
will be affected. 
</p>
        <p>
          <em>
            <u>Delete the stage tag</u>
          </em>
        </p>
        <p>
Identify the specific tag, and delete the complete &lt;Stage /&gt; tag from the policy
file. 
</p>
        <p>
          <u>
            <em>Setting the minOccurs and maxOccurs to 0</em>
          </u>
        </p>
        <p>
Identify the specific stage and set new values for the minOccurs and maxOccurs attributes
to 0: 
</p>
        <p>
          <i>Before:</i>
        </p>
        <pre class="csharpcode">&lt;?xml version=<span class="str">"1.0"</span> encoding=<span class="str">"utf-8"</span>?&gt;
&lt;Document xmlns:xsd=<span class="str">""</span> xmlns:xsi=<span class="str">""</span> CategoryId=<span class="str">""</span> FriendlyName=<span class="str">""</span>&gt;
&lt;Stages&gt; &lt;Stage Name=<span class="str">"Decode"</span> minOccurs=<span class="str">"0"</span> maxOccurs=<span class="str">"-1"</span> execMethod=<span class="str">"All"</span>&gt;&lt;/Stage&gt;
&lt;/Stages&gt; &lt;/Document&gt;</pre>
        <p>
          <i>After:</i>
        </p>
        <pre class="csharpcode">&lt;?xml version=<span class="str">"1.0"</span> encoding=<span class="str">"utf-8"</span>?&gt;
&lt;Document xmlns:xsd=<span class="str">""</span> xmlns:xsi=<span class="str">""</span> CategoryId=<span class="str">""</span> FriendlyName=<span class="str">""</span>&gt;
&lt;Stages&gt; &lt;Stage Name=<span class="str">"Decode"</span> minOccurs=<span class="str">"0"</span> maxOccurs=<span class="str">"0"</span> execMethod=<span class="str">"All"</span>&gt;&lt;/Stage&gt;
&lt;/Stages&gt; &lt;/Document&gt;</pre>
        <p>
ps.  this post was published using <a href="http://ideas.live.com/programpage.aspx?versionId=4372c8c2-b76f-4d44-aea1-9835b61d8dc1" target="_blank">Windows
Live Writer Beta</a>.
</p>
        <img width="0" height="0" src="http://blogs.devdeo.com/carlos.medina/aggbug.ashx?id=9423b134-1db8-4306-8694-0562cecde913" />
      </body>
      <title>Error - &amp;quot;Identifier expected&amp;quot; when the pipeline is compiling</title>
      <guid isPermaLink="false">http://blogs.devdeo.com/carlos.medina/PermaLink,guid,9423b134-1db8-4306-8694-0562cecde913.aspx</guid>
      <link>http://blogs.devdeo.com/carlos.medina/PermaLink,guid,9423b134-1db8-4306-8694-0562cecde913.aspx</link>
      <pubDate>Thu, 24 Aug 2006 01:19:15 GMT</pubDate>
      <description>&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;u&gt;&lt;b&gt;Explanation&lt;/b&gt; &lt;/u&gt; 
&lt;p&gt;
The execution mode value defined for some stage in the policy file is &lt;b&gt;None&lt;/b&gt;.
The value &lt;b&gt;None&lt;/b&gt; is not available for execution mode, the available values are &lt;b&gt;FirstMatch&lt;/b&gt; or &lt;b&gt;All&lt;/b&gt; only. 
&lt;p&gt;
&lt;u&gt;&lt;b&gt;User Action&lt;/b&gt; &lt;/u&gt; 
&lt;p&gt;
All pipeline templates have an associated policy file that determines pipeline’s stages,
the number of components allowed per stage, and the execution mode of each stage,
among others. To specify that one stage can not execute components, use minimum and
maximum occurs instead of execution mode. 
&lt;p&gt;
To resolve this problem is necessary to edit the pipeline’s policy file. The file
name can be found in pipeline’s properties windows in Visual Studio 2005 (see figure
below), this policy file is stored in &lt;i&gt;&amp;lt;Biztalk Server Installation Directory&amp;gt;\Developer
Tools\Pipeline Policy Files&lt;/i&gt; directory. 
&lt;p&gt;
&lt;a href="http://blogs.devdeo.com/carlos.medina/content/binary/18e01883d967_D4E6/PolicyFilePath1.jpg" atomicselection="true"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="153" src="http://blogs.devdeo.com/carlos.medina/content/binary/18e01883d967_D4E6/PolicyFilePath.jpg" width="259" border="0"&gt;&lt;/a&gt; 
&lt;p&gt;
After the file is opened, you must change the value for execution mode in policy file
to &lt;b&gt;All&lt;/b&gt; or &lt;b&gt;FirstMatch&lt;/b&gt;. 
&lt;p&gt;
&lt;em&gt;&lt;u&gt;Changing the execution mode value&lt;/u&gt; &lt;/em&gt; 
&lt;p&gt;
The execution mode is represented in the policy file by the execMethod attribute;
it is in the node &lt;i&gt;/Document/Stages/Stage&lt;/i&gt;. Open the pipeline’s policy file and
identify where this attribute is with value equals to &lt;b&gt;None&lt;/b&gt; and replace it by &lt;b&gt;All&lt;/b&gt; or &lt;b&gt;FirstMatch&lt;/b&gt; as
we shown: 
&lt;p&gt;
&lt;i&gt;Before:&lt;/i&gt; 
&lt;/p&gt;
&lt;pre class="csharpcode"&gt;&amp;lt;?xml version=&lt;span class="str"&gt;"1.0"&lt;/span&gt; encoding=&lt;span class="str"&gt;"utf-8"&lt;/span&gt;?&amp;gt;
&amp;lt;Document xmlns:xsd=&lt;span class="str"&gt;""&lt;/span&gt; xmlns:xsi=&lt;span class="str"&gt;""&lt;/span&gt; CategoryId=&lt;span class="str"&gt;""&lt;/span&gt; FriendlyName=&lt;span class="str"&gt;""&lt;/span&gt;&amp;gt;
&amp;lt;Stages&amp;gt; &amp;lt;Stage Name=&lt;span class="str"&gt;"Decode"&lt;/span&gt; minOccurs=&lt;span class="str"&gt;"0"&lt;/span&gt; maxOccurs=&lt;span class="str"&gt;"-1"&lt;/span&gt; execMethod=&lt;span class="str"&gt;"None"&lt;/span&gt;&amp;gt;&amp;lt;/Stage&amp;gt;
&amp;lt;/Stages&amp;gt; &amp;lt;/Document&amp;gt;&lt;/pre&gt;
&lt;p&gt;
&lt;i&gt;After:&lt;/i&gt; 
&lt;/p&gt;
&lt;pre class="csharpcode"&gt;&amp;lt;?xml version=&lt;span class="str"&gt;"1.0"&lt;/span&gt; encoding=&lt;span class="str"&gt;"utf-8"&lt;/span&gt;?&amp;gt;
&amp;lt;Document xmlns:xsd=&lt;span class="str"&gt;""&lt;/span&gt; xmlns:xsi=&lt;span class="str"&gt;""&lt;/span&gt; CategoryId=&lt;span class="str"&gt;""&lt;/span&gt; FriendlyName=&lt;span class="str"&gt;""&lt;/span&gt;&amp;gt;
&amp;lt;Stages&amp;gt; &amp;lt;Stage Name=&lt;span class="str"&gt;"Decode"&lt;/span&gt; minOccurs=&lt;span class="str"&gt;"0"&lt;/span&gt; maxOccurs=&lt;span class="str"&gt;"-1"&lt;/span&gt; execMethod=&lt;span class="str"&gt;"All"&lt;/span&gt;&amp;gt;&amp;lt;/Stage&amp;gt;
&amp;lt;/Stages&amp;gt; &amp;lt;/Document&amp;gt;&lt;/pre&gt;
&lt;p&gt;
At last, close and open the pipeline file in Visual Studio 2005 to see these changes
replicated. The following is the explanation step by step. 
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;&lt;u&gt;One way, but not the&amp;nbsp;right way&lt;/u&gt;&lt;/strong&gt; 
&lt;p&gt;
If you want that one stage can not execute any component, you&amp;nbsp;must setting the
minimum and maximum occurs to 0 for the specific stage or simply delete it from the
policy file.&amp;nbsp; 
&lt;p&gt;
&lt;strong&gt;&lt;font color="#ff0000"&gt;CAUTION&lt;/font&gt;&lt;/strong&gt;: if you change any of the following
values, the next pipelines files that you create based on the current policy files
will be affected. 
&lt;p&gt;
&lt;em&gt;&lt;u&gt;Delete the stage tag&lt;/u&gt;&lt;/em&gt; 
&lt;p&gt;
Identify the specific tag, and delete the complete &amp;lt;Stage /&amp;gt; tag from the policy
file. 
&lt;p&gt;
&lt;u&gt;&lt;em&gt;Setting the minOccurs and maxOccurs to 0&lt;/em&gt;&lt;/u&gt; 
&lt;p&gt;
Identify the specific stage and set new values for&amp;nbsp;the minOccurs&amp;nbsp;and maxOccurs&amp;nbsp;attributes
to 0: 
&lt;p&gt;
&lt;i&gt;Before:&lt;/i&gt; 
&lt;/p&gt;
&lt;pre class="csharpcode"&gt;&amp;lt;?xml version=&lt;span class="str"&gt;"1.0"&lt;/span&gt; encoding=&lt;span class="str"&gt;"utf-8"&lt;/span&gt;?&amp;gt;
&amp;lt;Document xmlns:xsd=&lt;span class="str"&gt;""&lt;/span&gt; xmlns:xsi=&lt;span class="str"&gt;""&lt;/span&gt; CategoryId=&lt;span class="str"&gt;""&lt;/span&gt; FriendlyName=&lt;span class="str"&gt;""&lt;/span&gt;&amp;gt;
&amp;lt;Stages&amp;gt; &amp;lt;Stage Name=&lt;span class="str"&gt;"Decode"&lt;/span&gt; minOccurs=&lt;span class="str"&gt;"0"&lt;/span&gt; maxOccurs=&lt;span class="str"&gt;"-1"&lt;/span&gt; execMethod=&lt;span class="str"&gt;"All"&lt;/span&gt;&amp;gt;&amp;lt;/Stage&amp;gt;
&amp;lt;/Stages&amp;gt; &amp;lt;/Document&amp;gt;&lt;/pre&gt;
&lt;p&gt;
&lt;i&gt;After:&lt;/i&gt; 
&lt;/p&gt;
&lt;pre class="csharpcode"&gt;&amp;lt;?xml version=&lt;span class="str"&gt;"1.0"&lt;/span&gt; encoding=&lt;span class="str"&gt;"utf-8"&lt;/span&gt;?&amp;gt;
&amp;lt;Document xmlns:xsd=&lt;span class="str"&gt;""&lt;/span&gt; xmlns:xsi=&lt;span class="str"&gt;""&lt;/span&gt; CategoryId=&lt;span class="str"&gt;""&lt;/span&gt; FriendlyName=&lt;span class="str"&gt;""&lt;/span&gt;&amp;gt;
&amp;lt;Stages&amp;gt; &amp;lt;Stage Name=&lt;span class="str"&gt;"Decode"&lt;/span&gt; minOccurs=&lt;span class="str"&gt;"0"&lt;/span&gt; maxOccurs=&lt;span class="str"&gt;"0"&lt;/span&gt; execMethod=&lt;span class="str"&gt;"All"&lt;/span&gt;&amp;gt;&amp;lt;/Stage&amp;gt;
&amp;lt;/Stages&amp;gt; &amp;lt;/Document&amp;gt;&lt;/pre&gt;
&lt;p&gt;
ps.&amp;nbsp; this post was published using&amp;nbsp;&lt;a href="http://ideas.live.com/programpage.aspx?versionId=4372c8c2-b76f-4d44-aea1-9835b61d8dc1" target="_blank"&gt;Windows
Live Writer Beta&lt;/a&gt;.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://blogs.devdeo.com/carlos.medina/aggbug.ashx?id=9423b134-1db8-4306-8694-0562cecde913" /&gt;</description>
      <comments>http://blogs.devdeo.com/carlos.medina/CommentView,guid,9423b134-1db8-4306-8694-0562cecde913.aspx</comments>
      <category>biztalk</category>
    </item>
    <item>
      <trackback:ping>http://blogs.devdeo.com/carlos.medina/Trackback.aspx?guid=5b528ab5-f6fa-4993-8926-3a92ed997171</trackback:ping>
      <pingback:server>http://blogs.devdeo.com/carlos.medina/pingback.aspx</pingback:server>
      <pingback:target>http://blogs.devdeo.com/carlos.medina/PermaLink,guid,5b528ab5-f6fa-4993-8926-3a92ed997171.aspx</pingback:target>
      <dc:creator>Carlos Medina</dc:creator>
      <wfw:commentRss>http://blogs.devdeo.com/carlos.medina/SyndicationService.asmx/GetEntryCommentsRss?guid=5b528ab5-f6fa-4993-8926-3a92ed997171</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Gilles has developer an addin for <a href="http://www.aisto.com/Roeder/dotnet/">Reflector</a> that
allows you to list all BizTalk artifacts contained in an assembly and extract them.
</p>
        <p>
Read more in <a href="http://blogs.msdn.com/gzunino/archive/2006/06/09/623391.aspx">BizTalk
AddIn for Reflector</a></p>
        <img width="0" height="0" src="http://blogs.devdeo.com/carlos.medina/aggbug.ashx?id=5b528ab5-f6fa-4993-8926-3a92ed997171" />
      </body>
      <title>Biztalk AddIn for Reflector</title>
      <guid isPermaLink="false">http://blogs.devdeo.com/carlos.medina/PermaLink,guid,5b528ab5-f6fa-4993-8926-3a92ed997171.aspx</guid>
      <link>http://blogs.devdeo.com/carlos.medina/PermaLink,guid,5b528ab5-f6fa-4993-8926-3a92ed997171.aspx</link>
      <pubDate>Sat, 10 Jun 2006 20:03:17 GMT</pubDate>
      <description>&lt;p&gt;
Gilles has developer an addin for &lt;a href="http://www.aisto.com/Roeder/dotnet/"&gt;Reflector&lt;/a&gt; that
allows you to list all BizTalk artifacts contained in an assembly and extract them.
&lt;/p&gt;
&lt;p&gt;
Read more in &lt;a href="http://blogs.msdn.com/gzunino/archive/2006/06/09/623391.aspx"&gt;BizTalk
AddIn for Reflector&lt;/a&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://blogs.devdeo.com/carlos.medina/aggbug.ashx?id=5b528ab5-f6fa-4993-8926-3a92ed997171" /&gt;</description>
      <comments>http://blogs.devdeo.com/carlos.medina/CommentView,guid,5b528ab5-f6fa-4993-8926-3a92ed997171.aspx</comments>
      <category>biztalk</category>
    </item>
    <item>
      <trackback:ping>http://blogs.devdeo.com/carlos.medina/Trackback.aspx?guid=08da5d6f-c803-4c90-99de-df5793c12bf4</trackback:ping>
      <pingback:server>http://blogs.devdeo.com/carlos.medina/pingback.aspx</pingback:server>
      <pingback:target>http://blogs.devdeo.com/carlos.medina/PermaLink,guid,08da5d6f-c803-4c90-99de-df5793c12bf4.aspx</pingback:target>
      <dc:creator>Carlos Medina</dc:creator>
      <wfw:comment>http://blogs.devdeo.com/carlos.medina/CommentView,guid,08da5d6f-c803-4c90-99de-df5793c12bf4.aspx</wfw:comment>
      <wfw:commentRss>http://blogs.devdeo.com/carlos.medina/SyndicationService.asmx/GetEntryCommentsRss?guid=08da5d6f-c803-4c90-99de-df5793c12bf4</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
          <font face="Arial" size="2">I have made some modifications to the <strong>BizTalkGenerateStrongName</strong> tool
developed by <a href="http://www.masteringbiztalk.com/blogs/jon">Jon Flanders</a>,
for more info about this tool please visit his post "<a href="http://www.masteringbiztalk.com/blogs/jon/PermaLink,guid,e6eb055f-d866-4e41-8cb1-b92bbf3ed46e.aspx">Another
BizTalk development tool</a>".</font>
        </p>
        <p>
          <font face="Arial" size="2">The principal change is set the new property
value to all BizTalk projects in your solution, additionally include:</font>
        </p>
        <blockquote dir="ltr" style="MARGIN-RIGHT: 0px">
          <p>
            <font face="Arial" size="2">.- Copy the existent values of one BizTalk project to
all BizTalk projects in the same solution </font>
          </p>
          <p>
            <font face="Arial" size="2">.- Override the property values in all BizTalk projects</font>
          </p>
          <p>
            <font face="Arial" size="2">.- Besides to edit the <strong>Assembly Key</strong> property,
you could set a new value to <strong>Application Name</strong> property in BizTalk
projects</font>
          </p>
        </blockquote>
        <p>
          <font face="Arial" size="2">You can download the project from <a href="http://www.gotdotnet.com/workspaces/workspace.aspx?id=dd727e24-c1f7-4c8a-9a95-a57b3b458877">BiztalkGenerateStrongName:
Workspace</a> site.  This tool works with VS 2005 and BTS 2006.<br /></font>
        </p>
        <p>
          <font face="Arial" size="2">Thanks to <a href="http://www.masteringbiztalk.com/blogs/jon">Jon
Flander</a> to let me publish these modifications.</font> 
</p>
        <img width="0" height="0" src="http://blogs.devdeo.com/carlos.medina/aggbug.ashx?id=08da5d6f-c803-4c90-99de-df5793c12bf4" />
      </body>
      <title>New version of BizTalkGenerateStrongName tool</title>
      <guid isPermaLink="false">http://blogs.devdeo.com/carlos.medina/PermaLink,guid,08da5d6f-c803-4c90-99de-df5793c12bf4.aspx</guid>
      <link>http://blogs.devdeo.com/carlos.medina/PermaLink,guid,08da5d6f-c803-4c90-99de-df5793c12bf4.aspx</link>
      <pubDate>Mon, 24 Apr 2006 03:24:39 GMT</pubDate>
      <description>&lt;p&gt;
&lt;font face=Arial size=2&gt;I have made some modifications to the &lt;strong&gt;BizTalkGenerateStrongName&lt;/strong&gt; tool
developed by &lt;a href="http://www.masteringbiztalk.com/blogs/jon"&gt;Jon Flanders&lt;/a&gt;,
for more info about this tool&amp;nbsp;please&amp;nbsp;visit his post "&lt;a href="http://www.masteringbiztalk.com/blogs/jon/PermaLink,guid,e6eb055f-d866-4e41-8cb1-b92bbf3ed46e.aspx"&gt;Another
BizTalk development tool&lt;/a&gt;".&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face=Arial size=2&gt;The principal&amp;nbsp;change is&amp;nbsp;set the new property value
to all BizTalk projects in your solution, additionally include:&lt;/font&gt;
&lt;/p&gt;
&lt;blockquote dir=ltr style="MARGIN-RIGHT: 0px"&gt; 
&lt;p&gt;
&lt;font face=Arial size=2&gt;.- Copy the existent values of one BizTalk project to all
BizTalk projects in the same solution &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face=Arial size=2&gt;.- Override the property values in all BizTalk projects&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face=Arial size=2&gt;.- Besides to edit the &lt;strong&gt;Assembly Key&lt;/strong&gt; property,
you could set a new value to &lt;strong&gt;Application Name&lt;/strong&gt; property&amp;nbsp;in BizTalk
projects&lt;/font&gt;
&lt;/p&gt;
&lt;/blockquote&gt; 
&lt;p&gt;
&lt;font face=Arial size=2&gt;You can download the project from &lt;a href="http://www.gotdotnet.com/workspaces/workspace.aspx?id=dd727e24-c1f7-4c8a-9a95-a57b3b458877"&gt;BiztalkGenerateStrongName:
Workspace&lt;/a&gt; site.&amp;nbsp; This tool works with VS 2005 and BTS 2006.&lt;br&gt;
&lt;/p&gt;
&gt; 
&lt;p&gt;
&lt;font face=Arial size=2&gt;Thanks to &lt;a href="http://www.masteringbiztalk.com/blogs/jon"&gt;Jon
Flander&lt;/a&gt; to let me publish these modifications.&lt;/font&gt;&amp;nbsp;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://blogs.devdeo.com/carlos.medina/aggbug.ashx?id=08da5d6f-c803-4c90-99de-df5793c12bf4" /&gt;</description>
      <comments>http://blogs.devdeo.com/carlos.medina/CommentView,guid,08da5d6f-c803-4c90-99de-df5793c12bf4.aspx</comments>
    </item>
    <item>
      <trackback:ping>http://blogs.devdeo.com/carlos.medina/Trackback.aspx?guid=981d7ca5-a11a-452b-90d5-a535d04a64bf</trackback:ping>
      <pingback:server>http://blogs.devdeo.com/carlos.medina/pingback.aspx</pingback:server>
      <pingback:target>http://blogs.devdeo.com/carlos.medina/PermaLink,guid,981d7ca5-a11a-452b-90d5-a535d04a64bf.aspx</pingback:target>
      <dc:creator>Carlos Medina</dc:creator>
      <wfw:comment>http://blogs.devdeo.com/carlos.medina/CommentView,guid,981d7ca5-a11a-452b-90d5-a535d04a64bf.aspx</wfw:comment>
      <wfw:commentRss>http://blogs.devdeo.com/carlos.medina/SyndicationService.asmx/GetEntryCommentsRss?guid=981d7ca5-a11a-452b-90d5-a535d04a64bf</wfw:commentRss>
      <slash:comments>3</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
          <font face="Arial" size="2">When <strong>Microsoft.BizTalk.ExplorerOM</strong> namespace
is used to set/get the artifacts of BTS, the first property that you need
to set is <em>BtsCatalogExplorer.ConnectionString</em>.  <strong>BtsCatalogExplorer</strong> uses
this property to connect to bts configuration database (BizTalkMgmtDb). </font>
        </p>
        <p>
          <font face="Arial" size="2">Many people save this connection string in
a configuration file (.config) or directly in the code.  For example:</font>
        </p>
        <font face="Arial" size="2">
          <font face="Arial" size="2">
            <p>
              <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">BtsCatalogExplorer
catalog <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">new</span> BtsCatalogExplorer(); 
<br />
catalog.ConnectionString <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span> System.Configuration.Settings.AppSettings[<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"BtsCofigDatabase"</span>]; 
<br /></span>- or -<br /></p>
          </font>
          <font face="Arial" size="2">
            <font color="#ff0000">
              <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">catalog.ConnectionString <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span><span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"server=SQLServer;database=BizTalkMgmtDb;integrated
security=true"</span>; </span>
            </font>
          </font>
        </font>
        <p>
          <font face="Arial" size="2">This code is not reusable or may be it'll need administration
to set the value in the config file when the solution is installed in another
bts server.</font>
        </p>
        <p>
          <font face="Arial" size="2">You can get the connection string dynamically using <u>WMI</u> or <u>Windows
Registry</u> to delete this issue.  I developed a little helper class (<u>see
code below</u>) with one static method that return the connection string of the
configuration database (BizTalkMgmtDb).  Now, you don't need use any config file
and your code'll be reusable.  For example:</font>
        </p>
        <font face="Arial" size="2">
          <p>
            <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">BtsCatalogExplorer
catalog <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">new</span> BtsCatalogExplorer(); 
<br />
catalog.ConnectionString <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span> BtsHelper.BtsConfigurationDatabase.GetConnectionString();</span>
          </p>
        </font>
        <p>
          <font face="Arial" size="2">
            <strong>
              <u>Code: BtsHelper Class</u>
            </strong>
          </font>
        </p>
        <font face="Arial" size="2">
          <p>
            <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
              <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">using</span> System; 
<br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">using</span> System.Data.SqlClient; 
<br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">using</span> System.Management; 
<br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">using</span> Microsoft.Win32; 
<br /><br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">namespace</span> BtsHelper 
<br />
{<br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">public</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">class</span> BtsConfigurationDatabase 
<br />
{ 
<br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">private</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">string</span> _database; 
<br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">private</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">string</span> _server; 
<br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">private</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">static</span> BtsConfigurationDatabase
_btsConfig <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">null</span>; 
<br /><br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">private</span> BtsConfigurationDatabase() 
<br />
{ 
<br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">this</span>._server <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">string</span>.Empty; 
<br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">this</span>._database <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">string</span>.Empty; 
<br />
} 
<br /><br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">private</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">bool</span> GetUsingWMI() 
<br />
{ 
<br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">bool</span> regFounded <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">false</span>; 
<br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">this</span>._server <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">string</span>.Empty; 
<br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">this</span>._database <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">string</span>.Empty; 
<br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">try</span><br />
{ 
<br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">using</span> (ManagementObjectSearcher
searcherGroupSetting <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">new</span> ManagementObjectSearcher()) 
<br />
{ 
<br />
searcherGroupSetting.Scope <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">new</span> ManagementScope(<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">@"root\MicrosoftBizTalkServer"</span>); 
<br />
searcherGroupSetting.Query <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">new</span> SelectQuery(<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"select
* from MSBTS_GroupSetting"</span>); 
<br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">using</span> (ManagementObjectCollection.ManagementObjectEnumerator
enumGroupSetting <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span> searcherGroupSetting.Get().GetEnumerator()) 
<br />
{ 
<br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">while</span> (enumGroupSetting.MoveNext()) 
<br />
{ 
<br />
ManagementObject groupSetting <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span> (ManagementObject)enumGroupSetting.Current; 
<br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">this</span>._server <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span> groupSetting[<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"MgmtDbServerName"</span>] <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">as</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">string</span>; 
<br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">this</span>._database <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span> groupSetting[<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"MgmtDbName"</span>] <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">as</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">string</span>; 
<br />
regFounded <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">true</span>; 
<br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">break</span>; 
<br />
} 
<br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">return</span> regFounded; 
<br />
} 
<br />
} 
<br />
} 
<br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">catch</span> (Exception)
{ } 
<br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">return</span> regFounded; 
<br />
} 
<br /><br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">private</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">bool</span> GetUsingRegistry() 
<br />
{ 
<br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">bool</span> regFounded <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">false</span>; 
<br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">this</span>._server <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">string</span>.Empty; 
<br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">this</span>._database <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">string</span>.Empty; 
<br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">using</span> (RegistryKey
keyBts <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span> Registry.LocalMachine.OpenSubKey(<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">@"SOFTWARE\Microsoft\BizTalk
Server\3.0\Administration"</span>))<br />
{<br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">if</span> (keyBts
== <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">null</span>)<br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">return</span> regFounded;<br /><br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">this</span>._server <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span> keyBts.GetValue(<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"MgmtDBServer"</span>) <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">as</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">string</span>;<br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">if</span> (<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">this</span>._server
== <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">null</span>)<br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">this</span>._server <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">string</span>.Empty;<br /><br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">this</span>._database <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span> keyBts.GetValue(<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"MgmtDBName"</span>) <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">as</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">string</span>;<br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">if</span> (<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">this</span>._database
== <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">null</span>)<br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">this</span>._database <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">string</span>.Empty;<br /><br />
regFounded <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">true</span>;<br />
}<br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">return</span> regFounded;<br />
}<br /><br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">public</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">static</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">string</span> GetConnectionString() 
<br />
{ 
<br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">if</span> (_btsConfig
== <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">null</span>) 
<br />
_btsConfig <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">new</span> BtsConfigurationDatabase(); 
<br /><br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">if</span> (!_btsConfig.GetUsingWMI()) 
<br />
_btsConfig.GetUsingRegistry(); 
<br /><br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">if</span> ((_btsConfig._server
== <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">string</span>.Empty)
|| (_btsConfig._database == <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">string</span>.Empty)) 
<br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">throw</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">new</span> ApplicationException(<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"Error
when get the connection string!"</span>); 
<br /><br />
SqlConnectionStringBuilder sb <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">new</span> SqlConnectionStringBuilder(); 
<br />
sb.DataSource <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span> _btsConfig._server; 
<br />
sb.InitialCatalog <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span> _btsConfig._database; 
<br />
sb.IntegratedSecurity <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">true</span>; 
<br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">return</span> sb.ToString(); 
<br />
}<br /><br />
} 
<br />
}</span> 
</p>
        </font>
        <p>
          <font face="Arial" size="2">** Don't forget reference the System.Management.dll assembly
to build the class.</font>
        </p>
        <img width="0" height="0" src="http://blogs.devdeo.com/carlos.medina/aggbug.ashx?id=981d7ca5-a11a-452b-90d5-a535d04a64bf" />
      </body>
      <title>Get the connection string to BizTalkMgmtDb</title>
      <guid isPermaLink="false">http://blogs.devdeo.com/carlos.medina/PermaLink,guid,981d7ca5-a11a-452b-90d5-a535d04a64bf.aspx</guid>
      <link>http://blogs.devdeo.com/carlos.medina/PermaLink,guid,981d7ca5-a11a-452b-90d5-a535d04a64bf.aspx</link>
      <pubDate>Tue, 04 Apr 2006 03:24:03 GMT</pubDate>
      <description>&lt;p&gt;
&lt;font face=Arial size=2&gt;When &lt;strong&gt;Microsoft.BizTalk.ExplorerOM&lt;/strong&gt; namespace
is used to&amp;nbsp;set/get the&amp;nbsp;artifacts of BTS, the first property that you need
to set is &lt;em&gt;BtsCatalogExplorer.ConnectionString&lt;/em&gt;.&amp;nbsp; &lt;strong&gt;BtsCatalogExplorer&lt;/strong&gt; uses
this property to connect to bts configuration database (BizTalkMgmtDb). &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face=Arial size=2&gt;Many people&amp;nbsp;save this&amp;nbsp;connection string&amp;nbsp;in
a&amp;nbsp;configuration file (.config) or&amp;nbsp;directly&amp;nbsp;in the code.&amp;nbsp; For&amp;nbsp;example:&lt;/font&gt;
&lt;/p&gt;
&lt;font face=Arial size=2&gt;&lt;font face=Arial size=2&gt; 
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;BtsCatalogExplorer
catalog &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;new&lt;/span&gt; BtsCatalogExplorer(); 
&lt;br&gt;
catalog.ConnectionString &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; System.Configuration.Settings.AppSettings[&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"BtsCofigDatabase"&lt;/span&gt;]; 
&lt;br&gt;
&lt;/span&gt;- or -&lt;br&gt;
&lt;/font&gt;&lt;font face=Arial size=2&gt;&lt;font color=#ff0000&gt;&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;catalog.ConnectionString &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"server=SQLServer;database=BizTalkMgmtDb;integrated
security=true"&lt;/span&gt;; &lt;/span&gt;&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/font&gt; 
&lt;p&gt;
&lt;font face=Arial size=2&gt;This code is not reusable&amp;nbsp;or may be it'll need administration
to&amp;nbsp;set the value in the config file when the&amp;nbsp;solution is installed in another
bts server.&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face=Arial size=2&gt;You can get the connection string dynamically using&amp;nbsp;&lt;u&gt;WMI&lt;/u&gt; or &lt;u&gt;Windows
Registry&lt;/u&gt;&amp;nbsp;to delete this issue.&amp;nbsp;&amp;nbsp;I developed a little helper class&amp;nbsp;(&lt;u&gt;see
code below&lt;/u&gt;) with one&amp;nbsp;static method that return the connection string of the
configuration database (BizTalkMgmtDb).&amp;nbsp; Now, you don't need use any config file
and your code'll be reusable.&amp;nbsp; For example:&lt;/font&gt;
&lt;/p&gt;
&lt;font face=Arial size=2&gt; 
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;BtsCatalogExplorer
catalog &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;new&lt;/span&gt; BtsCatalogExplorer(); 
&lt;br&gt;
catalog.ConnectionString &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; BtsHelper.BtsConfigurationDatabase.GetConnectionString();&lt;/span&gt;
&lt;/p&gt;
&lt;/font&gt; 
&lt;p&gt;
&lt;font face=Arial size=2&gt;&lt;strong&gt;&lt;u&gt;Code: BtsHelper Class&lt;/u&gt;&lt;/strong&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;font face=Arial size=2&gt; 
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;using&lt;/span&gt; System; 
&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;using&lt;/span&gt; System.Data.SqlClient; 
&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;using&lt;/span&gt; System.Management; 
&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;using&lt;/span&gt; Microsoft.Win32; 
&lt;br&gt;
&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;namespace&lt;/span&gt; BtsHelper 
&lt;br&gt;
{&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;public&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;class&lt;/span&gt; BtsConfigurationDatabase 
&lt;br&gt;
{ 
&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;private&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;string&lt;/span&gt; _database; 
&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;private&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;string&lt;/span&gt; _server; 
&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;private&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;static&lt;/span&gt; BtsConfigurationDatabase
_btsConfig &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;null&lt;/span&gt;; 
&lt;br&gt;
&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;private&lt;/span&gt; BtsConfigurationDatabase() 
&lt;br&gt;
{ 
&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;this&lt;/span&gt;._server &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;string&lt;/span&gt;.Empty; 
&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;this&lt;/span&gt;._database &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;string&lt;/span&gt;.Empty; 
&lt;br&gt;
} 
&lt;br&gt;
&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;private&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;bool&lt;/span&gt; GetUsingWMI() 
&lt;br&gt;
{ 
&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;bool&lt;/span&gt; regFounded &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;false&lt;/span&gt;; 
&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;this&lt;/span&gt;._server &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;string&lt;/span&gt;.Empty; 
&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;this&lt;/span&gt;._database &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;string&lt;/span&gt;.Empty; 
&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;try&lt;/span&gt; 
&lt;br&gt;
{ 
&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;using&lt;/span&gt; (ManagementObjectSearcher
searcherGroupSetting &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;new&lt;/span&gt; ManagementObjectSearcher()) 
&lt;br&gt;
{ 
&lt;br&gt;
searcherGroupSetting.Scope &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;new&lt;/span&gt; ManagementScope(&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;@"root\MicrosoftBizTalkServer"&lt;/span&gt;); 
&lt;br&gt;
searcherGroupSetting.Query &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;new&lt;/span&gt; SelectQuery(&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"select
* from MSBTS_GroupSetting"&lt;/span&gt;); 
&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;using&lt;/span&gt; (ManagementObjectCollection.ManagementObjectEnumerator
enumGroupSetting &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; searcherGroupSetting.Get().GetEnumerator()) 
&lt;br&gt;
{ 
&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;while&lt;/span&gt; (enumGroupSetting.MoveNext()) 
&lt;br&gt;
{ 
&lt;br&gt;
ManagementObject groupSetting &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; (ManagementObject)enumGroupSetting.Current; 
&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;this&lt;/span&gt;._server &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; groupSetting[&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"MgmtDbServerName"&lt;/span&gt;] &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;as&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;string&lt;/span&gt;; 
&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;this&lt;/span&gt;._database &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; groupSetting[&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"MgmtDbName"&lt;/span&gt;] &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;as&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;string&lt;/span&gt;; 
&lt;br&gt;
regFounded &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;true&lt;/span&gt;; 
&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;break&lt;/span&gt;; 
&lt;br&gt;
} 
&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;return&lt;/span&gt; regFounded; 
&lt;br&gt;
} 
&lt;br&gt;
} 
&lt;br&gt;
} 
&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;catch&lt;/span&gt; (Exception)
{ } 
&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;return&lt;/span&gt; regFounded; 
&lt;br&gt;
} 
&lt;br&gt;
&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;private&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;bool&lt;/span&gt; GetUsingRegistry() 
&lt;br&gt;
{ 
&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;bool&lt;/span&gt; regFounded &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;false&lt;/span&gt;; 
&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;this&lt;/span&gt;._server &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;string&lt;/span&gt;.Empty; 
&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;this&lt;/span&gt;._database &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;string&lt;/span&gt;.Empty; 
&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;using&lt;/span&gt; (RegistryKey
keyBts &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; Registry.LocalMachine.OpenSubKey(&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;@"SOFTWARE\Microsoft\BizTalk
Server\3.0\Administration"&lt;/span&gt;))&lt;br&gt;
{&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;if&lt;/span&gt; (keyBts
== &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;null&lt;/span&gt;)&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;return&lt;/span&gt; regFounded;&lt;br&gt;
&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;this&lt;/span&gt;._server &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; keyBts.GetValue(&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"MgmtDBServer"&lt;/span&gt;) &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;as&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;string&lt;/span&gt;;&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;if&lt;/span&gt; (&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;this&lt;/span&gt;._server
== &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;null&lt;/span&gt;)&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;this&lt;/span&gt;._server &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;string&lt;/span&gt;.Empty;&lt;br&gt;
&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;this&lt;/span&gt;._database &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; keyBts.GetValue(&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"MgmtDBName"&lt;/span&gt;) &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;as&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;string&lt;/span&gt;;&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;if&lt;/span&gt; (&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;this&lt;/span&gt;._database
== &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;null&lt;/span&gt;)&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;this&lt;/span&gt;._database &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;string&lt;/span&gt;.Empty;&lt;br&gt;
&lt;br&gt;
regFounded &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;true&lt;/span&gt;;&lt;br&gt;
}&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;return&lt;/span&gt; regFounded;&lt;br&gt;
}&lt;br&gt;
&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;public&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;static&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;string&lt;/span&gt; GetConnectionString() 
&lt;br&gt;
{ 
&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;if&lt;/span&gt; (_btsConfig
== &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;null&lt;/span&gt;) 
&lt;br&gt;
_btsConfig &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;new&lt;/span&gt; BtsConfigurationDatabase(); 
&lt;br&gt;
&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;if&lt;/span&gt; (!_btsConfig.GetUsingWMI()) 
&lt;br&gt;
_btsConfig.GetUsingRegistry(); 
&lt;br&gt;
&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;if&lt;/span&gt; ((_btsConfig._server
== &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;string&lt;/span&gt;.Empty)
|| (_btsConfig._database == &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;string&lt;/span&gt;.Empty)) 
&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;throw&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;new&lt;/span&gt; ApplicationException(&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"Error
when get the connection string!"&lt;/span&gt;); 
&lt;br&gt;
&lt;br&gt;
SqlConnectionStringBuilder sb &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;new&lt;/span&gt; SqlConnectionStringBuilder(); 
&lt;br&gt;
sb.DataSource &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; _btsConfig._server; 
&lt;br&gt;
sb.InitialCatalog &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; _btsConfig._database; 
&lt;br&gt;
sb.IntegratedSecurity &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;true&lt;/span&gt;; 
&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;return&lt;/span&gt; sb.ToString(); 
&lt;br&gt;
}&lt;br&gt;
&lt;br&gt;
} 
&lt;br&gt;
}&lt;/span&gt;&amp;nbsp;
&lt;/font&gt;&gt;
&lt;p&gt;
&lt;font face=Arial size=2&gt;** Don't forget reference the System.Management.dll assembly
to build the class.&lt;/font&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://blogs.devdeo.com/carlos.medina/aggbug.ashx?id=981d7ca5-a11a-452b-90d5-a535d04a64bf" /&gt;</description>
      <comments>http://blogs.devdeo.com/carlos.medina/CommentView,guid,981d7ca5-a11a-452b-90d5-a535d04a64bf.aspx</comments>
    </item>
    <item>
      <trackback:ping>http://blogs.devdeo.com/carlos.medina/Trackback.aspx?guid=0d9cc5b3-6ca0-4bb0-bbd4-3a172a071c4a</trackback:ping>
      <pingback:server>http://blogs.devdeo.com/carlos.medina/pingback.aspx</pingback:server>
      <pingback:target>http://blogs.devdeo.com/carlos.medina/PermaLink,guid,0d9cc5b3-6ca0-4bb0-bbd4-3a172a071c4a.aspx</pingback:target>
      <dc:creator>Carlos Medina</dc:creator>
      <wfw:comment>http://blogs.devdeo.com/carlos.medina/CommentView,guid,0d9cc5b3-6ca0-4bb0-bbd4-3a172a071c4a.aspx</wfw:comment>
      <wfw:commentRss>http://blogs.devdeo.com/carlos.medina/SyndicationService.asmx/GetEntryCommentsRss?guid=0d9cc5b3-6ca0-4bb0-bbd4-3a172a071c4a</wfw:commentRss>
      <slash:comments>5</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
          <span>
            <font face="Arial" size="2">Using the <b>EnvDTE.Project</b> class you can access
the BizTalk Server 2006 project properties to get/set its value.<span>  </span>A
bts-project uses two collections to store the properties; I’ll explain where you can
find each property. </font>
          </span>
        </p>
        <p>
          <span>
            <font face="Arial" size="2">
            </font>
          </span>
        </p>
        <p>
          <b>
            <i>
              <span>
                <font face="Arial" size="2">Configuration Properties</font>
              </span>
            </i>
          </b>
        </p>
        <p>
          <span>
            <font face="Arial" size="2">
            </font>
          </span>
        </p>
        <p>
          <span>
            <font face="Arial" size="2">To access the configuration properties, you need
to get the item <b>ConfigProperties</b> from the active configuration.<span>  </span>This
item gets a value that represents the dictionary that contains the properties. (See
code below)</font>
          </span>
        </p>
        <p>
          <span>
            <font face="Arial" size="2">
            </font>
          </span>
        </p>
        <p>
          <font size="2">
            <font face="Arial">
              <font color="red">
                <strong>
                  <span>
                  </span>
                  <span> 
</span>
                </strong>
              </font>
            </font>
          </font>
        </p>
        <p>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">Property
configProperties <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span> project.ConfigurationManager.ActiveConfiguration.Properties.Item(<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"ConfigProperties"</span>);<br />
IDictionary dicConfigProps <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span> configProperties.Value <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">as</span> IDictionary;<br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">string</span> outputPath <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span> dicConfigProps[DictionaryTags.OutputPath].ToString();</span>
        </p>
        <p>
          <span>
            <font face="Arial" size="2">
            </font>
          </span>
        </p>
        <p>
          <span>
            <font face="Arial" size="2">In the code, the type of <b>project</b> variable
is <b>EnvDTE.Project</b> and represents the <i>BizTalk Server 2006</i> project. <span> </span>This
object has a dictionary with each property related to configuration, to access each
property you must use the <b>DictionaryTags</b>.</font>
          </span>
        </p>
        <p>
          <span>
            <font face="Arial" size="2">
            </font>
          </span>
        </p>
        <p>
          <span>
            <font face="Arial" size="2">In the example, I get the location of the output
files for the current project using the <b>DictionaryTags.OutputPath</b> key.<span>  </span>This
is the list that you can access in this dictionary.</font>
          </span>
        </p>
        <p>
          <table id="Table1" cellspacing="0" cellpadding="0" border="1">
            <tbody>
              <tr>
                <td colspan="2">
                  <p>
                    <span>
                      <font face="Arial" size="2">  </font>
                    </span>
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p align="center">
                    <i>
                      <u>
                        <span>
                          <font face="Arial" size="2">Configuration Properties</font>
                        </span>
                      </u>
                    </i>
                  </p>
                </td>
                <td>
                  <p align="center">
                    <i>
                      <u>
                        <span>
                          <font face="Arial" size="2">Enumeration</font>
                        </span>
                      </u>
                    </i>
                  </p>
                </td>
              </tr>
              <tr>
                <td colspan="2">
                  <p>
                    <b>
                      <span>
                        <font face="Arial" size="2">Section: Build</font>
                      </span>
                    </b>
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <font face="Arial">
                      <font size="2">
                        <i>
                          <span>Restart Host Instances</span>
                        </i>
                        <span>:
specifies whether to restart all BizTalk in-process host instances on local machine.</span>
                      </font>
                    </font>
                  </p>
                </td>
                <td>
                  <p>
                    <font face="Arial">
                      <font size="2">
                        <span>DictionaryTags</span>
                        <span>.</span>
                        <span>RestartHostInstances</span>
                      </font>
                    </font>
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <font face="Arial">
                      <font size="2">
                        <i>
                          <span>Register</span>
                        </i>
                        <span>: specifies whether
to register the assembly in the Global Assembly Cache.</span>
                      </font>
                    </font>
                  </p>
                </td>
                <td>
                  <p>
                    <font face="Arial">
                      <font size="2">
                        <span>DictionaryTags</span>
                        <span>.</span>
                        <span>Register</span>
                      </font>
                    </font>
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <font face="Arial">
                      <font size="2">
                        <i>
                          <span>Redeploy</span>
                        </i>
                        <span>: specifies whether
to delete existing configuration and recreate it every time the assembly is deployed.</span>
                      </font>
                    </font>
                  </p>
                </td>
                <td>
                  <p>
                    <font face="Arial">
                      <font size="2">
                        <span>DictionaryTags</span>
                        <span>.</span>
                        <span>Redeploy</span>
                      </font>
                    </font>
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <font face="Arial">
                      <font size="2">
                        <i>
                          <span>Application Name</span>
                        </i>
                        <span>: specifies
the BizTalk Application in which to deploy the assembly.</span>
                      </font>
                    </font>
                  </p>
                </td>
                <td>
                  <p>
                    <font face="Arial">
                      <font size="2">
                        <span>DictionaryTags</span>
                        <span>.</span>
                        <span>ApplicationName</span>
                      </font>
                    </font>
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <font face="Arial">
                      <font size="2">
                        <i>
                          <span>Configuration Database</span>
                        </i>
                        <span>:
configuration Database to deploy.</span>
                      </font>
                    </font>
                  </p>
                </td>
                <td>
                  <p>
                    <font face="Arial">
                      <font size="2">
                        <span>DictionaryTags</span>
                        <span>.</span>
                        <span>ConfigurationDatabase</span>
                      </font>
                    </font>
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <font face="Arial">
                      <font size="2">
                        <i>
                          <span>Server</span>
                        </i>
                        <span>: specifies the
server when the BizTalk Configuration Database resides.</span>
                      </font>
                    </font>
                  </p>
                </td>
                <td>
                  <p>
                    <font face="Arial">
                      <font size="2">
                        <span>DictionaryTags</span>
                        <span>.</span>
                        <span>Server</span>
                      </font>
                    </font>
                  </p>
                </td>
              </tr>
              <tr>
                <td colspan="2">
                  <p>
                    <b>
                      <span>
                        <font face="Arial" size="2">Section: Deployment</font>
                      </span>
                    </b>
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <font face="Arial">
                      <font size="2">
                        <i>
                          <span>BPEL Compliance</span>
                        </i>
                        <span>: specifies
whether to generate Business Process Execution Language (BPEL) compliance output.</span>
                      </font>
                    </font>
                  </p>
                </td>
                <td>
                  <p>
                    <font face="Arial">
                      <font size="2">
                        <span>DictionaryTags</span>
                        <span>.</span>
                        <span>BpelCompliance</span>
                      </font>
                    </font>
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <font face="Arial">
                      <font size="2">
                        <i>
                          <span>Generate Debugging Information</span>
                        </i>
                        <span>:
specifies whether generate debug symbols.</span>
                      </font>
                    </font>
                  </p>
                </td>
                <td>
                  <p>
                    <font face="Arial">
                      <font size="2">
                        <span>DictionaryTags</span>
                        <span>.</span>
                        <span>GenerateDebuggingInformation</span>
                      </font>
                    </font>
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <font face="Arial">
                      <font size="2">
                        <i>
                          <span>Embed Tracking Information</span>
                        </i>
                        <span>:
specifies whether to embed tracking information in the assembly.</span>
                      </font>
                    </font>
                  </p>
                </td>
                <td>
                  <p>
                    <font face="Arial">
                      <font size="2">
                        <span>DictionaryTags</span>
                        <span>.</span>
                        <span>EmbedTrackingInformation</span>
                      </font>
                    </font>
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <font face="Arial">
                      <font size="2">
                        <i>
                          <span>Treat Warnings As Errors</span>
                        </i>
                        <span>:
specifies whether to treat warning as errors during the build.</span>
                      </font>
                    </font>
                  </p>
                </td>
                <td>
                  <p>
                    <font face="Arial">
                      <font size="2">
                        <span>DictionaryTags</span>
                        <span>.</span>
                        <span>TreatWarningsAsErrors</span>
                      </font>
                    </font>
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <font face="Arial">
                      <font size="2">
                        <i>
                          <span>Warning Level</span>
                        </i>
                        <span>: specifies
the warning level.</span>
                      </font>
                    </font>
                  </p>
                </td>
                <td>
                  <p>
                    <font face="Arial">
                      <font size="2">
                        <span>DictionaryTags</span>
                        <span>.</span>
                        <span>WarningLevel</span>
                      </font>
                    </font>
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <font face="Arial">
                      <font size="2">
                        <i>
                          <span>Output Path</span>
                        </i>
                        <span>: specifies
the location of the output files for this project configuration.</span>
                      </font>
                    </font>
                  </p>
                </td>
                <td>
                  <p>
                    <font face="Arial">
                      <font size="2">
                        <span>DictionaryTags</span>
                        <span>.</span>
                        <span>OutputPath</span>
                      </font>
                    </font>
                  </p>
                </td>
              </tr>
              <tr>
                <td colspan="2">
                  <p>
                    <span>
                      <font face="Arial" size="2">  </font>
                    </span>
                  </p>
                </td>
              </tr>
              <font face="Arial" size="2">
              </font>
            </tbody>
          </table>
        </p>
        <p>
          <span>
            <font face="Arial" size="2">
            </font>
          </span>
        </p>
        <p>
          <b>
            <i>
              <span>
                <font face="Arial" size="2">Common Properties</font>
              </span>
            </i>
          </b>
        </p>
        <p>
          <span>
            <font face="Arial" size="2">
            </font>
          </span>
        </p>
        <p>
          <span>
            <font face="Arial" size="2">To access the configuration properties, you need
to get the item <b>CommonProperties</b> from the project. <span> </span>This
item gets a value that represents the dictionary that contains the properties. (See
code below)</font>
          </span>
        </p>
        <p>
          <span>
            <font face="Arial" size="2">
            </font>
          </span>
        </p>
        <font face="Arial">
          <font size="2">
            <strong>
              <font color="red">
                <span>
                  <p>
                    <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">Property
commmonProperties <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span> project.Properties.Item(<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"CommonProperties"</span>);<br />
IDictionary dicCommonProps <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span> commmonProperties.Value <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">as</span> IDictionary;<br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">string</span> projKeyFileName <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span> dicCommonProps[DictionaryTags.AssemblyKeyFile].ToString();</span>
                  </p>
                </span>
              </font>
            </strong>
          </font>
        </font>
        <p>
          <span>
            <font face="Arial" size="2">
            </font>
          </span>
        </p>
        <p>
          <span>
            <font face="Arial" size="2">In the example, I get the name of the file that
contains either the public key using the <b>DictionaryTags.AssemblyKeyFile</b> enumeration.<span>  </span>This
is the list that you can access in this dictionary.</font>
          </span>
        </p>
        <p>
          <table id="Table2" cellspacing="0" cellpadding="0" border="1">
            <tbody>
              <tr>
                <td colspan="2">
                  <p>
                    <span>
                      <font face="Arial" size="2">  </font>
                    </span>
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p align="center">
                    <i>
                      <u>
                        <span>
                          <font face="Arial" size="2">Common Properties</font>
                        </span>
                      </u>
                    </i>
                  </p>
                </td>
                <td>
                  <p align="center">
                    <i>
                      <u>
                        <span>
                          <font face="Arial" size="2">Enumeration</font>
                        </span>
                      </u>
                    </i>
                  </p>
                </td>
              </tr>
              <tr>
                <td colspan="2">
                  <p>
                    <b>
                      <span>
                        <font face="Arial" size="2">Section: Assembly</font>
                      </span>
                    </b>
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <span>
                      <font face="Arial">
                        <font size="2">
                          <em>Assembly Key Name</em>: indicates the
key container that contains the key pair passed as a parameter to the constructor
of this attribute.</font>
                      </font>
                    </span>
                  </p>
                </td>
                <td>
                  <p>
                    <font face="Arial">
                      <font size="2">
                        <span>DictionaryTags</span>
                        <span>.</span>
                        <span>AssemblyKeyName</span>
                      </font>
                    </font>
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <span>
                      <font face="Arial">
                        <font size="2">
                          <em>Assembly Key File</em>: specifies the
name of the file that contains either the public key or both the public and private
keys passed as parameter to the constructor of this attribute.</font>
                      </font>
                    </span>
                  </p>
                </td>
                <td>
                  <p>
                    <font face="Arial">
                      <font size="2">
                        <span>DictionaryTags</span>
                        <span>.</span>
                        <span>AssemblyKeyFile</span>
                      </font>
                    </font>
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <span>
                      <font face="Arial">
                        <font size="2">
                          <em>Assembly Delay Sign</em>: value indicating
that delay signing is being used.</font>
                      </font>
                    </span>
                  </p>
                </td>
                <td>
                  <p>
                    <font face="Arial">
                      <font size="2">
                        <span>DictionaryTags</span>
                        <span>.</span>
                        <span>AssemblyDelaySign</span>
                      </font>
                    </font>
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <span>
                      <font face="Arial">
                        <font size="2">
                          <em>Assembly Title</em>: specifies the title
of the assembly.</font>
                      </font>
                    </span>
                  </p>
                </td>
                <td>
                  <p>
                    <font face="Arial">
                      <font size="2">
                        <span>DictionaryTags</span>
                        <span>.</span>
                        <span>AssemblyTitle</span>
                      </font>
                    </font>
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <span>
                      <font face="Arial">
                        <font size="2">
                          <em>Assembly Description</em>: specifies a
short description that summarizes the nature and purpose of the assembly.</font>
                      </font>
                    </span>
                  </p>
                </td>
                <td>
                  <p>
                    <font face="Arial">
                      <font size="2">
                        <span>DictionaryTags</span>
                        <span>.</span>
                        <span>AssemblyDescription</span>
                      </font>
                    </font>
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <span>
                      <font face="Arial">
                        <font size="2">
                          <em>Assembly Default Alias</em>: specifies
the default alias to be used by referencing assemblies.</font>
                      </font>
                    </span>
                  </p>
                </td>
                <td>
                  <p>
                    <font face="Arial">
                      <font size="2">
                        <span>DictionaryTags</span>
                        <span>.</span>
                        <span>AssemblyDefaultAlias</span>
                      </font>
                    </font>
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <span>
                      <font face="Arial">
                        <font size="2">
                          <em>Assembly Configuration</em>: specifies
the configuration of the assembly, such as Development or Deployment.</font>
                      </font>
                    </span>
                  </p>
                </td>
                <td>
                  <p>
                    <font face="Arial">
                      <font size="2">
                        <span>DictionaryTags</span>
                        <span>.</span>
                        <span>AssemblyConfiguration</span>
                      </font>
                    </font>
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <span>
                      <font face="Arial">
                        <font size="2">
                          <em>Assembly Trademark</em>: specifies the
trademark information.</font>
                      </font>
                    </span>
                  </p>
                </td>
                <td>
                  <p>
                    <font face="Arial">
                      <font size="2">
                        <span>DictionaryTags</span>
                        <span>.</span>
                        <span>AssemblyTrademark</span>
                      </font>
                    </font>
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <span>
                      <font face="Arial">
                        <font size="2">
                          <em>Assembly Product</em>: specifies the product
information.</font>
                      </font>
                    </span>
                  </p>
                </td>
                <td>
                  <p>
                    <font face="Arial">
                      <font size="2">
                        <span>DictionaryTags</span>
                        <span>.</span>
                        <span>AssemblyProduct</span>
                      </font>
                    </font>
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <span>
                      <font face="Arial">
                        <font size="2">
                          <em>Assembly Informational Version</em>: specifies
the version information.</font>
                      </font>
                    </span>
                  </p>
                </td>
                <td>
                  <p>
                    <font face="Arial">
                      <font size="2">
                        <span>DictionaryTags</span>
                        <span>.</span>
                        <span>AssemblyInformationalVersion</span>
                      </font>
                    </font>
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <span>
                      <font face="Arial">
                        <font size="2">
                          <em>Assembly File Version</em>: specifies
the Win32 file version.</font>
                      </font>
                    </span>
                  </p>
                </td>
                <td>
                  <p>
                    <font face="Arial">
                      <font size="2">
                        <span>DictionaryTags</span>
                        <span>.</span>
                        <span>AssemblyFileVersion</span>
                      </font>
                    </font>
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <span>
                      <font face="Arial">
                        <font size="2">
                          <em>Assembly Copyright</em>: specifies the
copyright information.</font>
                      </font>
                    </span>
                  </p>
                </td>
                <td>
                  <p>
                    <font face="Arial">
                      <font size="2">
                        <span>DictionaryTags</span>
                        <span>.</span>
                        <span>AssemblyCopyright</span>
                      </font>
                    </font>
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <span>
                      <font face="Arial">
                        <font size="2">
                          <em>Assembly Company</em>: specifies the name
of the company.</font>
                      </font>
                    </span>
                  </p>
                </td>
                <td>
                  <p>
                    <font face="Arial">
                      <font size="2">
                        <span>DictionaryTags</span>
                        <span>.</span>
                        <span>AssemblyCompany</span>
                      </font>
                    </font>
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <span>
                      <font face="Arial">
                        <font size="2">
                          <em>Assembly Version</em>: number that represent
the version of the assembly.</font>
                      </font>
                    </span>
                  </p>
                </td>
                <td>
                  <p>
                    <font face="Arial">
                      <font size="2">
                        <span>DictionaryTags</span>
                        <span>.</span>
                        <span>AssemblyVersion</span>
                      </font>
                    </font>
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <span>
                      <font face="Arial">
                        <font size="2">
                          <em>Assembly Culture</em>: indicate the culture
that the assembly supports.</font>
                      </font>
                    </span>
                  </p>
                </td>
                <td>
                  <p>
                    <font face="Arial">
                      <font size="2">
                        <span>DictionaryTags</span>
                        <span>.</span>
                        <span>AssemblyCulture</span>
                      </font>
                    </font>
                  </p>
                </td>
              </tr>
              <tr>
                <td colspan="2">
                  <p>
                    <b>
                      <span>
                        <font face="Arial" size="2">Section: References Path</font>
                      </span>
                    </b>
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <span>
                      <font face="Arial">
                        <font size="2">
                          <em>References Path</em>: Lists the directories
to search when the project is loaded for assemblies referenced by the project. This
setting is specific to the project, computer, and user for which it is set. A relative
path specification will be converted to, and stored as a fully-qualified path. Relative
paths are assumed to be relative to the project directory.</font>
                      </font>
                    </span>
                  </p>
                </td>
                <td>
                  <p>
                    <font face="Arial">
                      <font size="2">
                        <span>DictionaryTags</span>
                        <span>.R</span>
                        <span>eferencesPath</span>
                      </font>
                    </font>
                  </p>
                </td>
              </tr>
              <tr>
                <td colspan="2">
                  <p>
                    <b>
                      <span>
                        <font face="Arial" size="2">Section: General</font>
                      </span>
                    </b>
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <span>
                      <font face="Arial">
                        <font size="2">
                          <em>Project Folder</em>: the full path to
the project directory.</font>
                      </font>
                    </span>
                  </p>
                </td>
                <td>
                  <p>
                    <font face="Arial">
                      <font size="2">
                        <span>DictionaryTags</span>
                        <span>.</span>
                        <span>ProjectFolder</span>
                      </font>
                    </font>
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <span>
                      <font face="Arial">
                        <font size="2">
                          <em>Project File</em>: the name of the file
containing build, configuration, and the information about the project.</font>
                      </font>
                    </span>
                  </p>
                </td>
                <td>
                  <p>
                    <font face="Arial">
                      <font size="2">
                        <span>DictionaryTags</span>
                        <span>.</span>
                        <span>ProjectFile</span>
                      </font>
                    </font>
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <span>
                      <font face="Arial">
                        <font size="2">
                          <em>Default Namespace</em>: specifies the
default namespace for added items, such as classes, that are added via the Add New
Item Dialog Box.</font>
                      </font>
                    </span>
                  </p>
                </td>
                <td>
                  <p>
                    <font face="Arial">
                      <font size="2">
                        <span>DictionaryTags</span>
                        <span>.</span>
                        <span>DefaultNamespace</span>
                      </font>
                    </font>
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <span>
                      <font face="Arial">
                        <font size="2">
                          <em>Assembly Name</em>: the name of the output
file that will hold assembly metadata.</font>
                      </font>
                    </span>
                  </p>
                </td>
                <td>
                  <p>
                    <font face="Arial">
                      <font size="2">
                        <span>DictionaryTags</span>
                        <span>.</span>
                        <span>AssemblyName</span>
                      </font>
                    </font>
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <span>
                      <font face="Arial" size="2">  </font>
                    </span>
                  </p>
                </td>
                <td>
                  <p>
                    <span>
                      <font face="Arial" size="2">  </font>
                    </span>
                  </p>
                </td>
              </tr>
              <tr>
                <td colspan="2">
                  <font face="Arial" size="2">
                  </font>
                </td>
              </tr>
              <font face="Arial" size="2">
              </font>
            </tbody>
          </table>
        </p>
        <p>
          <span>
            <font face="Arial" size="2">
            </font>
          </span>
        </p>
        <p>
          <b>
            <i>
              <span>
                <font face="Arial" size="2">DictionaryTags Enumeration</font>
              </span>
            </i>
          </b>
          <span>
            <font face="Arial" size="2">  </font>
          </span>
        </p>
        <p>
          <span>
            <font face="Arial" size="2">The <b>DictrionaryTags</b> enumeration class is
use to access each property, this class can be found in <strong>Microsoft.BizTalk.Studio.Extensibility.dll</strong> assembly. <span> </span>See
the structure below.</font>
          </span>
        </p>
        <pre>
          <span>
            <font face="Arial" color="red" size="1">
              <strong>
                <p>
                  <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
                    <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">public</span>
                    <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">enum</span> DictionaryTags{ 
<br />
OutputPath, 
<br />
WarningLevel, 
<br />
TreatWarningsAsErrors, 
<br />
EmbedTrackingInformation, 
<br />
GenerateDebuggingInformation, 
<br />
BpelCompliance, 
<br />
Server, 
<br />
ConfigurationDatabase, 
<br />
ApplicationName, 
<br />
Redeploy, Register,<br />
RestartHostInstances, 
<br />
AssemblyName, 
<br />
DefaultNamespace, 
<br />
ProjectFile, 
<br />
ProjectFolder, 
<br />
ReferencesPath, 
<br />
AssemblyCulture, 
<br />
AssemblyVersion, 
<br />
AssemblyCompany, 
<br />
AssemblyCopyright, 
<br />
AssemblyFileVersion, 
<br />
AssemblyInformationalVersion, 
<br />
AssemblyProduct, 
<br />
AssemblyTrademark, 
<br />
AssemblyConfiguration, 
<br />
AssemblyDefaultAlias, 
<br />
AssemblyDescription, 
<br />
AssemblyTitle, 
<br />
AssemblyDelaySign, 
<br />
AssemblyKeyFile, 
<br />
AssemblyKeyName, None<br />
}<br /></span>
                </p>
              </strong>
            </font>
          </span>
        </pre>
        <img width="0" height="0" src="http://blogs.devdeo.com/carlos.medina/aggbug.ashx?id=0d9cc5b3-6ca0-4bb0-bbd4-3a172a071c4a" />
      </body>
      <title>BizTalk Server 2006 project properties</title>
      <guid isPermaLink="false">http://blogs.devdeo.com/carlos.medina/PermaLink,guid,0d9cc5b3-6ca0-4bb0-bbd4-3a172a071c4a.aspx</guid>
      <link>http://blogs.devdeo.com/carlos.medina/PermaLink,guid,0d9cc5b3-6ca0-4bb0-bbd4-3a172a071c4a.aspx</link>
      <pubDate>Tue, 04 Apr 2006 03:20:52 GMT</pubDate>
      <description>&lt;p&gt;
&lt;span&gt;&lt;font face=Arial size=2&gt;Using the &lt;b&gt;EnvDTE.Project&lt;/b&gt; class you can access
the BizTalk Server 2006 project properties to get/set its value.&lt;span&gt;&amp;nbsp; &lt;/span&gt;A
bts-project uses two collections to store the properties; I’ll explain where you can
find each property. &lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span&gt;&lt;font face=Arial size=2&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;b&gt;&lt;i&gt;&lt;span&gt;&lt;font face=Arial size=2&gt;Configuration Properties&lt;/font&gt;&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span&gt;&lt;font face=Arial size=2&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span&gt;&lt;font face=Arial size=2&gt;To access the configuration properties, you need to
get the item &lt;b&gt;ConfigProperties&lt;/b&gt; from the active configuration.&lt;span&gt;&amp;nbsp; &lt;/span&gt;This
item gets a value that represents the dictionary that contains the properties. (See
code below)&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span&gt;&lt;font face=Arial size=2&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font size=2&gt;&lt;font face=Arial&gt;&lt;font color=red&gt;&lt;strong&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;Property
configProperties &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; project.ConfigurationManager.ActiveConfiguration.Properties.Item(&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"ConfigProperties"&lt;/span&gt;);&lt;br&gt;
IDictionary dicConfigProps &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; configProperties.Value &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;as&lt;/span&gt; IDictionary;&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;string&lt;/span&gt; outputPath &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; dicConfigProps[DictionaryTags.OutputPath].ToString();&lt;/span&gt;
&lt;/p&gt;
&gt;&gt;&gt;&gt;&gt; 
&lt;p&gt;
&lt;span&gt;&lt;font face=Arial size=2&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span&gt;&lt;font face=Arial size=2&gt;In the code, the type of &lt;b&gt;project&lt;/b&gt; variable is &lt;b&gt;EnvDTE.Project&lt;/b&gt; and
represents the &lt;i&gt;BizTalk Server 2006&lt;/i&gt; project. &lt;span&gt;&amp;nbsp;&lt;/span&gt;This object
has a dictionary with each property related to configuration, to access each property
you must use the &lt;b&gt;DictionaryTags&lt;/b&gt;.&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span&gt;&lt;font face=Arial size=2&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span&gt;&lt;font face=Arial size=2&gt;In the example, I get the location of the output files
for the current project using the &lt;b&gt;DictionaryTags.OutputPath&lt;/b&gt; key.&lt;span&gt;&amp;nbsp; &lt;/span&gt;This
is the list that you can access in this dictionary.&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;table id=Table1 cellspacing=0 cellpadding=0 border=1&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td colspan=2&gt;
&lt;p&gt;
&lt;span&gt;&lt;font face=Arial size=2&gt;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;p align=center&gt;
&lt;i&gt;&lt;u&gt;&lt;span&gt;&lt;font face=Arial size=2&gt;Configuration Properties&lt;/font&gt;&lt;/span&gt;&lt;/u&gt;&lt;/i&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;p align=center&gt;
&lt;i&gt;&lt;u&gt;&lt;span&gt;&lt;font face=Arial size=2&gt;Enumeration&lt;/font&gt;&lt;/span&gt;&lt;/u&gt;&lt;/i&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=2&gt;
&lt;p&gt;
&lt;b&gt;&lt;span&gt;&lt;font face=Arial size=2&gt;Section: Build&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;p&gt;
&lt;font face=Arial&gt;&lt;font size=2&gt;&lt;i&gt;&lt;span&gt;Restart Host Instances&lt;/span&gt;&lt;/i&gt;&lt;span&gt;: specifies
whether to restart all BizTalk in-process host instances on local machine.&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;
&lt;font face=Arial&gt;&lt;font size=2&gt;&lt;span&gt;DictionaryTags&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;RestartHostInstances&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;p&gt;
&lt;font face=Arial&gt;&lt;font size=2&gt;&lt;i&gt;&lt;span&gt;Register&lt;/span&gt;&lt;/i&gt;&lt;span&gt;: specifies whether
to register the assembly in the Global Assembly Cache.&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;
&lt;font face=Arial&gt;&lt;font size=2&gt;&lt;span&gt;DictionaryTags&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;Register&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;p&gt;
&lt;font face=Arial&gt;&lt;font size=2&gt;&lt;i&gt;&lt;span&gt;Redeploy&lt;/span&gt;&lt;/i&gt;&lt;span&gt;: specifies whether
to delete existing configuration and recreate it every time the assembly is deployed.&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;
&lt;font face=Arial&gt;&lt;font size=2&gt;&lt;span&gt;DictionaryTags&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;Redeploy&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;p&gt;
&lt;font face=Arial&gt;&lt;font size=2&gt;&lt;i&gt;&lt;span&gt;Application Name&lt;/span&gt;&lt;/i&gt;&lt;span&gt;: specifies
the BizTalk Application in which to deploy the assembly.&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;
&lt;font face=Arial&gt;&lt;font size=2&gt;&lt;span&gt;DictionaryTags&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;ApplicationName&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;p&gt;
&lt;font face=Arial&gt;&lt;font size=2&gt;&lt;i&gt;&lt;span&gt;Configuration Database&lt;/span&gt;&lt;/i&gt;&lt;span&gt;: configuration
Database to deploy.&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;
&lt;font face=Arial&gt;&lt;font size=2&gt;&lt;span&gt;DictionaryTags&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;ConfigurationDatabase&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;p&gt;
&lt;font face=Arial&gt;&lt;font size=2&gt;&lt;i&gt;&lt;span&gt;Server&lt;/span&gt;&lt;/i&gt;&lt;span&gt;: specifies the server
when the BizTalk Configuration Database resides.&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;
&lt;font face=Arial&gt;&lt;font size=2&gt;&lt;span&gt;DictionaryTags&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;Server&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=2&gt;
&lt;p&gt;
&lt;b&gt;&lt;span&gt;&lt;font face=Arial size=2&gt;Section: Deployment&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;p&gt;
&lt;font face=Arial&gt;&lt;font size=2&gt;&lt;i&gt;&lt;span&gt;BPEL Compliance&lt;/span&gt;&lt;/i&gt;&lt;span&gt;: specifies
whether to generate Business Process Execution Language (BPEL) compliance output.&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;
&lt;font face=Arial&gt;&lt;font size=2&gt;&lt;span&gt;DictionaryTags&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;BpelCompliance&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;p&gt;
&lt;font face=Arial&gt;&lt;font size=2&gt;&lt;i&gt;&lt;span&gt;Generate Debugging Information&lt;/span&gt;&lt;/i&gt;&lt;span&gt;:
specifies whether generate debug symbols.&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;
&lt;font face=Arial&gt;&lt;font size=2&gt;&lt;span&gt;DictionaryTags&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;GenerateDebuggingInformation&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;p&gt;
&lt;font face=Arial&gt;&lt;font size=2&gt;&lt;i&gt;&lt;span&gt;Embed Tracking Information&lt;/span&gt;&lt;/i&gt;&lt;span&gt;:
specifies whether to embed tracking information in the assembly.&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;
&lt;font face=Arial&gt;&lt;font size=2&gt;&lt;span&gt;DictionaryTags&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;EmbedTrackingInformation&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;p&gt;
&lt;font face=Arial&gt;&lt;font size=2&gt;&lt;i&gt;&lt;span&gt;Treat Warnings As Errors&lt;/span&gt;&lt;/i&gt;&lt;span&gt;:
specifies whether to treat warning as errors during the build.&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;
&lt;font face=Arial&gt;&lt;font size=2&gt;&lt;span&gt;DictionaryTags&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;TreatWarningsAsErrors&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;p&gt;
&lt;font face=Arial&gt;&lt;font size=2&gt;&lt;i&gt;&lt;span&gt;Warning Level&lt;/span&gt;&lt;/i&gt;&lt;span&gt;: specifies the
warning level.&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;
&lt;font face=Arial&gt;&lt;font size=2&gt;&lt;span&gt;DictionaryTags&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;WarningLevel&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;p&gt;
&lt;font face=Arial&gt;&lt;font size=2&gt;&lt;i&gt;&lt;span&gt;Output Path&lt;/span&gt;&lt;/i&gt;&lt;span&gt;: specifies the
location of the output files for this project configuration.&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;
&lt;font face=Arial&gt;&lt;font size=2&gt;&lt;span&gt;DictionaryTags&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;OutputPath&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=2&gt;
&lt;p&gt;
&lt;span&gt;&lt;font face=Arial size=2&gt;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;font face=Arial size=2&gt;&lt;/font&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span&gt;&lt;font face=Arial size=2&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;b&gt;&lt;i&gt;&lt;span&gt;&lt;font face=Arial size=2&gt;Common Properties&lt;/font&gt;&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span&gt;&lt;font face=Arial size=2&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span&gt;&lt;font face=Arial size=2&gt;To access the configuration properties, you need to
get the item &lt;b&gt;CommonProperties&lt;/b&gt; from the project. &lt;span&gt;&amp;nbsp;&lt;/span&gt;This item
gets a value that represents the dictionary that contains the properties. (See code
below)&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span&gt;&lt;font face=Arial size=2&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;font face=Arial&gt;&lt;font size=2&gt;&lt;strong&gt;&lt;font color=red&gt;&lt;span&gt; 
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;Property
commmonProperties &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; project.Properties.Item(&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"CommonProperties"&lt;/span&gt;);&lt;br&gt;
IDictionary dicCommonProps &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; commmonProperties.Value &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;as&lt;/span&gt; IDictionary;&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;string&lt;/span&gt; projKeyFileName &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; dicCommonProps[DictionaryTags.AssemblyKeyFile].ToString();&lt;/span&gt;
&lt;/p&gt;
&lt;/span&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/font&gt;&lt;/font&gt; 
&lt;p&gt;
&lt;span&gt;&lt;font face=Arial size=2&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span&gt;&lt;font face=Arial size=2&gt;In the example, I get the name of the file that contains
either the public key using the &lt;b&gt;DictionaryTags.AssemblyKeyFile&lt;/b&gt; enumeration.&lt;span&gt;&amp;nbsp; &lt;/span&gt;This
is the list that you can access in this dictionary.&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;table id=Table2 cellspacing=0 cellpadding=0 border=1&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td colspan=2&gt;
&lt;p&gt;
&lt;span&gt;&lt;font face=Arial size=2&gt;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;p align=center&gt;
&lt;i&gt;&lt;u&gt;&lt;span&gt;&lt;font face=Arial size=2&gt;Common Properties&lt;/font&gt;&lt;/span&gt;&lt;/u&gt;&lt;/i&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;p align=center&gt;
&lt;i&gt;&lt;u&gt;&lt;span&gt;&lt;font face=Arial size=2&gt;Enumeration&lt;/font&gt;&lt;/span&gt;&lt;/u&gt;&lt;/i&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=2&gt;
&lt;p&gt;
&lt;b&gt;&lt;span&gt;&lt;font face=Arial size=2&gt;Section: Assembly&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;p&gt;
&lt;span&gt;&lt;font face=Arial&gt;&lt;font size=2&gt;&lt;em&gt;Assembly Key Name&lt;/em&gt;: indicates the key
container that contains the key pair passed as a parameter to the constructor of this
attribute.&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;
&lt;font face=Arial&gt;&lt;font size=2&gt;&lt;span&gt;DictionaryTags&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;AssemblyKeyName&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;p&gt;
&lt;span&gt;&lt;font face=Arial&gt;&lt;font size=2&gt;&lt;em&gt;Assembly Key File&lt;/em&gt;: specifies the name
of the file that contains either the public key or both the public and private keys
passed as parameter to the constructor of this attribute.&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;
&lt;font face=Arial&gt;&lt;font size=2&gt;&lt;span&gt;DictionaryTags&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;AssemblyKeyFile&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;p&gt;
&lt;span&gt;&lt;font face=Arial&gt;&lt;font size=2&gt;&lt;em&gt;Assembly Delay Sign&lt;/em&gt;: value indicating
that delay signing is being used.&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;
&lt;font face=Arial&gt;&lt;font size=2&gt;&lt;span&gt;DictionaryTags&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;AssemblyDelaySign&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;p&gt;
&lt;span&gt;&lt;font face=Arial&gt;&lt;font size=2&gt;&lt;em&gt;Assembly Title&lt;/em&gt;: specifies the title of
the assembly.&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;
&lt;font face=Arial&gt;&lt;font size=2&gt;&lt;span&gt;DictionaryTags&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;AssemblyTitle&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;p&gt;
&lt;span&gt;&lt;font face=Arial&gt;&lt;font size=2&gt;&lt;em&gt;Assembly Description&lt;/em&gt;: specifies a short
description that summarizes the nature and purpose of the assembly.&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;
&lt;font face=Arial&gt;&lt;font size=2&gt;&lt;span&gt;DictionaryTags&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;AssemblyDescription&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;p&gt;
&lt;span&gt;&lt;font face=Arial&gt;&lt;font size=2&gt;&lt;em&gt;Assembly Default Alias&lt;/em&gt;: specifies the
default alias to be used by referencing assemblies.&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;
&lt;font face=Arial&gt;&lt;font size=2&gt;&lt;span&gt;DictionaryTags&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;AssemblyDefaultAlias&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;p&gt;
&lt;span&gt;&lt;font face=Arial&gt;&lt;font size=2&gt;&lt;em&gt;Assembly Configuration&lt;/em&gt;: specifies the
configuration of the assembly, such as Development or Deployment.&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;
&lt;font face=Arial&gt;&lt;font size=2&gt;&lt;span&gt;DictionaryTags&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;AssemblyConfiguration&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;p&gt;
&lt;span&gt;&lt;font face=Arial&gt;&lt;font size=2&gt;&lt;em&gt;Assembly Trademark&lt;/em&gt;: specifies the trademark
information.&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;
&lt;font face=Arial&gt;&lt;font size=2&gt;&lt;span&gt;DictionaryTags&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;AssemblyTrademark&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;p&gt;
&lt;span&gt;&lt;font face=Arial&gt;&lt;font size=2&gt;&lt;em&gt;Assembly Product&lt;/em&gt;: specifies the product
information.&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;
&lt;font face=Arial&gt;&lt;font size=2&gt;&lt;span&gt;DictionaryTags&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;AssemblyProduct&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;p&gt;
&lt;span&gt;&lt;font face=Arial&gt;&lt;font size=2&gt;&lt;em&gt;Assembly Informational Version&lt;/em&gt;: specifies
the version information.&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;
&lt;font face=Arial&gt;&lt;font size=2&gt;&lt;span&gt;DictionaryTags&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;AssemblyInformationalVersion&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;p&gt;
&lt;span&gt;&lt;font face=Arial&gt;&lt;font size=2&gt;&lt;em&gt;Assembly File Version&lt;/em&gt;: specifies the
Win32 file version.&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;
&lt;font face=Arial&gt;&lt;font size=2&gt;&lt;span&gt;DictionaryTags&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;AssemblyFileVersion&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;p&gt;
&lt;span&gt;&lt;font face=Arial&gt;&lt;font size=2&gt;&lt;em&gt;Assembly Copyright&lt;/em&gt;: specifies the copyright
information.&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;
&lt;font face=Arial&gt;&lt;font size=2&gt;&lt;span&gt;DictionaryTags&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;AssemblyCopyright&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;p&gt;
&lt;span&gt;&lt;font face=Arial&gt;&lt;font size=2&gt;&lt;em&gt;Assembly Company&lt;/em&gt;: specifies the name
of the company.&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;
&lt;font face=Arial&gt;&lt;font size=2&gt;&lt;span&gt;DictionaryTags&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;AssemblyCompany&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;p&gt;
&lt;span&gt;&lt;font face=Arial&gt;&lt;font size=2&gt;&lt;em&gt;Assembly Version&lt;/em&gt;: number that represent
the version of the assembly.&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;
&lt;font face=Arial&gt;&lt;font size=2&gt;&lt;span&gt;DictionaryTags&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;AssemblyVersion&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;p&gt;
&lt;span&gt;&lt;font face=Arial&gt;&lt;font size=2&gt;&lt;em&gt;Assembly Culture&lt;/em&gt;: indicate the culture
that the assembly supports.&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;
&lt;font face=Arial&gt;&lt;font size=2&gt;&lt;span&gt;DictionaryTags&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;AssemblyCulture&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=2&gt;
&lt;p&gt;
&lt;b&gt;&lt;span&gt;&lt;font face=Arial size=2&gt;Section: References Path&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;p&gt;
&lt;span&gt;&lt;font face=Arial&gt;&lt;font size=2&gt;&lt;em&gt;References Path&lt;/em&gt;: Lists the directories
to search when the project is loaded for assemblies referenced by the project. This
setting is specific to the project, computer, and user for which it is set. A relative
path specification will be converted to, and stored as a fully-qualified path. Relative
paths are assumed to be relative to the project directory.&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;
&lt;font face=Arial&gt;&lt;font size=2&gt;&lt;span&gt;DictionaryTags&lt;/span&gt;&lt;span&gt;.R&lt;/span&gt;&lt;span&gt;eferencesPath&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=2&gt;
&lt;p&gt;
&lt;b&gt;&lt;span&gt;&lt;font face=Arial size=2&gt;Section: General&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;p&gt;
&lt;span&gt;&lt;font face=Arial&gt;&lt;font size=2&gt;&lt;em&gt;Project Folder&lt;/em&gt;: the full path to the
project directory.&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;
&lt;font face=Arial&gt;&lt;font size=2&gt;&lt;span&gt;DictionaryTags&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;ProjectFolder&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;p&gt;
&lt;span&gt;&lt;font face=Arial&gt;&lt;font size=2&gt;&lt;em&gt;Project File&lt;/em&gt;: the name of the file containing
build, configuration, and the information about the project.&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;
&lt;font face=Arial&gt;&lt;font size=2&gt;&lt;span&gt;DictionaryTags&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;ProjectFile&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;p&gt;
&lt;span&gt;&lt;font face=Arial&gt;&lt;font size=2&gt;&lt;em&gt;Default Namespace&lt;/em&gt;: specifies the default
namespace for added items, such as classes, that are added via the Add New Item Dialog
Box.&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;
&lt;font face=Arial&gt;&lt;font size=2&gt;&lt;span&gt;DictionaryTags&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;DefaultNamespace&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;p&gt;
&lt;span&gt;&lt;font face=Arial&gt;&lt;font size=2&gt;&lt;em&gt;Assembly Name&lt;/em&gt;: the name of the output
file that will hold assembly metadata.&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;
&lt;font face=Arial&gt;&lt;font size=2&gt;&lt;span&gt;DictionaryTags&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;AssemblyName&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;p&gt;
&lt;span&gt;&lt;font face=Arial size=2&gt;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;
&lt;span&gt;&lt;font face=Arial size=2&gt;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=2&gt;
&lt;font face=Arial size=2&gt;&lt;/font&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;font face=Arial size=2&gt;&lt;/font&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span&gt;&lt;font face=Arial size=2&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;b&gt;&lt;i&gt;&lt;span&gt;&lt;font face=Arial size=2&gt;DictionaryTags Enumeration&lt;/font&gt;&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;span&gt;&lt;font face=Arial size=2&gt;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span&gt;&lt;font face=Arial size=2&gt;The &lt;b&gt;DictrionaryTags&lt;/b&gt; enumeration class is use
to access each property, this class can be found in &lt;strong&gt;Microsoft.BizTalk.Studio.Extensibility.dll&lt;/strong&gt; assembly. &lt;span&gt;&amp;nbsp;&lt;/span&gt;See
the structure below.&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;pre&gt;&lt;span&gt;&lt;font face=Arial color=red size=1&gt;&lt;strong&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;public&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;enum&lt;/span&gt; DictionaryTags{ 
&lt;br&gt;
OutputPath, 
&lt;br&gt;
WarningLevel, 
&lt;br&gt;
TreatWarningsAsErrors, 
&lt;br&gt;
EmbedTrackingInformation, 
&lt;br&gt;
GenerateDebuggingInformation, 
&lt;br&gt;
BpelCompliance, 
&lt;br&gt;
Server, 
&lt;br&gt;
ConfigurationDatabase, 
&lt;br&gt;
ApplicationName, 
&lt;br&gt;
Redeploy, Register,&lt;br&gt;
RestartHostInstances, 
&lt;br&gt;
AssemblyName, 
&lt;br&gt;
DefaultNamespace, 
&lt;br&gt;
ProjectFile, 
&lt;br&gt;
ProjectFolder, 
&lt;br&gt;
ReferencesPath, 
&lt;br&gt;
AssemblyCulture, 
&lt;br&gt;
AssemblyVersion, 
&lt;br&gt;
AssemblyCompany, 
&lt;br&gt;
AssemblyCopyright, 
&lt;br&gt;
AssemblyFileVersion, 
&lt;br&gt;
AssemblyInformationalVersion, 
&lt;br&gt;
AssemblyProduct, 
&lt;br&gt;
AssemblyTrademark, 
&lt;br&gt;
AssemblyConfiguration, 
&lt;br&gt;
AssemblyDefaultAlias, 
&lt;br&gt;
AssemblyDescription, 
&lt;br&gt;
AssemblyTitle, 
&lt;br&gt;
AssemblyDelaySign, 
&lt;br&gt;
AssemblyKeyFile, 
&lt;br&gt;
AssemblyKeyName, None&lt;br&gt;
}&lt;br&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;/strong&gt;&lt;/font&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;img width="0" height="0" src="http://blogs.devdeo.com/carlos.medina/aggbug.ashx?id=0d9cc5b3-6ca0-4bb0-bbd4-3a172a071c4a" /&gt;</description>
      <comments>http://blogs.devdeo.com/carlos.medina/CommentView,guid,0d9cc5b3-6ca0-4bb0-bbd4-3a172a071c4a.aspx</comments>
    </item>
    <item>
      <trackback:ping>http://blogs.devdeo.com/carlos.medina/Trackback.aspx?guid=f61fe506-afcf-41a9-928a-0a325df35fb3</trackback:ping>
      <pingback:server>http://blogs.devdeo.com/carlos.medina/pingback.aspx</pingback:server>
      <pingback:target>http://blogs.devdeo.com/carlos.medina/PermaLink,guid,f61fe506-afcf-41a9-928a-0a325df35fb3.aspx</pingback:target>
      <dc:creator>Carlos Medina</dc:creator>
      <wfw:comment>http://blogs.devdeo.com/carlos.medina/CommentView,guid,f61fe506-afcf-41a9-928a-0a325df35fb3.aspx</wfw:comment>
      <wfw:commentRss>http://blogs.devdeo.com/carlos.medina/SyndicationService.asmx/GetEntryCommentsRss?guid=f61fe506-afcf-41a9-928a-0a325df35fb3</wfw:commentRss>
      <slash:comments>8</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
          <font face="Arial" size="2">I have listened many times, <em>how can I get a message
context property from a map?</em>  Well, while I was playing with the framework
of BizTalk Server 2006 RC I found the way to do a functoid that implements this functionality. 
I’ll try to explain how I do it below.</font>
        </p>
        <p>
          <font face="Arial" size="2">
            <em>First</em>, I have to know three values:</font>
        </p>
        <blockquote dir="ltr" style="MARGIN-RIGHT: 0px">
          <p>
            <font face="Arial" size="2">
              <strong>Message Name</strong>: the name of the message
that have the context property<br /><strong>Property Name</strong>: the name of the context property<br /><strong>Property Namespace</strong>: the namespace of the context property</font>
          </p>
        </blockquote>
        <p>
          <font face="Arial" size="2">
            <em>Second</em>, I need to get the segments of the service
(orchestration) and check in each segment if the message that I’m looking for is there. 
The messages aren’t stored directly in the service; the messages are stored in the
segments that exist inside the orchestration.  Normally one orchestration has
two segments and one more segment when the orchestration implements compensation;
the message normally is stored in the second segment (I really don’t know why the
segments exist, this is an internal architecture from Microsoft and there isn’t information
about that).</font>
        </p>
        <p>
          <font face="Arial" size="2">
            <em>Third</em>, when I find the particular message I check
the context property (formed by Property Name and Property Namespace) inside the message
and return its value.</font>
        </p>
        <p>
          <font face="Arial" size="2">This is the code that I have used:</font>
        </p>
        <p>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
            <span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">//
set the property</span>
            <br />
            <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">string</span> property <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span><span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">""</span>;<br /><span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">//
get the service</span><br />
Microsoft.XLANGs.Core.Service s <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span> Microsoft.XLANGs.Core.Service.RootService;<br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">foreach</span> (Microsoft.XLANGs.Core.Segment
seg <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">in</span> s._segments)<br />
{<br /><span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">//
find the real name of the message</span><br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">foreach</span> (DictionaryEntry
de <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">in</span> Microsoft.XLANGs.Core.Context.FindFields(<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">typeof</span>(Microsoft.XLANGs.BaseTypes.XLANGMessage),
seg.ExceptionContext))<br />
{<br /><span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">//
check that the key ends with the name of the message</span><br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">if</span> (de.Key.ToString().EndsWith(val1))<br />
{<br /><span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">//
get the message as a XLANGMessage</span><br />
Microsoft.XLANGs.Core.XMessage msg <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span> de.Value <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">as</span> Microsoft.XLANGs.Core.XMessage;<br /><span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">//
if the message was found, then I get the value of the property</span><br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">if</span> (msg
!<span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">null</span>)<br />
{<br /><span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">//
create a XmlQName instance</span><br />
Microsoft.XLANGs.BaseTypes.XmlQName qName <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">new</span> Microsoft.XLANGs.BaseTypes.XmlQName(val2,
val3);<br /><span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">//
find the message property in the message</span><br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">if</span> (msg.GetContextProperties().ContainsKey(qName))<br />
{<br /><span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">//
get the property from GetContextProperties</span><br />
property <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span> msg.GetContextProperties()[qName].ToString();<br />
}<br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">else</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">if</span> (msg.GetContentProperties().ContainsKey(qName))<br />
{<br /><span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">//
get the property from GetContentProperties</span><br />
property <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span> msg.GetContentProperties()[qName].ToString();<br />
}<br />
}<br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">break</span>;<br />
}<br />
}<br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">if</span> (property.Length
&gt; 0)<br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">break</span>;<br />
}<br /><span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">//
return the property value</span><br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">return</span> property;<br /></span>
        </p>
        <p>
          <font face="Arial" size="2">
            <strong>Exception :(</strong>
          </font>
        </p>
        <p>
          <font face="Arial" size="2">Unfortunately this functoid <em><strong>ONLY</strong></em> works
if it is invoked from an orchestration… I mean a map inside an orchestration. 
The reason is simple, to access to Message I have to get the current context of the
service and this service is represented by the orchestration, if the orchestration
doesn’t exist I cann’t get the context.</font>
        </p>
        <p>
          <font face="Arial" size="2">You can download the functoid assembly from <a href="http://www.gotdotnet.com/workspaces/workspace.aspx?id=42f4a3df-f9a5-4122-a6a2-b04b941b40fe">GetContextProperty
Functoid Workspace</a></font>
        </p>
        <p>
          <font face="Arial" size="2">This functoid was developed with the framework of Microsoft
BizTalk 2006 RC using the Microsoft.XLANGs.Engine.dll and Microsoft.XLANGs.BasTypes.dll
assemblies.  I hope that this functionality exists in the RTM version.</font>
        </p>
        <img width="0" height="0" src="http://blogs.devdeo.com/carlos.medina/aggbug.ashx?id=f61fe506-afcf-41a9-928a-0a325df35fb3" />
      </body>
      <title>Custom GetContextProperty Functoid</title>
      <guid isPermaLink="false">http://blogs.devdeo.com/carlos.medina/PermaLink,guid,f61fe506-afcf-41a9-928a-0a325df35fb3.aspx</guid>
      <link>http://blogs.devdeo.com/carlos.medina/PermaLink,guid,f61fe506-afcf-41a9-928a-0a325df35fb3.aspx</link>
      <pubDate>Fri, 24 Mar 2006 04:17:47 GMT</pubDate>
      <description>&lt;p&gt;
&lt;font face=Arial size=2&gt;I have listened many times, &lt;em&gt;how can I get a message context
property from a map?&lt;/em&gt;&amp;nbsp; Well, while I was playing with the framework of BizTalk
Server 2006 RC I found the way to do a functoid that implements this functionality.&amp;nbsp;
I’ll try to explain how I do it below.&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face=Arial size=2&gt;&lt;em&gt;First&lt;/em&gt;, I have to know three values:&lt;/font&gt;
&lt;/p&gt;
&lt;blockquote dir=ltr style="MARGIN-RIGHT: 0px"&gt; 
&lt;p&gt;
&lt;font face=Arial size=2&gt;&lt;strong&gt;Message Name&lt;/strong&gt;: the name of the message that
have the context property&lt;br&gt;
&lt;strong&gt;Property Name&lt;/strong&gt;: the name of the context property&lt;br&gt;
&lt;strong&gt;Property Namespace&lt;/strong&gt;: the namespace of the context property&lt;/font&gt;
&lt;/p&gt;
&lt;/blockquote&gt; 
&lt;p&gt;
&lt;font face=Arial size=2&gt;&lt;em&gt;Second&lt;/em&gt;, I need to get the segments of the service
(orchestration) and check in each segment if the message that I’m looking for is there.&amp;nbsp;
The messages aren’t stored directly in the service; the messages are stored in the
segments that exist inside the orchestration.&amp;nbsp; Normally one orchestration has
two segments and one more segment when the orchestration implements compensation;
the message normally is stored in the second segment (I really don’t know why the
segments exist, this is an internal architecture from Microsoft and there isn’t information
about that).&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face=Arial size=2&gt;&lt;em&gt;Third&lt;/em&gt;, when I find the particular message I check
the context property (formed by Property Name and Property Namespace) inside the message
and return its value.&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face=Arial size=2&gt;This is the code that I have used:&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;//
set the property&lt;/span&gt;
&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;string&lt;/span&gt; property &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;""&lt;/span&gt;;&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;//
get the service&lt;/span&gt;
&lt;br&gt;
Microsoft.XLANGs.Core.Service s &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; Microsoft.XLANGs.Core.Service.RootService;&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;foreach&lt;/span&gt; (Microsoft.XLANGs.Core.Segment
seg &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;in&lt;/span&gt; s._segments)&lt;br&gt;
{&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;//
find the real name of the message&lt;/span&gt;
&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;foreach&lt;/span&gt; (DictionaryEntry
de &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;in&lt;/span&gt; Microsoft.XLANGs.Core.Context.FindFields(&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;typeof&lt;/span&gt;(Microsoft.XLANGs.BaseTypes.XLANGMessage),
seg.ExceptionContext))&lt;br&gt;
{&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;//
check that the key ends with the name of the message&lt;/span&gt;
&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;if&lt;/span&gt; (de.Key.ToString().EndsWith(val1))&lt;br&gt;
{&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;//
get the message as a XLANGMessage&lt;/span&gt;
&lt;br&gt;
Microsoft.XLANGs.Core.XMessage msg &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; de.Value &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;as&lt;/span&gt; Microsoft.XLANGs.Core.XMessage;&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;//
if the message was found, then I get the value of the property&lt;/span&gt;
&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;if&lt;/span&gt; (msg
!&lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;null&lt;/span&gt;)&lt;br&gt;
{&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;//
create a XmlQName instance&lt;/span&gt;
&lt;br&gt;
Microsoft.XLANGs.BaseTypes.XmlQName qName &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;new&lt;/span&gt; Microsoft.XLANGs.BaseTypes.XmlQName(val2,
val3);&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;//
find the message property in the message&lt;/span&gt;
&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;if&lt;/span&gt; (msg.GetContextProperties().ContainsKey(qName))&lt;br&gt;
{&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;//
get the property from GetContextProperties&lt;/span&gt;
&lt;br&gt;
property &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; msg.GetContextProperties()[qName].ToString();&lt;br&gt;
}&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;else&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;if&lt;/span&gt; (msg.GetContentProperties().ContainsKey(qName))&lt;br&gt;
{&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;//
get the property from GetContentProperties&lt;/span&gt;
&lt;br&gt;
property &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; msg.GetContentProperties()[qName].ToString();&lt;br&gt;
}&lt;br&gt;
}&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;break&lt;/span&gt;;&lt;br&gt;
}&lt;br&gt;
}&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;if&lt;/span&gt; (property.Length
&amp;gt; 0)&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;break&lt;/span&gt;;&lt;br&gt;
}&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;//
return the property value&lt;/span&gt;
&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;return&lt;/span&gt; property;&lt;br&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face=Arial size=2&gt;&lt;strong&gt;Exception :(&lt;/strong&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face=Arial size=2&gt;Unfortunately this functoid &lt;em&gt;&lt;strong&gt;ONLY&lt;/strong&gt;&lt;/em&gt; works
if it is invoked from an orchestration… I mean a map inside an orchestration.&amp;nbsp;
The reason is simple, to access to Message I have to get the current context of the
service and this service is represented by the orchestration, if the orchestration
doesn’t exist I cann’t get the context.&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face=Arial size=2&gt;You can download the functoid assembly from &lt;a href="http://www.gotdotnet.com/workspaces/workspace.aspx?id=42f4a3df-f9a5-4122-a6a2-b04b941b40fe"&gt;GetContextProperty
Functoid Workspace&lt;/a&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face=Arial size=2&gt;This functoid was developed with the framework of Microsoft
BizTalk 2006 RC using the Microsoft.XLANGs.Engine.dll and Microsoft.XLANGs.BasTypes.dll
assemblies.&amp;nbsp; I hope that this functionality exists in the RTM version.&lt;/font&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://blogs.devdeo.com/carlos.medina/aggbug.ashx?id=f61fe506-afcf-41a9-928a-0a325df35fb3" /&gt;</description>
      <comments>http://blogs.devdeo.com/carlos.medina/CommentView,guid,f61fe506-afcf-41a9-928a-0a325df35fb3.aspx</comments>
    </item>
    <item>
      <trackback:ping>http://blogs.devdeo.com/carlos.medina/Trackback.aspx?guid=51390f3e-ffeb-4816-aad1-2a1b1732c387</trackback:ping>
      <pingback:server>http://blogs.devdeo.com/carlos.medina/pingback.aspx</pingback:server>
      <pingback:target>http://blogs.devdeo.com/carlos.medina/PermaLink,guid,51390f3e-ffeb-4816-aad1-2a1b1732c387.aspx</pingback:target>
      <dc:creator>Carlos Medina</dc:creator>
      <wfw:comment>http://blogs.devdeo.com/carlos.medina/CommentView,guid,51390f3e-ffeb-4816-aad1-2a1b1732c387.aspx</wfw:comment>
      <wfw:commentRss>http://blogs.devdeo.com/carlos.medina/SyndicationService.asmx/GetEntryCommentsRss?guid=51390f3e-ffeb-4816-aad1-2a1b1732c387</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
          <font face="Arial" size="2">Sometimes, in own orchestrations we need to know
if a message context property exists inside one message in particular. 
Well, the <em><strong>exists</strong></em> operator is useful in this situation.</font>
        </p>
        <p>
          <font face="Arial" size="2">The <strong><em>exists</em></strong> operator can be use
in Filter expressions or Decide shapes.  The filter expression can determine
if a message is welcome in the orchestration or not, and you can use the <strong><em>exists</em></strong> operator to
allow messages that contain one or various message context property incoming to process.</font>
        </p>
        <p>
          <font face="Arial" size="2">But, if you need to take a decision about what way
to follow when a message context property exists or not in the message you can
use a Decide shape and the <strong><em>exists</em></strong> operator.  The
syntax to <strong><em>exists</em></strong> operator is: <em>PropertyName <strong>exists</strong> MessageName</em>.</font>
        </p>
        <p>
          <font face="Arial" size="2">For example, if you need to know if the BTS.AckFailurecategory
property is inside the message, you must use this expression: </font>
          <font face="Arial" size="2">
            <em>BTS.AckFailureCategory <strong><u>exists</u></strong> MessageIn</em>
          </font>
        </p>
        <img width="0" height="0" src="http://blogs.devdeo.com/carlos.medina/aggbug.ashx?id=51390f3e-ffeb-4816-aad1-2a1b1732c387" />
      </body>
      <title>the exists operator</title>
      <guid isPermaLink="false">http://blogs.devdeo.com/carlos.medina/PermaLink,guid,51390f3e-ffeb-4816-aad1-2a1b1732c387.aspx</guid>
      <link>http://blogs.devdeo.com/carlos.medina/PermaLink,guid,51390f3e-ffeb-4816-aad1-2a1b1732c387.aspx</link>
      <pubDate>Thu, 16 Mar 2006 04:15:48 GMT</pubDate>
      <description>&lt;p&gt;
&lt;font face=Arial size=2&gt;Sometimes,&amp;nbsp;in own orchestrations we need to know if a&amp;nbsp;message
context property&amp;nbsp;exists inside one message in particular.&amp;nbsp; Well, the &lt;em&gt;&lt;strong&gt;exists&lt;/strong&gt;&lt;/em&gt; operator
is&amp;nbsp;useful in this situation.&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face=Arial size=2&gt;The &lt;strong&gt;&lt;em&gt;exists&lt;/em&gt;&lt;/strong&gt; operator can be use in
Filter expressions or Decide shapes.&amp;nbsp; The filter expression can determine if
a message is welcome in&amp;nbsp;the orchestration or not, and you can use the &lt;strong&gt;&lt;em&gt;exists&lt;/em&gt;&lt;/strong&gt; operator&amp;nbsp;to
allow messages that contain one or various message context property incoming to process.&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face=Arial size=2&gt;But, if you need to take a decision about what&amp;nbsp;way to&amp;nbsp;follow
when a message context property exists or not in the message you can use a Decide
shape and the &lt;strong&gt;&lt;em&gt;exists&lt;/em&gt;&lt;/strong&gt; operator.&amp;nbsp;&amp;nbsp;The syntax to &lt;strong&gt;&lt;em&gt;exists&lt;/em&gt;&lt;/strong&gt; operator
is: &lt;em&gt;PropertyName &lt;strong&gt;exists&lt;/strong&gt; MessageName&lt;/em&gt;.&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face=Arial size=2&gt;For example, if you need to know if the BTS.AckFailurecategory
property is inside the message, you must use this expression: &lt;/font&gt;&lt;font face=Arial size=2&gt;&lt;em&gt;BTS.AckFailureCategory &lt;strong&gt;&lt;u&gt;exists&lt;/u&gt;&lt;/strong&gt; MessageIn&lt;/em&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://blogs.devdeo.com/carlos.medina/aggbug.ashx?id=51390f3e-ffeb-4816-aad1-2a1b1732c387" /&gt;</description>
      <comments>http://blogs.devdeo.com/carlos.medina/CommentView,guid,51390f3e-ffeb-4816-aad1-2a1b1732c387.aspx</comments>
    </item>
  </channel>
</rss>
