<?xml version="1.0" encoding="utf-8"?>
<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:georss="http://www.georss.org/georss" xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0">
  <channel>
    <title>Mike Bouck's RAM</title>
    <link>http://blog.gatosoft.com/</link>
    <description>volatile memory sucks...</description>
    <language>en-us</language>
    <copyright>Mike Bouck</copyright>
    <lastBuildDate>Sat, 01 Apr 2006 08:11:29 GMT</lastBuildDate>
    <generator>newtelligence dasBlog 2.2.8279.16125</generator>
    <managingEditor>michael@bouck.com</managingEditor>
    <webMaster>michael@bouck.com</webMaster>
    <item>
      <trackback:ping>http://blog.gatosoft.com/Trackback.aspx?guid=d0a0dd1e-c9ac-4fa9-a408-615454d49702</trackback:ping>
      <pingback:server>http://blog.gatosoft.com/pingback.aspx</pingback:server>
      <pingback:target>http://blog.gatosoft.com/PermaLink,guid,d0a0dd1e-c9ac-4fa9-a408-615454d49702.aspx</pingback:target>
      <dc:creator>Mike Bouck</dc:creator>
      <georss:point>33.13111 -117.226157</georss:point>
      <wfw:comment>http://blog.gatosoft.com/CommentView,guid,d0a0dd1e-c9ac-4fa9-a408-615454d49702.aspx</wfw:comment>
      <wfw:commentRss>http://blog.gatosoft.com/SyndicationService.asmx/GetEntryCommentsRss?guid=d0a0dd1e-c9ac-4fa9-a408-615454d49702</wfw:commentRss>
      <slash:comments>26</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">The <a href="http://msdn2.microsoft.com/en-us/library/t71a733d.aspx">ClickOnce</a> support
in Visual Studio 2005 is nice and easy but falls-down in number of areas:<br /><br /><ol><li>
The application manifest (i.e. the "stuff" that comprises your app) is determined
by walking the project references of your Windows app.  What this means is that
if you have deployment artifacts that are non-reference content or late-bound loaded
assemblies then the default ClickOnce mechanism in Visual Studio will <b>not</b> pick
them up. 
</li><li>
Oftentimes the versioning scheme for your assemblies is driven by your build process
and ideally you'd want the ClickOnce version number to be in-sync with your assembly
version.  The Visual Studio ClickOnce mechanism has a very limited versioning
scheme that is completely decoupled from assembly versioning and is inaccessible outside
of the IDE. 
</li><li>
For enterpirse scenarios, it is very common to have a segmented network dedicated
for specific functions (e.g. development, test, production).  In this scenario
the Windows app has to be designed such that certain information (e.g. connection
strings, web service urls, etc.) are pushed-into environment-specific configuration
files.  The deploy process then involves indicating what environment the built
bits should be pushed into and then the appropriate configuration files are pulled-in
by the deploy process.  In this way the same set of bits may be "promoted" from
dev to test and finally to production.  The default Visual Studio ClickOnce mechanism
has no notion of nor capability of dealing with environment-specific information.<br /></li></ol><br />
For the uninitiated there are four ways to create a ClickOnce deploy package:<br />
  
<br /><ol><li>
Via the Window app's Publish property page in Visual Studio (easiest but essentially
unuseable for apps of even moderate complexity for the reasons listed above). 
</li><li>
Via <a href="http://msdn2.microsoft.com/en-us/library/xc3tc5xx.aspx">mage.exe</a> (command-line
utility). 
</li><li>
Via <a href="http://msdn2.microsoft.com/en-us/library/xc3tc5xx.aspx">mageui.exe</a> (Windows
app). 
</li><li>
Via MSBuild (using the <a href="http://msdn2.microsoft.com/en-us/library/6wc2ccdc.aspx"><i>GenerateApplicationManifest</i></a>, <a href="http://msdn2.microsoft.com/en-us/library/3k2t34e7%28VS.80%29.aspx"><i>GenerateDeploymentManifest</i></a>, <i><a href="http://msdn2.microsoft.com/en-us/library/ms164294%28VS.80%29.aspx">GenerateBootstrapper</a></i>and <a href="http://msdn2.microsoft.com/en-us/library/ms164304%28VS.80%29.aspx"><i>SignFile</i></a> tasks).<br /></li></ol><p><br />
Note that despite the chosen method, everything eventually calls the MSBuild tasks.
So, for the cleanest solution you should just cut straight to the chase and call the
MSBuild tasks, right? Ah, but here's the rub -- you have to determine what your application
manifest is and feed this list to the <i>GenerateApplicationManifest </i>task via
an <a href="http://msdn2.microsoft.com/en-us/library/ms171453.aspx"><i>ItemGroup</i></a>.
You really don't want to have this fixed list that you have to maintain but rather
have the application manifest dynamically generated for you. <i><b>This is the real
value of mage.exe which you can point to a directory and it will build-up the app
manifest for you.</b></i> Where mage is less than useful is generating the deployment
manifest but you can just use the MSBuild task to do this instead. 
<br />
    <br />
This sample demonstrates how to use mage.exe in conjunction with the ClickOnce MSBuild
tasks to resolve the deficiencies with the Visual Studio approach.  The sample
consists of a simple Windows app which displays a value stored externally in the application's
App.config file.  Note that in this sample there are three versions of this file
(stored under the Config directory) -- a "development" version, a "qa" (i.e. test)
version, and a "production" version.  They are structurally identical, the only
varying bits are the values.  There is also a satellite class library that is
late-bound instantiated and invoked when a button is pressed on the app.  There
is no reference to this assembly from the Windows app.<br /><br />
In my shop we run the deploy scripts seperately from the build scripts but you could
easily tack this on to the end of your build process if so desired.  Have fun!
</p><p><a href="http://blog.gatosoft.com/content/binary/ClickOnceDeployTest.zip"><font face="Arial" size="3">Download
Sample</font></a><br /></p><a href="http://blog.gatosoft.com/content/binary/ClickOnceDeployTest.zip"></a><img width="0" height="0" src="http://blog.gatosoft.com/aggbug.ashx?id=d0a0dd1e-c9ac-4fa9-a408-615454d49702" /></body>
      <title>Taking the ClickPain out of ClickOnce</title>
      <guid isPermaLink="false">http://blog.gatosoft.com/PermaLink,guid,d0a0dd1e-c9ac-4fa9-a408-615454d49702.aspx</guid>
      <link>http://blog.gatosoft.com/2006/04/01/TakingTheClickPainOutOfClickOnce.aspx</link>
      <pubDate>Sat, 01 Apr 2006 08:11:29 GMT</pubDate>
      <description>The &lt;a href="http://msdn2.microsoft.com/en-us/library/t71a733d.aspx"&gt;ClickOnce&lt;/a&gt; support
in Visual Studio 2005 is nice and easy but falls-down in number of areas:&lt;br&gt;
&lt;br&gt;
&lt;ol&gt;
&lt;li&gt;
The application manifest (i.e. the "stuff" that comprises your app) is determined
by walking the project references of your Windows app.&amp;nbsp; What this means is that
if you have deployment artifacts that are non-reference content or late-bound loaded
assemblies then the default ClickOnce mechanism in Visual Studio will &lt;b&gt;not&lt;/b&gt; pick
them up. 
&lt;li&gt;
Oftentimes the versioning scheme for your assemblies is driven by your build process
and ideally you'd want the ClickOnce version number to be in-sync with your assembly
version.&amp;nbsp; The Visual Studio ClickOnce mechanism has a very limited versioning
scheme that is completely decoupled from assembly versioning and is inaccessible outside
of the IDE. 
&lt;li&gt;
For enterpirse scenarios, it is very common to have a segmented network dedicated
for specific functions (e.g. development, test, production).&amp;nbsp; In this scenario
the Windows app has to be designed such that certain information (e.g. connection
strings, web service urls, etc.) are pushed-into environment-specific configuration
files.&amp;nbsp; The deploy process then involves indicating what environment the built
bits should be pushed into and then the appropriate configuration files are pulled-in
by the deploy process.&amp;nbsp; In this way the same set of bits may be "promoted" from
dev to test and finally to production.&amp;nbsp; The default Visual Studio ClickOnce mechanism
has no notion of nor capability of dealing with environment-specific information.&lt;br&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;br&gt;
For the uninitiated there are four ways to create a ClickOnce deploy package:&lt;br&gt;
&amp;nbsp; 
&lt;br&gt;
&lt;ol&gt;
&lt;li&gt;
Via the Window app's Publish property page in Visual Studio (easiest but essentially
unuseable for apps of even moderate complexity for the reasons listed above). 
&lt;li&gt;
Via &lt;a href="http://msdn2.microsoft.com/en-us/library/xc3tc5xx.aspx"&gt;mage.exe&lt;/a&gt; (command-line
utility). 
&lt;li&gt;
Via &lt;a href="http://msdn2.microsoft.com/en-us/library/xc3tc5xx.aspx"&gt;mageui.exe&lt;/a&gt; (Windows
app). 
&lt;li&gt;
Via MSBuild (using the &lt;a href="http://msdn2.microsoft.com/en-us/library/6wc2ccdc.aspx"&gt;&lt;i&gt;GenerateApplicationManifest&lt;/i&gt;&lt;/a&gt;, &lt;a href="http://msdn2.microsoft.com/en-us/library/3k2t34e7%28VS.80%29.aspx"&gt;&lt;i&gt;GenerateDeploymentManifest&lt;/i&gt;&lt;/a&gt;, &lt;i&gt;&lt;a href="http://msdn2.microsoft.com/en-us/library/ms164294%28VS.80%29.aspx"&gt;GenerateBootstrapper&lt;/a&gt; &lt;/i&gt;and &lt;a href="http://msdn2.microsoft.com/en-us/library/ms164304%28VS.80%29.aspx"&gt;&lt;i&gt;SignFile&lt;/i&gt;&lt;/a&gt; tasks).&lt;br&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
&lt;br&gt;
Note that despite the chosen method, everything eventually calls the MSBuild tasks.
So, for the cleanest solution you should just cut straight to the chase and call the
MSBuild tasks, right? Ah, but here's the rub -- you have to determine what your application
manifest is and feed this list to the &lt;i&gt;GenerateApplicationManifest &lt;/i&gt;task via
an &lt;a href="http://msdn2.microsoft.com/en-us/library/ms171453.aspx"&gt;&lt;i&gt;ItemGroup&lt;/i&gt;&lt;/a&gt;.
You really don't want to have this fixed list that you have to maintain but rather
have the application manifest dynamically generated for you. &lt;i&gt;&lt;b&gt;This is the real
value of mage.exe which you can point to a directory and it will build-up the app
manifest for you.&lt;/b&gt;&lt;/i&gt; Where mage is less than useful is generating the deployment
manifest but you can just use the MSBuild task to do this instead. 
&lt;br&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;br&gt;
This sample demonstrates how to use mage.exe in conjunction with the ClickOnce MSBuild
tasks to resolve the deficiencies with the Visual Studio approach.&amp;nbsp; The sample
consists of a simple Windows app which displays a value stored externally in the application's
App.config file.&amp;nbsp; Note that in this sample there are three versions of this file
(stored under the Config directory) -- a "development" version, a "qa" (i.e. test)
version, and a "production" version.&amp;nbsp; They are structurally identical, the only
varying bits are the values.&amp;nbsp; There is also a satellite class library that is
late-bound instantiated and invoked when a button is pressed on the app.&amp;nbsp; There
is no reference to this assembly from the Windows app.&lt;br&gt;
&lt;br&gt;
In my shop we run the deploy scripts seperately from the build scripts but you could
easily tack this on to the end of your build process if so desired.&amp;nbsp; Have fun!
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://blog.gatosoft.com/content/binary/ClickOnceDeployTest.zip"&gt;&lt;font face=Arial size=3&gt;Download
Sample&lt;/font&gt;&lt;/a&gt;
&lt;br&gt;
&lt;/p&gt;
&lt;a href="http://blog.gatosoft.com/content/binary/ClickOnceDeployTest.zip"&gt;&lt;/a&gt;&lt;img width="0" height="0" src="http://blog.gatosoft.com/aggbug.ashx?id=d0a0dd1e-c9ac-4fa9-a408-615454d49702" /&gt;</description>
      <comments>http://blog.gatosoft.com/CommentView,guid,d0a0dd1e-c9ac-4fa9-a408-615454d49702.aspx</comments>
      <category>ClickOnce</category>
      <category>Code</category>
    </item>
    <item>
      <trackback:ping>http://blog.gatosoft.com/Trackback.aspx?guid=85e0d0d0-ac6d-4afa-a43f-40f4ed784a45</trackback:ping>
      <pingback:server>http://blog.gatosoft.com/pingback.aspx</pingback:server>
      <pingback:target>http://blog.gatosoft.com/PermaLink,guid,85e0d0d0-ac6d-4afa-a43f-40f4ed784a45.aspx</pingback:target>
      <dc:creator>Mike Bouck</dc:creator>
      <georss:point>33.13111 -117.226157</georss:point>
      <wfw:comment>http://blog.gatosoft.com/CommentView,guid,85e0d0d0-ac6d-4afa-a43f-40f4ed784a45.aspx</wfw:comment>
      <wfw:commentRss>http://blog.gatosoft.com/SyndicationService.asmx/GetEntryCommentsRss?guid=85e0d0d0-ac6d-4afa-a43f-40f4ed784a45</wfw:commentRss>
      <slash:comments>1</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <div class="Section1">
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma">I’m using a number of <a href="http://msdn.microsoft.com/library/en-us/cpref/html/frlrfsystemwebservicesprotocolssoapextensionclasstopic.asp">SoapExtension</a>s
in my current project and had a need to register them dynamically on the client side;
Christian Weyer blogged about a <a href="http://weblogs.asp.net/cweyer/archive/2003/08/07/22929.aspx">solution</a> using
reflection which injects the extension into the in-memory config.  This works
great for .NET 1.x, but I’m all over .NET 2.0 code these days!  Unfortunately,
dynamically registering SoapExtensions gets no easier in 2.0, but fortunately hacking
the in-memory config does:</span>
          </p>
          <span style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma">
            <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">///
&lt;summary&gt;</span>
                <br />
                <span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">///
Programatically registers a &lt;see cref="SoapExtension"/&gt; at runtime with the
specified</span>
                <br />
                <span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">///
&lt;see cref="SoapExtensionTypeElement.Priority"/&gt; and &lt;see cref="SoapExtensionTypeElement.Group"/&gt;
settings.</span>
                <br />
                <span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">///
&lt;/summary&gt;</span>
                <br />
                <span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">///
&lt;param name="type"&gt;The &lt;see cref="Type"/&gt; of the &lt;see cref="SoapExtension"/&gt;
to register.&lt;/param&gt;</span>
                <br />
                <span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">///
&lt;param name="priority"&gt;</span>
                <br />
                <span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">///
A value that indicates the relative order in which this SOAP extension runs when multiple
SOAP extensions are</span>
                <br />
                <span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">///
specified. Within each group the priority attribute distinguishes the overall relative
priority of the SOAP </span>
                <br />
                <span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">///
extension. A lower priority number indicates a higher priority for the SOAP extension.
The lowest possible </span>
                <br />
                <span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">///
value for the priority attribute is 1.</span>
                <br />
                <span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">///
&lt;/param&gt;</span>
                <br />
                <span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">///
&lt;param name="group"&gt;</span>
                <br />
                <span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">///
The relative priority group (e.g. Low or High) in which this SOAP extension runs when
multiple SOAP extensions </span>
                <br />
                <span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">///
are configured to run.</span>
                <br />
                <span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">///
&lt;/param&gt;</span>
                <br />
[ReflectionPermission(SecurityAction.Demand, Unrestricted <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">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">void</span> RegisterSoapExtension(Type
type, <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">int</span> priority,
PriorityGroup group)<br />
{<br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">   if</span> (!type.IsSubclassOf(<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">typeof</span>(SoapExtension)))<br />
   {<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> ArgumentException(<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"Type
must be derived from SoapException."</span>, <span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"type"</span>);<br />
   }<br /><br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">   if</span> (priority
&lt; 1)<br />
   {<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> ArgumentOutOfRangeException(<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"priority"</span>,
priority, <span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"Priority
must be greater or equal to 1."</span>);<br />
   }<br /><br /><span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">   //
get the current web services settings...</span><br />
   WebServicesSection wss <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span> WebServicesSection.Current;<br /><br /><span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">   //
set SoapExtensionTypes collection to read/write...</span><br />
   FieldInfo readOnlyField <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">typeof</span>(System.Configuration.ConfigurationElementCollection).GetField(<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"bReadOnly"</span>,
BindingFlags.NonPublic <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">|</span> BindingFlags.Instance);<br />
   readOnlyField.SetValue(wss.SoapExtensionTypes, <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">false</span>);<br /><br /><span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">   //
inject SoapExtension...</span><br />
   wss.SoapExtensionTypes.Add(<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">new</span> SoapExtensionTypeElement(type,
priority, group));<br /><br /><span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">   //
set SoapExtensionTypes collection back to readonly and clear modified flags...</span><br />
   MethodInfo resetModifiedMethod <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">typeof</span>(System.Configuration.ConfigurationElement).GetMethod(<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"ResetModified"</span>,
BindingFlags.NonPublic <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">|</span> BindingFlags.Instance);<br />
   resetModifiedMethod.Invoke(wss.SoapExtensionTypes, <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">null</span>);<br />
   MethodInfo setReadOnlyMethod <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">typeof</span>(System.Configuration.ConfigurationElement).GetMethod(<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"SetReadOnly"</span>,
BindingFlags.NonPublic <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">|</span> BindingFlags.Instance);<br />
   setReadOnlyMethod.Invoke(wss.SoapExtensionTypes, <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">null</span>);<br />
}</span>
            </p>
          </span>
        </div>
        <img width="0" height="0" src="http://blog.gatosoft.com/aggbug.ashx?id=85e0d0d0-ac6d-4afa-a43f-40f4ed784a45" />
      </body>
      <title>Programatically Registering SoapExtensions Redux</title>
      <guid isPermaLink="false">http://blog.gatosoft.com/PermaLink,guid,85e0d0d0-ac6d-4afa-a43f-40f4ed784a45.aspx</guid>
      <link>http://blog.gatosoft.com/2005/07/31/ProgramaticallyRegisteringSoapExtensionsRedux.aspx</link>
      <pubDate>Sun, 31 Jul 2005 20:10:42 GMT</pubDate>
      <description>&lt;div class=Section1&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma"&gt;I’m using a number of &lt;a href="http://msdn.microsoft.com/library/en-us/cpref/html/frlrfsystemwebservicesprotocolssoapextensionclasstopic.asp"&gt;SoapExtension&lt;/a&gt;s
in my current project and had a need to register them dynamically on the client side;
Christian Weyer blogged about a &lt;a href="http://weblogs.asp.net/cweyer/archive/2003/08/07/22929.aspx"&gt;solution&lt;/a&gt; using
reflection which injects the extension into the in-memory config. &amp;nbsp;This works
great for .NET 1.x, but I’m all over .NET 2.0 code these days! &amp;nbsp;Unfortunately,
dynamically registering SoapExtensions gets no easier in 2.0, but fortunately hacking
the in-memory config does:&lt;/span&gt;
&lt;/p&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma"&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;///
&amp;lt;summary&amp;gt;&lt;/span&gt;
&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;///
Programatically registers a &amp;lt;see cref="SoapExtension"/&amp;gt; at runtime with the
specified&lt;/span&gt;
&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;///
&amp;lt;see cref="SoapExtensionTypeElement.Priority"/&amp;gt; and &amp;lt;see cref="SoapExtensionTypeElement.Group"/&amp;gt;
settings.&lt;/span&gt;
&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;///
&amp;lt;/summary&amp;gt;&lt;/span&gt;
&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;///
&amp;lt;param name="type"&amp;gt;The &amp;lt;see cref="Type"/&amp;gt; of the &amp;lt;see cref="SoapExtension"/&amp;gt;
to register.&amp;lt;/param&amp;gt;&lt;/span&gt;
&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;///
&amp;lt;param name="priority"&amp;gt;&lt;/span&gt;
&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;///
A value that indicates the relative order in which this SOAP extension runs when multiple
SOAP extensions are&lt;/span&gt;
&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;///
specified. Within each group the priority attribute distinguishes the overall relative
priority of the SOAP &lt;/span&gt;
&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;///
extension. A lower priority number indicates a higher priority for the SOAP extension.
The lowest possible &lt;/span&gt;
&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;///
value for the priority attribute is 1.&lt;/span&gt;
&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;///
&amp;lt;/param&amp;gt;&lt;/span&gt;
&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;///
&amp;lt;param name="group"&amp;gt;&lt;/span&gt;
&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;///
The relative priority group (e.g. Low or High) in which this SOAP extension runs when
multiple SOAP extensions &lt;/span&gt;
&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;///
are configured to run.&lt;/span&gt;
&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;///
&amp;lt;/param&amp;gt;&lt;/span&gt;
&lt;br&gt;
[ReflectionPermission(SecurityAction.Demand, Unrestricted &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;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;void&lt;/span&gt; RegisterSoapExtension(Type
type, &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;int&lt;/span&gt; priority,
PriorityGroup group)&lt;br&gt;
{&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;if&lt;/span&gt; (!type.IsSubclassOf(&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;typeof&lt;/span&gt;(SoapExtension)))&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;throw&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;new&lt;/span&gt; ArgumentException(&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"Type
must be derived from SoapException."&lt;/span&gt;, &lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"type"&lt;/span&gt;);&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br&gt;
&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;if&lt;/span&gt; (priority
&amp;lt; 1)&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;throw&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;new&lt;/span&gt; ArgumentOutOfRangeException(&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"priority"&lt;/span&gt;,
priority, &lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"Priority
must be greater or equal to 1."&lt;/span&gt;);&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br&gt;
&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;//
get the current web services settings...&lt;/span&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;WebServicesSection wss &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; WebServicesSection.Current;&lt;br&gt;
&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;//
set SoapExtensionTypes collection to read/write...&lt;/span&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;FieldInfo readOnlyField &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;typeof&lt;/span&gt;(System.Configuration.ConfigurationElementCollection).GetField(&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"bReadOnly"&lt;/span&gt;,
BindingFlags.NonPublic &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;|&lt;/span&gt; BindingFlags.Instance);&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;readOnlyField.SetValue(wss.SoapExtensionTypes, &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;false&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;//
inject SoapExtension...&lt;/span&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;wss.SoapExtensionTypes.Add(&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;new&lt;/span&gt; SoapExtensionTypeElement(type,
priority, group));&lt;br&gt;
&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;//
set SoapExtensionTypes collection back to readonly and clear modified flags...&lt;/span&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;MethodInfo resetModifiedMethod &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;typeof&lt;/span&gt;(System.Configuration.ConfigurationElement).GetMethod(&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"ResetModified"&lt;/span&gt;,
BindingFlags.NonPublic &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;|&lt;/span&gt; BindingFlags.Instance);&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;resetModifiedMethod.Invoke(wss.SoapExtensionTypes, &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;null&lt;/span&gt;);&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;MethodInfo setReadOnlyMethod &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;typeof&lt;/span&gt;(System.Configuration.ConfigurationElement).GetMethod(&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"SetReadOnly"&lt;/span&gt;,
BindingFlags.NonPublic &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;|&lt;/span&gt; BindingFlags.Instance);&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;setReadOnlyMethod.Invoke(wss.SoapExtensionTypes, &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&gt;
&lt;/p&gt;
&lt;/span&gt;
&lt;/div&gt;
&lt;img width="0" height="0" src="http://blog.gatosoft.com/aggbug.ashx?id=85e0d0d0-ac6d-4afa-a43f-40f4ed784a45" /&gt;</description>
      <comments>http://blog.gatosoft.com/CommentView,guid,85e0d0d0-ac6d-4afa-a43f-40f4ed784a45.aspx</comments>
      <category>Code</category>
    </item>
    <item>
      <trackback:ping>http://blog.gatosoft.com/Trackback.aspx?guid=8f40858f-a670-4ccf-a413-ab9954320b25</trackback:ping>
      <pingback:server>http://blog.gatosoft.com/pingback.aspx</pingback:server>
      <pingback:target>http://blog.gatosoft.com/PermaLink,guid,8f40858f-a670-4ccf-a413-ab9954320b25.aspx</pingback:target>
      <dc:creator>Mike Bouck</dc:creator>
      <georss:point>33.13111 -117.226157</georss:point>
      <wfw:comment>http://blog.gatosoft.com/CommentView,guid,8f40858f-a670-4ccf-a413-ab9954320b25.aspx</wfw:comment>
      <wfw:commentRss>http://blog.gatosoft.com/SyndicationService.asmx/GetEntryCommentsRss?guid=8f40858f-a670-4ccf-a413-ab9954320b25</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
          <span id="SampleInfoControl_LabelDescription">
            <font face="Arial">
              <font color="#000000">There
is a fundamental problem with <em>System.Web.Caching.Cache</em> -- what if your application
is not a web application and you need some general-purpose cache functionality (e.g.
middle-tier logic)? Since there is no equivilent "System.Caching.Cache" class I decided
to write one</font>
              <font color="#000000"> using weak references that has
no dependency on <em>System.Web.dll</em>.</font>
            </font>
          </span>
        </p>
        <a href="http://blog.gatosoft.com/content/binary/Cache.zip">Download Source (4.76
KB)</a>
        <img width="0" height="0" src="http://blog.gatosoft.com/aggbug.ashx?id=8f40858f-a670-4ccf-a413-ab9954320b25" />
      </body>
      <title>WeakReference Cache</title>
      <guid isPermaLink="false">http://blog.gatosoft.com/PermaLink,guid,8f40858f-a670-4ccf-a413-ab9954320b25.aspx</guid>
      <link>http://blog.gatosoft.com/2005/05/02/WeakReferenceCache.aspx</link>
      <pubDate>Mon, 02 May 2005 16:12:59 GMT</pubDate>
      <description>&lt;p&gt;
&lt;span id=SampleInfoControl_LabelDescription&gt;&lt;font face=Arial&gt;&lt;font color=#000000&gt;There
is a fundamental problem with &lt;em&gt;System.Web.Caching.Cache&lt;/em&gt; -- what if your application
is not a web application and you need some general-purpose cache functionality (e.g.
middle-tier logic)? Since there is no equivilent "System.Caching.Cache" class I decided
to&amp;nbsp;write one&lt;/font&gt;&lt;font color=#000000&gt;&amp;nbsp;using weak references that has no
dependency on &lt;em&gt;System.Web.dll&lt;/em&gt;.&lt;/font&gt;&lt;/font&gt;&lt;/span&gt; 
&lt;/p&gt;
&lt;a href="http://blog.gatosoft.com/content/binary/Cache.zip"&gt;Download&amp;nbsp;Source&amp;nbsp;(4.76
KB)&lt;/a&gt;&lt;img width="0" height="0" src="http://blog.gatosoft.com/aggbug.ashx?id=8f40858f-a670-4ccf-a413-ab9954320b25" /&gt;</description>
      <comments>http://blog.gatosoft.com/CommentView,guid,8f40858f-a670-4ccf-a413-ab9954320b25.aspx</comments>
      <category>Code</category>
    </item>
    <item>
      <trackback:ping>http://blog.gatosoft.com/Trackback.aspx?guid=4891f8ba-47af-4bbe-a52b-80dfb22a452e</trackback:ping>
      <pingback:server>http://blog.gatosoft.com/pingback.aspx</pingback:server>
      <pingback:target>http://blog.gatosoft.com/PermaLink,guid,4891f8ba-47af-4bbe-a52b-80dfb22a452e.aspx</pingback:target>
      <dc:creator>Mike Bouck</dc:creator>
      <georss:point>33.13111 -117.226157</georss:point>
      <wfw:comment>http://blog.gatosoft.com/CommentView,guid,4891f8ba-47af-4bbe-a52b-80dfb22a452e.aspx</wfw:comment>
      <wfw:commentRss>http://blog.gatosoft.com/SyndicationService.asmx/GetEntryCommentsRss?guid=4891f8ba-47af-4bbe-a52b-80dfb22a452e</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
          <!--StartFragment -->
          <span id="SampleInfoControl_LabelDescription">
            <font face="Arial">Contains
several useful classes that fill-in some holes with the current BCL Queued Components
(QC) implementation. Functionality includes automatic queue moniker construction,
QC session management (both synchronous and asynchronous), a QC exception handler
base class, a QC custom config section handler, a managed wrapper class for the COM+ <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cossdk/html/fd455679-b2b3-487f-8494-9ea296ce2c89.asp">Message
Mover</a> object, and an object wrapper to marshal .NET serializable types in queued
interface calls. Full source code, documentation and samples are provided.</font>
          </span>
        </p>
        <p>
          <a href="http://blog.gatosoft.com/content/binary/QCUtils.zip">Download Source (139.75
KB)</a>
        </p>
        <img width="0" height="0" src="http://blog.gatosoft.com/aggbug.ashx?id=4891f8ba-47af-4bbe-a52b-80dfb22a452e" />
      </body>
      <title>GDN Queued Component Utilities</title>
      <guid isPermaLink="false">http://blog.gatosoft.com/PermaLink,guid,4891f8ba-47af-4bbe-a52b-80dfb22a452e.aspx</guid>
      <link>http://blog.gatosoft.com/2005/05/02/GDNQueuedComponentUtilities.aspx</link>
      <pubDate>Mon, 02 May 2005 16:06:51 GMT</pubDate>
      <description>&lt;p&gt;
&lt;!--StartFragment --&gt;&lt;span id=SampleInfoControl_LabelDescription&gt;&lt;font face=Arial&gt;Contains
several useful classes that fill-in some holes with the current BCL Queued Components
(QC) implementation. Functionality includes automatic queue moniker construction,
QC session management (both synchronous and asynchronous), a QC exception handler
base class, a QC custom config section handler, a managed wrapper class for the COM+ &lt;a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cossdk/html/fd455679-b2b3-487f-8494-9ea296ce2c89.asp"&gt;Message
Mover&lt;/a&gt; object, and an object wrapper to marshal .NET serializable types in queued
interface calls. Full source code, documentation and samples are provided.&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://blog.gatosoft.com/content/binary/QCUtils.zip"&gt;Download Source&amp;nbsp;(139.75
KB)&lt;/a&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://blog.gatosoft.com/aggbug.ashx?id=4891f8ba-47af-4bbe-a52b-80dfb22a452e" /&gt;</description>
      <comments>http://blog.gatosoft.com/CommentView,guid,4891f8ba-47af-4bbe-a52b-80dfb22a452e.aspx</comments>
      <category>Code</category>
    </item>
    <item>
      <trackback:ping>http://blog.gatosoft.com/Trackback.aspx?guid=d296c5d9-4a75-4dd3-92e2-abd2c82810e3</trackback:ping>
      <pingback:server>http://blog.gatosoft.com/pingback.aspx</pingback:server>
      <pingback:target>http://blog.gatosoft.com/PermaLink,guid,d296c5d9-4a75-4dd3-92e2-abd2c82810e3.aspx</pingback:target>
      <dc:creator>Mike Bouck</dc:creator>
      <georss:point>33.13111 -117.226157</georss:point>
      <wfw:comment>http://blog.gatosoft.com/CommentView,guid,d296c5d9-4a75-4dd3-92e2-abd2c82810e3.aspx</wfw:comment>
      <wfw:commentRss>http://blog.gatosoft.com/SyndicationService.asmx/GetEntryCommentsRss?guid=d296c5d9-4a75-4dd3-92e2-abd2c82810e3</wfw:commentRss>
      <slash:comments>1</slash:comments>
      <title>XML Visualizer for Visual Studio .NET 2003 (XMLVIZ)</title>
      <guid isPermaLink="false">http://blog.gatosoft.com/PermaLink,guid,d296c5d9-4a75-4dd3-92e2-abd2c82810e3.aspx</guid>
      <link>http://blog.gatosoft.com/2005/05/02/XMLVisualizerForVisualStudioNET2003XMLVIZ.aspx</link>
      <pubDate>Mon, 02 May 2005 04:56:15 GMT</pubDate>
      <description>&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-pagination: none; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 8pt; FONT-FAMILY: Arial"&gt;&lt;font color=#000000&gt;I was intrigued,
as many were, with &lt;a href="http://www.codeproject.com/csharp/DSWatch.asp"&gt;Mohammed
Barqawi's DataSet QwickWatch&lt;/a&gt; add-in&lt;/font&gt;&lt;/span&gt;&lt;span style="FONT-SIZE: 8pt; FONT-FAMILY: Arial"&gt;&lt;font color=#000000&gt; over
on &lt;a href="http://www.codeproject.com/"&gt;The Code Project&lt;/a&gt;.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;The &lt;/font&gt;&lt;/span&gt;&lt;span style="FONT-SIZE: 8pt; FONT-FAMILY: Arial"&gt;&lt;font color=#000000&gt;thought
of leveraging the expression evaluator to populate a form for visualization &lt;/font&gt;&lt;/span&gt;&lt;span style="FONT-SIZE: 8pt; FONT-FAMILY: Arial"&gt;&lt;font color=#000000&gt;purposes
during a debugging session was compelling and, over the holidays, I &lt;/font&gt;&lt;/span&gt;&lt;span style="FONT-SIZE: 8pt; FONT-FAMILY: Arial"&gt;&lt;font color=#000000&gt;decided
to see how far I could take the idea.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;As
it turns-out, it is actually &lt;/font&gt;&lt;/span&gt;&lt;span style="FONT-SIZE: 8pt; FONT-FAMILY: Arial"&gt;&lt;font color=#000000&gt;quite
amazing how much you can do with strings and an &lt;font face="Courier New"&gt;AppDomain.CurrentDomain.Load()&lt;/font&gt; &lt;/font&gt;&lt;/span&gt;&lt;span style="FONT-SIZE: 8pt; FONT-FAMILY: Arial"&gt;&lt;font color=#000000&gt;call!&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;Once
I had this nut cracked, everything else fell-together pretty quickly &lt;/font&gt;&lt;/span&gt;&lt;span style="FONT-SIZE: 8pt; FONT-FAMILY: Arial"&gt;&lt;font color=#000000&gt;and
after a few weeks of furious coding and a small round of beta testing, I &lt;/font&gt;&lt;/span&gt;&lt;span style="FONT-SIZE: 8pt; FONT-FAMILY: Arial"&gt;&lt;font color=#000000&gt;decided
to release the XML Visualizer for Visual Studio .NET 2003 (XMLVIZ) to a (much!) &lt;/font&gt;&lt;/span&gt;&lt;span style="FONT-SIZE: 8pt; FONT-FAMILY: Arial"&gt;&lt;font color=#000000&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;larger
audience.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-pagination: none; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 8pt; FONT-FAMILY: Arial"&gt;
&lt;o:p&gt;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-pagination: none; mso-layout-grid-align: none"&gt;
&lt;font color=#000000&gt;&lt;b&gt;&lt;span style="FONT-SIZE: 8pt; FONT-FAMILY: Arial"&gt;WHAT DOES
XMLVIZ DO?&lt;/span&gt;&lt;/b&gt;&lt;span style="FONT-SIZE: 8pt; FONT-FAMILY: Arial"&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-pagination: none; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 8pt; FONT-FAMILY: Arial"&gt;&lt;font color=#000000&gt;Basically, XMLVIZ
allows you to visualize most XML and XML-backed data sources during &lt;/font&gt;&lt;/span&gt;&lt;span style="FONT-SIZE: 8pt; FONT-FAMILY: Arial"&gt;&lt;font color=#000000&gt;runtime
a la &lt;a href="http://msdn.microsoft.com/vcsharp/default.aspx?pull=/library/en-us/dnvs05/html/SimpleVisualizerCreation.asp"&gt;Whidbey's
"debugger visualizers"&lt;/a&gt;.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;The difference
is you don't have to wait &lt;/font&gt;&lt;/span&gt;&lt;span style="FONT-SIZE: 8pt; FONT-FAMILY: Arial"&gt;&lt;font color=#000000&gt;for
VS.NET 2005 because XMLVIZ will work with your copy of VS.NET 2003 today!&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;XMLVIZ &lt;/font&gt;&lt;/span&gt;&lt;span style="FONT-SIZE: 8pt; FONT-FAMILY: Arial"&gt;&lt;font color=#000000&gt;is
implemented as a VS.NET add-in and, once installed, is activated by highlighting &lt;/font&gt;&lt;/span&gt;&lt;span style="FONT-SIZE: 8pt; FONT-FAMILY: Arial"&gt;&lt;font color=#000000&gt;any
supported, initialized type instance during a debugging session, right-clicking on &lt;/font&gt;&lt;/span&gt;&lt;span style="FONT-SIZE: 8pt; FONT-FAMILY: Arial"&gt;&lt;font color=#000000&gt;the
selection to bring-up the context menu, and selecting the "XML Visualizer" menu item.&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="FONT-SIZE: 8pt; FONT-FAMILY: Arial"&gt;&lt;font color=#000000&gt;The
add-in will then grab the XML out of the selected target instance and display it on &lt;/font&gt;&lt;/span&gt;&lt;span style="FONT-SIZE: 8pt; FONT-FAMILY: Arial"&gt;&lt;font color=#000000&gt;a
modal dialog along with the schema (if available).&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;For
ADO.NET types, the data is &lt;/font&gt;&lt;/span&gt;&lt;span style="FONT-SIZE: 8pt; FONT-FAMILY: Arial"&gt;&lt;font color=#000000&gt;also
bound to a grid to allow navigation, row-filtering, and row version inspection. &lt;/font&gt;&lt;/span&gt;&lt;span style="FONT-SIZE: 8pt; FONT-FAMILY: Arial"&gt;
&lt;o:p&gt;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-pagination: none; mso-layout-grid-align: none"&gt;
&lt;font color=#000000&gt;&lt;b&gt;&lt;span style="FONT-SIZE: 8pt; FONT-FAMILY: Arial"&gt;&lt;/span&gt;&lt;/b&gt;&lt;/font&gt;&amp;nbsp;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-pagination: none; mso-layout-grid-align: none"&gt;
&lt;font color=#000000&gt;&lt;b&gt;&lt;span style="FONT-SIZE: 8pt; FONT-FAMILY: Arial"&gt;WHAT TYPES
CAN I VISUALIZE?&lt;/span&gt;&lt;/b&gt;&lt;span style="FONT-SIZE: 8pt; FONT-FAMILY: Arial"&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-pagination: none; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 8pt; FONT-FAMILY: Arial"&gt;&lt;font color=#000000&gt;Currenly XMLVIZ
supports the following types (including derived types thereof):&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-pagination: none; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 8pt; FONT-FAMILY: Arial"&gt;
&lt;o:p&gt;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-pagination: none; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 8pt; FONT-FAMILY: Arial"&gt;&lt;font color=#000000&gt;DataSet,&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-pagination: none; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 8pt; FONT-FAMILY: Arial"&gt;&lt;font color=#000000&gt;DataTable (including
detached tables), 
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-pagination: none; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 8pt; FONT-FAMILY: Arial"&gt;&lt;font color=#000000&gt;DataRow/DataRow[]/DataRowCollection
(attached rows only), 
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-pagination: none; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 8pt; FONT-FAMILY: Arial"&gt;&lt;font color=#000000&gt;DataView (including
DataViews over detached tables), 
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-pagination: none; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 8pt; FONT-FAMILY: Arial"&gt;&lt;font color=#000000&gt;DataRowView/DataRowView[]
(attached rows only), 
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-pagination: none; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 8pt; FONT-FAMILY: Arial"&gt;&lt;font color=#000000&gt;DataViewManager, 
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-pagination: none; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 8pt; FONT-FAMILY: Arial"&gt;&lt;font color=#000000&gt;Exception,&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-pagination: none; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 8pt; FONT-FAMILY: Arial"&gt;&lt;font color=#000000&gt;XPathNavigator, 
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-pagination: none; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 8pt; FONT-FAMILY: Arial"&gt;&lt;font color=#000000&gt;types implementing
IXPathNavigable,&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-pagination: none; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 8pt; FONT-FAMILY: Arial"&gt;&lt;font color=#000000&gt;well-formed XML
in strings,&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-pagination: none; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 8pt; FONT-FAMILY: Arial"&gt;&lt;font color=#000000&gt;any XML-serializable
type&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-pagination: none; mso-layout-grid-align: none"&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-pagination: none; mso-layout-grid-align: none"&gt;
&lt;font face=Arial size=3&gt;&lt;a href="http://blog.gatosoft.com/content/binary/XmlVisualizerSource1000.zip"&gt;Download
Source&lt;/a&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-pagination: none; mso-layout-grid-align: none"&gt;
&lt;font face=Arial size=3&gt;&lt;a href="http://blog.gatosoft.com/content/binary/XmlVisualizerSetup1000.zip"&gt;Download
Setup&lt;/a&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://blog.gatosoft.com/aggbug.ashx?id=d296c5d9-4a75-4dd3-92e2-abd2c82810e3" /&gt;</description>
      <comments>http://blog.gatosoft.com/CommentView,guid,d296c5d9-4a75-4dd3-92e2-abd2c82810e3.aspx</comments>
      <category>Code</category>
    </item>
  </channel>
</rss>