<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="https://www.w3.org/2005/Atom" xmlns:sy="https://purl.org/rss/1.0/modules/syndication/" xmlns:dc="https://purl.org/dc/elements/1.1/" xmlns:content="https://purl.org/rss/1.0/modules/content/" xmlns:wfw="https://wellformedweb.org/CommentAPI/" xmlns:slash="https://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>Gilles' WebLog</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/gzunino/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/gzunino/feed.xml</link>
    <description>Not actually a Blog</description>
    <lastBuildDate>Tue, 16 Apr 2019 05:10:24 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>WF 4.0 Tracking on .NET Endpoint</title>
      <link>https://docs.microsoft.com/archive/blogs/gzunino/wf-4-0-tracking-on-net-endpoint</link>
      <pubDate>Thu, 11 Jun 2009 21:05:00 GMT</pubDate>
      <dc:creator><![CDATA[Gilles Zunino]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/gzunino/2009/06/11/wf-4-0-tracking-on-net-endpoint/</guid>
      <description><![CDATA[Vikram has a very nice acticle on tracking in WF 4.0. Worth reading it at:...]]></description>
      <content:encoded><![CDATA[Vikram has a very nice acticle on tracking in WF 4.0. Worth reading it at: <A href="https://blogs.msdn.com/endpoint/archive/2009/06/11/introduction-to-workflow-tracking-in-net-framework-4-0-beta1.aspx">https://blogs.msdn.com/endpoint/archive/2009/06/11/introduction-to-workflow-tracking-in-net-framework-4-0-beta1.aspx</A>.]]></content:encoded>
    </item>
    <item>
      <title>The J-POP saga continues: SweetS - Love Like Candy Floss</title>
      <link>https://docs.microsoft.com/archive/blogs/gzunino/the-j-pop-saga-continues-sweets-love-like-candy-floss</link>
      <pubDate>Thu, 15 Nov 2007 23:47:00 GMT</pubDate>
      <dc:creator><![CDATA[Gilles Zunino]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/gzunino/2007/11/15/the-j-pop-saga-continues-sweets-love-like-candy-floss/</guid>
      <description><![CDATA[In the past, I have outlined some of the most famous J-POP artists: EXILE&nbsp;or&nbsp;DREAM. Today,...]]></description>
      <content:encoded><![CDATA[<DIV>In the past, I have outlined some of the most famous J-POP artists: <A class="" href="https://blogs.msdn.com/gzunino/archive/2004/06/29/169035.aspx" mce_href="https://blogs.msdn.com/gzunino/archive/2004/06/29/169035.aspx">EXILE</A>&nbsp;or&nbsp;<A class="" href="https://blogs.msdn.com/gzunino/archive/2004/06/25/166233.aspx" mce_href="https://blogs.msdn.com/gzunino/archive/2004/06/25/166233.aspx">DREAM</A>. Today, let me introduce the (now defunct) Japanese band SweetS (<A class="" href="https://www.avexnet.or.jp/sweets/index.html" mce_href="https://www.avexnet.or.jp/sweets/index.html">official web site</A> in Japanese). Formed in 2003, the group experienced minor success before disbanding in 2006.</DIV>
<DIV>&nbsp;</DIV>
<DIV>Avex Track, a famous production company in Japan held auditions and selected five girls out of their pool of potential talents. After about&nbsp;a year of training, SweetS was born. Sadly, they failed to meet the success they expected. One of their singles "Love like candy floss" (February 2004) best illustrate their style. The video below&nbsp;has all the caracteristics you would expect from J-POP productions: dance moves choregraphed within 1/16 of an inch, perfect synchronization and ... the never ending story of a girl in love with a boy.</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<CENTER>
<DIV>
<OBJECT height=335 width=425><PARAM NAME="movie" VALUE="https://www.dailymotion.com/swf/2wNpxgZQZXVZAlSUC"><PARAM NAME="allowFullScreen" VALUE="true"><PARAM NAME="allowScriptAccess" VALUE="always">
<embed src="https://www.dailymotion.com/swf/2wNpxgZQZXVZAlSUC" mce_src="https://www.dailymotion.com/swf/2wNpxgZQZXVZAlSUC" type="application/x-shockwave-flash" width="425" height="335" allowFullScreen="true" allowScriptAccess="always"></embed></OBJECT><BR><B><A href="https://www.dailymotion.com/video/x33so6_love-like-candy-floss-sweets_music" mce_href="https://www.dailymotion.com/video/x33so6_love-like-candy-floss-sweets_music">Love like candy floss - SweetS</A></B><BR><I>Uploaded by <A href="https://www.dailymotion.com/Xo_Aerisu_oX" mce_href="https://www.dailymotion.com/Xo_Aerisu_oX">Xo_Aerisu_oX</A></I></DIV></CENTER>]]></content:encoded>
    </item>
    <item>
      <title>Hosting a WCF service in Windows Sharepoint Services v3.0</title>
      <link>https://docs.microsoft.com/archive/blogs/gzunino/hosting-a-wcf-service-in-windows-sharepoint-services-v3-0</link>
      <pubDate>Mon, 17 Sep 2007 19:46:00 GMT</pubDate>
      <dc:creator><![CDATA[Gilles Zunino]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/gzunino/2007/09/17/hosting-a-wcf-service-in-windows-sharepoint-services-v3-0/</guid>
      <description><![CDATA[With ASP.NET AJAX Extensions being baked into the .NET Framework 3.5 and the improvements to WCF to...]]></description>
      <content:encoded><![CDATA[<P>With ASP.NET AJAX Extensions being baked into the .NET Framework 3.5 and the improvements to WCF to support JSON, it seems tempting to write WCF services and host the in Windows Sharepoint Services 3.0</P>
<P>Unfortunately, if you create a WCF service and drop it under a WSS controlled vroot like _layouts or _vti_bin, <A class="" href="https://groups.google.com/group/microsoft.public.sharepoint.windowsservices.development/msg/a77c05c0316e2a88" mce_href="https://groups.google.com/group/microsoft.public.sharepoint.windowsservices.development/msg/a77c05c0316e2a88"><FONT color=#0000cc>your service will fail to activate</FONT></A>&nbsp;with the following message in the event log:</P>
<BLOCKQUOTE><FONT face="courier new,courier">WebHost failed to process a request.</FONT> <BR><FONT face="courier new,courier" color=#cc0000><STRONG>Exception: System.ArgumentException: virtualPath</STRONG></FONT> <BR><FONT face="courier new,courier">at System.ServiceModel.AsyncResult.End[TAsyncResult](IAsyncResult result)</FONT><BR><FONT face="courier new,courier">at System.ServiceModel.Activation.HostedHttpRequestAsyncResult.End(IAsyncResult result) </FONT></BLOCKQUOTE>
<P mce_keep="true">If you attach a debugger to <FONT face="courier new,courier">w3wp.exe</FONT> and enable break on first CLR change exceptions, the stack trace at the time of the failure will look like:</P>
<BLOCKQUOTE>
<P mce_keep="true"><FONT face="courier new,courier" color=#cc0000><STRONG>virtualPath&nbsp;</STRONG></FONT></P>
<P mce_keep="true"><FONT face="courier new,courier"><STRONG><FONT color=#cc0000>at Microsoft.SharePoint.ApplicationRuntime.SPRequestModule.IsExcludedPath(Stri&shy;ng virtualPath)</FONT></STRONG>&nbsp;<BR>at Microsoft.SharePoint.ApplicationRuntime.SPVirtualPathProvider.FileExists(St&shy;ring virtualPath)&nbsp;<BR>at System.ServiceModel.ServiceHostingEnvironment.HostingManager.EnsureServiceA&shy;vailable(String normalizedVirtualPath)&nbsp;<BR>at System.ServiceModel.ServiceHostingEnvironment.EnsureServiceAvailableFast(St&shy;ring relativeVirtualPath) <BR>at System.ServiceModel.Activation.HostedHttpRequestAsyncResult.HandleRequest() <BR>at System.ServiceModel.Activation.HostedHttpRequestAsyncResult.BeginRequest()&nbsp;<BR>at System.ServiceModel.Activation.HttpHandler.ProcessRequest(HttpContext context) </FONT></P></BLOCKQUOTE>
<P mce_keep="true">After debugging&nbsp;the issue, it turns out<STRONG><FONT color=#ff00cc>¹</FONT></STRONG> that WSS own <A class="" href="https://msdn2.microsoft.com/en-us/library/system.web.hosting.virtualpathprovider.aspx" mce_href="https://msdn2.microsoft.com/en-us/library/system.web.hosting.virtualpathprovider.aspx"><FONT color=#000099>VirtualPathProvider</FONT></A>&nbsp;(SPVirtualPathProvider, <A class="" href="https://msdn.microsoft.com/msdnmag/issues/06/07/WSS30Preview/default.aspx" mce_href="https://msdn.microsoft.com/msdnmag/issues/06/07/WSS30Preview/default.aspx"><FONT color=#000099>briefly described by this MSDN page</FONT></A>) refuses to handle requests for which the virtual path&nbsp;starts with "~".&nbsp;</P>
<P mce_keep="true">Now that we understand the issue, a workaround<FONT color=#ff00cc><STRONG>¹ </STRONG></FONT><FONT color=#000000>is easy to implement. There are three steps:</FONT></P>
<OL>
<LI>
<DIV mce_keep="true">Write our own VirtualPathProvider. It will detect if the request is made to a WCF service and if so, it will remove the leading "~" and hand off the request to WSS virtual path provider,</DIV></LI>
<LI>
<DIV mce_keep="true">Arrange for our new virtual path provider to be inserted before WSS provider so we get a crack at all requests before WSS does. This will be done using <A class="" href="https://msdn2.microsoft.com/en-us/library/ms178468(vs.90).aspx" mce_href="https://msdn2.microsoft.com/en-us/library/ms178468(vs.90).aspx"><FONT color=#000099>an ASP.NET HttpModule</FONT></A>,</DIV></LI>
<LI>
<DIV mce_keep="true">Perform a few changes to web.config to insert our new module in the ASP.NET pipeline.</DIV></LI></OL>
<P mce_keep="true">The following paragraphs describe these steps.</P>
<H3>A custom VirtualPathProvider</H3>
<P>VirtualPathProviders were introduced in ASP.NET 2.0. They are commly used by web applications which want to serve ASP.NET pages saved in other locations that the file system (a SQL table is the most canonical example).</P>
<P>All VirtualPathProviders are daisy chained by ASP.NET. This means that any custom VirtualPathProvider has a "Previous" VirtualPathProvider it can erly on to perform standard operations. For instance, Sharepoint's SPVirtualPathProvider relies on the default VirtualPathProvider to serve ASP.NET pages stored on the file system<STRONG><FONT color=#ff00cc>¹</FONT></STRONG>.</P>
<P>For us, we will essentially use the "Previous" VirtualPathProvider (which happens to be of type SPVirtualProvider) to implement our provider. We will pass most requests untouched. We will only look at requests ending with ".svc" and starting with "~". Such a request will be treated as a WCF service call and we will "patch" the virtual path (by removing the leading "~"). The patched virtual path will then be handed off to the previous virtual patch provider for further processing.</P>
<DIV style="BORDER-RIGHT: red 3px solid; BORDER-TOP: red 3px solid; BORDER-LEFT: red 3px solid; BORDER-BOTTOM: red 3px solid">
<DIV style="MARGIN: 4px">
<P><STRONG>NOTE</STRONG>: This causes *<STRONG>all</STRONG>* requests starting with "<FONT face="courier new,courier">~</FONT>" and ending with "<FONT face="courier new,courier">.svc</FONT>" to be patched. If you are going to use this code for a production, you should also restrict this patching process to virtual directories where services can be installed (that is everything under&nbsp;<FONT face="courier new,courier">_layouts</FONT> or <FONT face="courier new,courier">_vti_bin</FONT>).&nbsp;Failure to do so has security implications.</P></DIV></DIV>
<P><FONT color=#0000ff size=2><FONT color=#000000>Here is the code for our custom VirtualPathProvider:</FONT></P>
<BLOCKQUOTE>
<P><FONT face="courier new,courier">public</FONT></FONT><FONT face="courier new,courier"><FONT size=2> </FONT><FONT color=#0000ff size=2>class</FONT></FONT><FONT size=2><FONT face="courier new,courier"> WCFVirtualPathProvider : VirtualPathProvider {<BR></FONT><BR></FONT><FONT face="courier new,courier"><FONT color=#0000ff size=2>&nbsp;&nbsp;&nbsp;&nbsp; public</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>override</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>string</FONT><FONT size=2> CombineVirtualPaths(</FONT><FONT color=#0000ff size=2>string</FONT><FONT size=2> basePath, </FONT><FONT color=#0000ff size=2>string</FONT></FONT><FONT size=2><FONT face="courier new,courier"> relativePath) {</FONT><BR></FONT><FONT face="courier new,courier"><FONT color=#0000ff size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return</FONT><FONT size=2> Previous</FONT><FONT color=#9b710f size=2>.</FONT></FONT><FONT size=2><FONT face="courier new,courier">CombineVirtualPaths(basePath, relativePath);</FONT><BR face="courier new,courier" <FONT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR></FONT><BR></FONT><FONT face="courier new,courier"><FONT color=#0000ff size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;public</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>override</FONT><FONT size=2> System</FONT><FONT color=#9b710f size=2>.</FONT><FONT size=2>Runtime</FONT><FONT color=#9b710f size=2>.</FONT><FONT size=2>Remoting</FONT><FONT color=#9b710f size=2>.</FONT><B><FONT color=#000080 size=2>ObjRef</B></FONT></FONT><FONT face="courier new,courier"><FONT size=2> CreateObjRef(</FONT><B><FONT color=#000080 size=2>Type</B></FONT></FONT><FONT size=2><FONT face="courier new,courier"> requestedType) </FONT><FONT face="courier new,courier">{</FONT><BR></FONT><FONT face="courier new,courier"><FONT color=#0000ff size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return</FONT><FONT size=2> Previous</FONT><FONT color=#9b710f size=2>.</FONT></FONT><FONT size=2><FONT face="courier new,courier">CreateObjRef(requestedType);</FONT><BR><FONT face="courier new,courier">&nbsp;&nbsp;&nbsp;&nbsp; }<BR></FONT><BR></FONT><FONT face="courier new,courier"><FONT color=#0000ff size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;public</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>override</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>bool</FONT><FONT size=2> DirectoryExists(</FONT><FONT color=#0000ff size=2>string</FONT></FONT><FONT size=2><FONT face="courier new,courier"> virtualDir) </FONT>{</FONT><BR></FONT><FONT face="courier new,courier"><FONT color=#0000ff size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return</FONT><FONT size=2> Previous</FONT><FONT color=#9b710f size=2>.</FONT></FONT><FONT size=2><FONT face="courier new,courier">DirectoryExists(virtualDir);</FONT><BR><FONT face="courier new,courier"><FONT face=Arial>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </FONT>}<BR></FONT><BR></FONT><FONT style="BACKGROUND-COLOR: #ccff99"><FONT face="courier new,courier"><FONT color=#0000ff size=2>&nbsp;&nbsp;&nbsp;&nbsp; public</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>override</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>bool</FONT><FONT size=2> FileExists(</FONT><FONT color=#0000ff size=2>string</FONT></FONT></FONT><FONT size=2><FONT style="BACKGROUND-COLOR: #ccff99" face="courier new,courier"> virtualPath) </FONT><FONT style="BACKGROUND-COLOR: #ccff99" face="courier new,courier">{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; </FONT><BR></FONT><FONT color=#008000 size=2><FONT style="BACKGROUND-COLOR: #ccff99" face="courier new,courier">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Patches requests to WCF services: That is a virtual path ending with ".svc"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </FONT></FONT><FONT color=#008000 size=2><BR></FONT><FONT size=2></FONT><FONT style="BACKGROUND-COLOR: #ccff99"><FONT face="courier new,courier"><FONT color=#0000ff size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; string</FONT><FONT size=2> patchedVirtualPath </FONT><FONT color=#9b710f size=2>=</FONT></FONT></FONT><FONT size=2><FONT style="BACKGROUND-COLOR: #ccff99" face="courier new,courier"> virtualPath;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</FONT><BR></FONT><FONT style="BACKGROUND-COLOR: #ccff99"><FONT face="courier new,courier"><FONT color=#0000ff size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;if</FONT><FONT size=2> (virtualPath</FONT><FONT color=#9b710f size=2>.</FONT><FONT size=2>StartsWith(</FONT><FONT color=#9f1192 size=2>"~"</FONT><FONT size=2>, </FONT><B><FONT color=#2b91af size=2>StringComparison</B></FONT></FONT></FONT><FONT style="BACKGROUND-COLOR: #ccff99"><FONT face="courier new,courier"><FONT color=#9b710f size=2>.</FONT><FONT size=2>Ordinal) </FONT><FONT color=#9b710f size=2>&amp;&amp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </FONT><FONT size=2>virtualPath</FONT><FONT color=#9b710f size=2>.</FONT><FONT size=2>EndsWith(</FONT><FONT color=#9f1192 size=2>".svc"</FONT><FONT size=2>,</FONT><B><FONT color=#2b91af size=2>&nbsp;&nbsp;&nbsp; StringComparison</B></FONT></FONT></FONT><FONT style="BACKGROUND-COLOR: #ccff99" face="courier new,courier" color=#9b710f size=2>.</FONT><FONT size=2><FONT style="BACKGROUND-COLOR: #ccff99" face="courier new,courier">InvariantCultureIgnoreCase))&nbsp;&nbsp; &nbsp;&nbsp;</FONT><BR><FONT style="BACKGROUND-COLOR: #ccff99" face="courier new,courier">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </FONT><BR><FONT style="BACKGROUND-COLOR: #ccff99" face="courier new,courier">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; patchedVirtualPath </FONT></FONT><FONT style="BACKGROUND-COLOR: #ccff99"><FONT face="courier new,courier"><FONT color=#9b710f size=2>=</FONT><FONT size=2> virtualPath</FONT><FONT color=#9b710f size=2>.</FONT><FONT size=2>Remove(</FONT><FONT color=#dd1717 size=2>0</FONT><FONT size=2>, </FONT><FONT color=#dd1717 size=2>1</FONT></FONT></FONT><FONT size=2><FONT style="BACKGROUND-COLOR: #ccff99" face="courier new,courier">);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; </FONT><BR><FONT style="BACKGROUND-COLOR: #ccff99" face="courier new,courier">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</FONT><BR></FONT><FONT style="BACKGROUND-COLOR: #ccff99"><FONT face="courier new,courier"><FONT color=#0000ff size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return</FONT><FONT size=2> Previous</FONT><FONT color=#9b710f size=2>.</FONT></FONT></FONT><FONT size=2><FONT style="BACKGROUND-COLOR: #ccff99" face="courier new,courier">FileExists(patchedVirtualPath);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </FONT><BR><FONT style="BACKGROUND-COLOR: #ccff99" face="courier new,courier">&nbsp;&nbsp;&nbsp;&nbsp; }&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR></FONT><BR></FONT><FONT face="courier new,courier"><FONT color=#0000ff size=2>&nbsp;&nbsp;&nbsp;&nbsp; public</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>override</FONT><FONT size=2> System</FONT><FONT color=#9b710f size=2>.</FONT><FONT size=2>Web</FONT><FONT color=#9b710f size=2>.</FONT><FONT size=2>Caching</FONT><FONT color=#9b710f size=2>.</FONT><FONT size=2>CacheDependency GetCacheDependency(</FONT><FONT color=#0000ff size=2>string</FONT><FONT size=2> virtualPath,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;System</FONT><FONT color=#9b710f size=2>.</FONT><FONT size=2>Collections</FONT><FONT color=#9b710f size=2>.</FONT><B><FONT color=#c13e65 size=2>IEnumerable</B></FONT></FONT><FONT face="courier new,courier"><FONT size=2> virtualPathDependencies, </FONT><B><FONT color=#ff8000 size=2>DateTime</B></FONT></FONT><FONT size=2><FONT face="courier new,courier"> utcStart) </FONT><FONT face="courier new,courier">{</FONT><BR></FONT><FONT face="courier new,courier"><FONT color=#0000ff size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return</FONT><FONT size=2> Previous</FONT><FONT color=#9b710f size=2>.</FONT></FONT><FONT size=2><FONT face="courier new,courier">GetCacheDependency(virtualPath, virtualPathDependencies, utcStart);</FONT><BR><FONT face="courier new,courier">&nbsp;&nbsp;&nbsp;&nbsp; }<BR></FONT><BR></FONT><FONT face="courier new,courier"><FONT color=#0000ff size=2>&nbsp;&nbsp;&nbsp;&nbsp; public</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>override</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>string</FONT><FONT size=2> GetCacheKey(</FONT><FONT color=#0000ff size=2>string</FONT></FONT><FONT size=2><FONT face="courier new,courier"> virtualPath) {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</FONT></FONT><FONT face="courier new,courier"><FONT color=#0000ff size=2>return</FONT><FONT size=2> Previous</FONT><FONT color=#9b710f size=2>.</FONT></FONT><FONT size=2><FONT face="courier new,courier">GetCacheKey(virtualPath);<BR>&nbsp;&nbsp;&nbsp;&nbsp; </FONT><FONT face="courier new,courier">}<BR></FONT><BR></FONT><FONT face="courier new,courier"><FONT color=#0000ff size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;public</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>override</FONT><FONT size=2> VirtualDirectory GetDirectory(</FONT><FONT color=#0000ff size=2>string</FONT></FONT><FONT size=2><FONT face="courier new,courier"> virtualDir) </FONT><FONT face="courier new,courier">{</FONT><BR></FONT><FONT face="courier new,courier"><FONT color=#0000ff size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return</FONT><FONT size=2> Previous</FONT><FONT color=#9b710f size=2>.</FONT></FONT><FONT size=2><FONT face="courier new,courier">GetDirectory(virtualDir);</FONT><BR><FONT face="courier new,courier">&nbsp;&nbsp;&nbsp;&nbsp; }<BR></FONT><BR></FONT><FONT face="courier new,courier"><FONT color=#0000ff size=2>&nbsp;&nbsp;&nbsp;&nbsp; public</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>override</FONT><FONT size=2> VirtualFile GetFile(</FONT><FONT color=#0000ff size=2>string</FONT></FONT><FONT size=2><FONT face="courier new,courier"> virtualPath) </FONT><FONT face="courier new,courier">{</FONT><BR></FONT><FONT face="courier new,courier"><FONT color=#0000ff size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return</FONT><FONT size=2> Previous</FONT><FONT color=#9b710f size=2>.</FONT></FONT><FONT size=2><FONT face="courier new,courier">GetFile(virtualPath);</FONT><BR><FONT face="courier new,courier">&nbsp;&nbsp;&nbsp;&nbsp; }<BR></FONT><BR></FONT><FONT face="courier new,courier"><FONT color=#0000ff size=2>&nbsp;&nbsp;&nbsp;&nbsp; public</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>override</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>string</FONT><FONT size=2> GetFileHash(</FONT><FONT color=#0000ff size=2>string</FONT><FONT size=2> virtualPath, System</FONT><FONT color=#9b710f size=2>.</FONT><FONT size=2>Collections</FONT><FONT color=#9b710f size=2>.</FONT><B><FONT color=#c13e65 size=2>IEnumerable</B></FONT></FONT><FONT size=2><FONT face="courier new,courier"> virtualPathDependencies) </FONT><FONT face="courier new,courier">{</FONT> <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </FONT><FONT face="courier new,courier"><FONT color=#0000ff size=2>return</FONT><FONT size=2> Previous</FONT><FONT color=#9b710f size=2>.</FONT></FONT><FONT size=2><FONT face="courier new,courier">GetFileHash(virtualPath, virtualPathDependencies);</FONT><BR><FONT face="courier new,courier">&nbsp;&nbsp;&nbsp;&nbsp; }<BR></FONT><BR></FONT><FONT face="courier new,courier"><FONT color=#0000ff size=2>&nbsp;&nbsp;&nbsp;&nbsp; protected</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>override</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>void</FONT></FONT><FONT size=2><FONT face="courier new,courier"> Initialize() </FONT><FONT face="courier new,courier">{</FONT><BR></FONT><FONT face="courier new,courier"><FONT color=#0000ff size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; base</FONT><FONT color=#9b710f size=2>.</FONT></FONT><FONT size=2><FONT face="courier new,courier">Initialize();</FONT><BR><FONT face="courier new,courier">&nbsp;&nbsp;&nbsp;&nbsp; }</FONT><BR><FONT face="courier new,courier">}</FONT></FONT></P></BLOCKQUOTE>
<P>Most method delegate work to the "Previous" virtual path. Virtual Paths appearing to be WCF service calls are patched.</P>
<H3>Registering&nbsp;our&nbsp;VirtualPathProvider&nbsp;</H3>
<P mce_keep="true">According to MSDN, VirtualPathProviders must be registered using <A class="" href="https://msdn2.microsoft.com/en-us/library/system.web.hosting.hostingenvironment.registervirtualpathprovider.aspx" mce_href="https://msdn2.microsoft.com/en-us/library/system.web.hosting.hostingenvironment.registervirtualpathprovider.aspx"><FONT face="courier new,courier" color=#000066>HostingEnvironment.RegisterVirtualPathProvider</FONT></A>. Moreover, VirtualPathProviders must be registered with ASP.NET before the first line of code is compiled. An HttpModule is the perfect place for us to register our provider. The module is trivial:</P>
<BLOCKQUOTE>
<P mce_keep="true"><FONT color=#0000ff size=2><FONT face="courier new,courier">public</FONT></FONT><FONT face="courier new,courier"><FONT size=2> </FONT><FONT color=#0000ff size=2>class</FONT></FONT><FONT size=2><FONT face="courier new,courier"> WCFPatchupModule : IHttpModule </FONT><FONT face="courier new,courier">{<BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp; </FONT></FONT><FONT face="courier new,courier"><FONT color=#0000ff size=2>static</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>bool</FONT><FONT size=2> virtualPathProviderInitialized </FONT><FONT color=#9b710f size=2>=</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>false</FONT></FONT><FONT size=2><FONT face="courier new,courier">;<BR>&nbsp;&nbsp; </FONT></FONT><FONT face="courier new,courier"><FONT color=#0000ff size=2>static</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>object</FONT><FONT size=2> virtualPathProviderInitializedSyncLock </FONT><FONT color=#9b710f size=2>=</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>new</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>object</FONT></FONT><FONT size=2><FONT face="courier new,courier">();</FONT></FONT></P>
<P mce_keep="true"><FONT face="Courier New">&nbsp;&nbsp; <FONT color=#0000ff size=2>public</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>void</FONT></FONT><FONT size=2><FONT face="courier new,courier"> Dispose() </FONT><FONT face="courier new,courier">{<BR>&nbsp;&nbsp; </FONT></FONT><FONT size=2><FONT face="courier new,courier">}</FONT></P>
<P></FONT><FONT face="courier new,courier"><FONT color=#0000ff size=2>&nbsp;&nbsp; public</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>void</FONT></FONT><FONT size=2><FONT face="courier new,courier"> Init(HttpApplication context) </FONT><FONT face="courier new,courier">{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </FONT></FONT><FONT face="courier new,courier"><FONT color=#0000ff size=2>if</FONT><FONT size=2> (</FONT><FONT color=#9b710f size=2>!</FONT></FONT><FONT size=2><FONT face="courier new,courier">virtualPathProviderInitialized) </FONT><FONT face="courier new,courier">{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </FONT></FONT><FONT face="courier new,courier" color=#0000ff size=2>lock</FONT><FONT size=2><FONT face="courier new,courier"> (virtualPathProviderInitializedSyncLock) </FONT><FONT face="courier new,courier">{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </FONT></FONT><FONT face="courier new,courier"><FONT color=#0000ff size=2>if</FONT><FONT size=2> (</FONT><FONT color=#9b710f size=2>!</FONT></FONT><FONT size=2><FONT face="courier new,courier">virtualPathProviderInitialized) </FONT><FONT face="courier new,courier">{<BR><FONT style="BACKGROUND-COLOR: #ccff99">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </FONT></FONT><FONT style="BACKGROUND-COLOR: #ccff99" face="courier new,courier">WCFVirtualPathProvider vpathProvider </FONT></FONT><FONT face="courier new,courier"><FONT style="BACKGROUND-COLOR: #ccff99"><FONT color=#9b710f size=2>=</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>new</FONT></FONT></FONT><FONT style="BACKGROUND-COLOR: #ccff99"><FONT size=2><FONT face="courier new,courier"> WCFVirtualPathProvider();&nbsp; <BR></FONT><FONT face="courier new,courier">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; HostingEnvironment</FONT></FONT><FONT face="courier new,courier" color=#9b710f size=2>.</FONT></FONT><FONT size=2><FONT face="courier new,courier"><FONT style="BACKGROUND-COLOR: #ccff99">RegisterVirtualPathProvider(vpathProvider);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR></FONT><BR></FONT><FONT face="courier new,courier">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; virtualPathProviderInitialized </FONT></FONT><FONT face="courier new,courier"><FONT color=#9b710f size=2>=</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>true</FONT></FONT><FONT size=2><FONT face="courier new,courier">;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</FONT><FONT face="courier new,courier">}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </FONT><FONT face="courier new,courier">}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </FONT><FONT face="courier new,courier">}<BR>&nbsp;&nbsp; </FONT><FONT face="courier new,courier">}<BR></FONT></FONT><FONT size=2><FONT face="courier new,courier">}</FONT></FONT></P></BLOCKQUOTE>
<P><FONT size=2>Now, we need to compile the two classes above into a <STRONG>strongly named assembly</STRONG> and isntall it into the GAC.</P></FONT>
<H3>Configuration changes</H3>
<P>Assuming you have compiled the two classes above and signed the assembly, you are now ready to insert our HttpModule in the ASP.NET pipeline. This is easily done by changing the <FONT face="courier new,courier">&lt;httpModules&gt;</FONT> section of the sharepoint site as follows:<FONT color=#0000ff size=2></P>
<BLOCKQUOTE><FONT face="courier new,courier">&lt;</FONT></FONT><FONT face="courier new,courier" color=#a31515 size=2>httpModules</FONT><FONT color=#0000ff size=2><FONT face="courier new,courier">&gt;</FONT><BR><FONT face="courier new,courier">&lt;</FONT></FONT><FONT face="courier new,courier" color=#a31515 size=2>clear</FONT><FONT color=#0000ff size=2><FONT face="courier new,courier"> /&gt;</FONT><BR><FONT face="courier new,courier">&lt;</FONT></FONT><FONT face="courier new,courier"><FONT color=#a31515 size=2>add</FONT><FONT color=#0000ff size=2> </FONT><FONT color=#ff0000 size=2>name</FONT><FONT color=#0000ff size=2>=</FONT><FONT size=2>"</FONT><FONT color=#0000ff size=2>SPRequest</FONT><FONT size=2>"</FONT><FONT color=#0000ff size=2> </FONT><FONT color=#ff0000 size=2>type</FONT><FONT color=#0000ff size=2>=</FONT><FONT size=2>"</FONT><FONT color=#0000ff size=2>Microsoft.SharePoint.ApplicationRuntime.SPRequestModule, Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c</FONT><FONT size=2>"</FONT></FONT><FONT color=#0000ff size=2><FONT face="courier new,courier"> /&gt;</FONT><BR><FONT face="courier new,courier">&lt;</FONT></FONT><FONT face="courier new,courier"><FONT color=#a31515 size=2>add</FONT><FONT color=#0000ff size=2> </FONT><FONT color=#ff0000 size=2>name</FONT><FONT color=#0000ff size=2>=</FONT><FONT size=2>"</FONT><FONT color=#0000ff size=2>OutputCache</FONT><FONT size=2>"</FONT><FONT color=#0000ff size=2> </FONT><FONT color=#ff0000 size=2>type</FONT><FONT color=#0000ff size=2>=</FONT><FONT size=2>"</FONT><FONT color=#0000ff size=2>System.Web.Caching.OutputCacheModule</FONT><FONT size=2>"</FONT></FONT><FONT color=#0000ff size=2><FONT face="courier new,courier"> /&gt;</FONT><BR><FONT face="courier new,courier">&lt;</FONT></FONT><FONT face="courier new,courier"><FONT color=#a31515 size=2>add</FONT><FONT color=#0000ff size=2> </FONT><FONT color=#ff0000 size=2>name</FONT><FONT color=#0000ff size=2>=</FONT><FONT size=2>"</FONT><FONT color=#0000ff size=2>FormsAuthentication</FONT><FONT size=2>"</FONT><FONT color=#0000ff size=2> </FONT><FONT color=#ff0000 size=2>type</FONT><FONT color=#0000ff size=2>=</FONT><FONT size=2>"</FONT><FONT color=#0000ff size=2>System.Web.Security.FormsAuthenticationModule</FONT><FONT size=2>"</FONT></FONT><FONT color=#0000ff size=2><FONT face="courier new,courier"> /&gt;</FONT><BR><FONT face="courier new,courier">&lt;</FONT></FONT><FONT face="courier new,courier"><FONT color=#a31515 size=2>add</FONT><FONT color=#0000ff size=2> </FONT><FONT color=#ff0000 size=2>name</FONT><FONT color=#0000ff size=2>=</FONT><FONT size=2>"</FONT><FONT color=#0000ff size=2>UrlAuthorization</FONT><FONT size=2>"</FONT><FONT color=#0000ff size=2> </FONT><FONT color=#ff0000 size=2>type</FONT><FONT color=#0000ff size=2>=</FONT><FONT size=2>"</FONT><FONT color=#0000ff size=2>System.Web.Security.UrlAuthorizationModule</FONT><FONT size=2>"</FONT></FONT><FONT color=#0000ff size=2><FONT face="courier new,courier"> /&gt;</FONT><BR><FONT face="courier new,courier">&lt;</FONT></FONT><FONT face="courier new,courier"><FONT color=#a31515 size=2>add</FONT><FONT color=#0000ff size=2> </FONT><FONT color=#ff0000 size=2>name</FONT><FONT color=#0000ff size=2>=</FONT><FONT size=2>"</FONT><FONT color=#0000ff size=2>WindowsAuthentication</FONT><FONT size=2>"</FONT><FONT color=#0000ff size=2> </FONT><FONT color=#ff0000 size=2>type</FONT><FONT color=#0000ff size=2>=</FONT><FONT size=2>"</FONT><FONT color=#0000ff size=2>System.Web.Security.WindowsAuthenticationModule</FONT><FONT size=2>"</FONT></FONT><FONT color=#0000ff size=2><FONT face="courier new,courier"> /&gt;</FONT><BR><FONT face="courier new,courier">&lt;</FONT></FONT><FONT face="courier new,courier"><FONT color=#a31515 size=2>add</FONT><FONT color=#0000ff size=2> </FONT><FONT color=#ff0000 size=2>name</FONT><FONT color=#0000ff size=2>=</FONT><FONT size=2>"</FONT><FONT color=#0000ff size=2>RoleManager</FONT><FONT size=2>"</FONT><FONT color=#0000ff size=2> </FONT><FONT color=#ff0000 size=2>type</FONT><FONT color=#0000ff size=2>=</FONT><FONT size=2>"</FONT><FONT color=#0000ff size=2>System.Web.Security.RoleManagerModule</FONT><FONT size=2>"</FONT></FONT><FONT color=#0000ff size=2><FONT face="courier new,courier"> /&gt;</FONT><BR><FONT style="BACKGROUND-COLOR: #ccff99" face="courier new,courier"><BR>&lt;</FONT></FONT><FONT face="courier new,courier"><FONT style="BACKGROUND-COLOR: #ccff99"><FONT color=#a31515 size=2>add</FONT><FONT color=#0000ff size=2> </FONT><FONT color=#ff0000 size=2>name</FONT><FONT color=#0000ff size=2>=</FONT><FONT size=2>"</FONT><FONT color=#0000ff size=2>WcfVirtualPathProvider</FONT><FONT size=2>"</FONT><FONT color=#0000ff size=2> </FONT><FONT color=#ff0000 size=2>type</FONT><FONT color=#0000ff size=2>=</FONT><FONT size=2>"</FONT><FONT color=#0000ff size=2>WcfVirtualPathProvider.WCFPatchupModule,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; WcfVirtualPathProvider, Version=1.0.0.0, Culture=neutral,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; PublicKeyToken=[... put your assembly public key token here ...]</FONT><FONT size=2>"</FONT></FONT></FONT><FONT color=#0000ff size=2><FONT style="BACKGROUND-COLOR: #ccff99"><FONT face="courier new,courier">/&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;</FONT><BR></FONT><FONT face="courier new,courier"><BR>&lt;!--</FONT></FONT><FONT face="courier new,courier" color=#008000 size=2> &lt;add name="Session" type="System.Web.SessionState.SessionStateModule"/&gt; </FONT><FONT color=#0000ff size=2><FONT face="courier new,courier">--&gt;</FONT><BR><FONT face="courier new,courier">&lt;/</FONT></FONT><FONT face="courier new,courier"><FONT color=#a31515 size=2>httpModules</FONT><FONT color=#0000ff size=2>&gt;</BLOCKQUOTE></FONT></FONT>
<P mce_keep="true">Our HttpModule will run after&nbsp;Sharepoint's "<FONT face="courier new,courier">SPRequest</FONT>" module.&nbsp;Since SPVirtualProvider is registered by the "<FONT face="courier new,courier">SPRequest</FONT>" module at startup<STRONG><FONT color=#ff00cc>¹</FONT></STRONG>, we know&nbsp;our VirtualPathProvider will always come into&nbsp; play *<STRONG>after</STRONG>* Sharepoint's <FONT face="courier new,courier">SPVirtualPathProvider</FONT> and&nbsp;therefore, we will&nbsp;get a chance to patch the request's virtual path before it reaches Sharepoint. Of course, you will need to substitute your assembly name, version and public key token.&nbsp; 
<P mce_keep="true">
<P mce_keep="true">You are now ready to test: deposit an WCF service under <FONT face="courier new,courier">_layouts</FONT> and call it. You should now see your service getting activated and calls should now be sucessful. 
<P mce_keep="true">
<P mce_keep="true">
<DIV style="BORDER-RIGHT: red 2px solid; BORDER-TOP: red 2px solid; BORDER-LEFT: red 2px solid; BORDER-BOTTOM: red 2px solid">
<DIV style="MARGIN: 8px">
<P mce_keep="true"><STRONG>Disclaimer - Read&nbsp;Me !</STRONG>&nbsp;</P>
<P mce_keep="true"><STRONG><FONT color=#ff00cc>¹</FONT></STRONG>As with all statements of alleged fact, this statement is an interpretation of events based on my observation and thought and does not establish a statement of the official position of the Windows Sharepoint Services team or Microsoft Corporation. That interpretation may ultimately prove incorrect. Techniques and strategies described in this post should be considred "for entertainment only". This post is offered "as is".</P></DIV></DIV>]]></content:encoded>
    </item>
    <item>
      <title>BizTalk Decompiler for Reflector 5 on CodePlex</title>
      <link>https://docs.microsoft.com/archive/blogs/gzunino/biztalk-decompiler-for-reflector-5-on-codeplex</link>
      <pubDate>Wed, 27 Jun 2007 18:44:00 GMT</pubDate>
      <dc:creator><![CDATA[Gilles Zunino]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/gzunino/2007/06/27/biztalk-decompiler-for-reflector-5-on-codeplex/</guid>
      <description><![CDATA[My BizTalk Decompiler only works with Reflector 4. The updated version for Reflector 5 has been...]]></description>
      <content:encoded><![CDATA[My <A class="" href="https://blogs.msdn.com/gzunino/archive/2006/06/09/623391.aspx" mce_href="https://blogs.msdn.com/gzunino/archive/2006/06/09/623391.aspx">BizTalk Decompiler</A> only works with Reflector 4. The updated version for Reflector 5 has been available for a while on CodePlex: <A class="" title=https://www.codeplex.com/reflectoraddins href="https://www.codeplex.com/reflectoraddins" mce_href="https://www.codeplex.com/reflectoraddins">https://www.codeplex.com/reflectoraddins</A>]]></content:encoded>
    </item>
    <item>
      <title>Date/Time tracked with BAM must be expressed in Universal Coordinated Time (UTC)</title>
      <link>https://docs.microsoft.com/archive/blogs/gzunino/datetime-tracked-with-bam-must-be-expressed-in-universal-coordinated-time-utc</link>
      <pubDate>Tue, 18 Jul 2006 19:12:00 GMT</pubDate>
      <dc:creator><![CDATA[Gilles Zunino]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/gzunino/2006/07/18/datetime-tracked-with-bam-must-be-expressed-in-universal-coordinated-time-utc/</guid>
      <description><![CDATA[All date/time tracked by BAM must be expressed in UTC. BAM depends on this to provide accurate...]]></description>
      <content:encoded><![CDATA[<P>All date/time tracked by BAM must be expressed in UTC. BAM depends on this to provide accurate durations, among many other things. This is&nbsp;clearly&nbsp;<A href="https://msdn.microsoft.com/library/default.asp?url=/library/en-us/BTS06CoreDocs/html/dd8ccf63-6989-4ad6-a193-cf3043e9a466.asp">explained here</A>. It was also the case for BizTalk 2004 even if <A href="https://msdn.microsoft.com/library/default.asp?url=/library/en-us/sdk/htm/ebiz_prog_bam_qhwz.asp">the documentation gave subtle hints instead of describing it</A>:</P>
<P><FONT face="Courier New"><BR>es.UpdateActivity("PurchaseOrder", poid, "POShipped", <STRONG><FONT color=#ff0000>DateTime.UtcNow</FONT></STRONG>);</FONT></P>
<P>This rule is unfortunately easy to forget. For instance, let's assume you have a message with a date/time field you want to track with BAM. You start the tracking profile editor and map the message&nbsp;field to the adequate activity element. It was so&nbsp;easy that you forgot the above rule: the date/time&nbsp;data&nbsp;in the message&nbsp;must always be expressed in UTC or you'll start to see the tracked date/time behave funny in the BAM Portal as well as durations&nbsp;based on&nbsp;this date/time.</P>
<P>If the field is not expressed in UTC, the right approach is to convert it to UTC before you hand it off to BAM. You can do this in a map (with a scripting functoid), an orchestration or in a custom pre-processor component.</P>
<P>Happy date/time&nbsp;tracking!</P>]]></content:encoded>
    </item>
    <item>
      <title>BAM Portal Activity Search: "This action cannot be performed because one or more database(s) appears corrupted"</title>
      <link>https://docs.microsoft.com/archive/blogs/gzunino/bam-portal-activity-search-this-action-cannot-be-performed-because-one-or-more-databases-appears-corrupted</link>
      <pubDate>Wed, 12 Jul 2006 17:16:00 GMT</pubDate>
      <dc:creator><![CDATA[Gilles Zunino]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/gzunino/2006/07/12/bam-portal-activity-search-this-action-cannot-be-performed-because-one-or-more-databases-appears-corrupted/</guid>
      <description><![CDATA[When using the BAM Portal Activity Search feature, you may be directed to an error page with the...]]></description>
      <content:encoded><![CDATA[<P>When using the BAM Portal Activity Search feature, you may be directed to an error page with the above error message.</P>
<P>This error message means that there are instances with duplicate ID in the activity you were searching. If you look at the "Application" event log on the computer which runs the BAM Web Services, you will find one entry from "BAM Web Service" comparable to the following:</P>
<P><FONT face="Courier New" color=#000000>EXCEPTION:<BR>System.Web.Services.Protocols.SoapException: <FONT color=#ff0000><STRONG>There are instances with duplicate ID 'PO_COMPLETED_100' in activity 'PurchaseOrder'</STRONG></FONT>. The duplicates must be removed from the database to fix this problem.</FONT></P>
<P>BAM will not operate properly if there are duplicate activity instance IDs. Internally, BAM uses these IDs to perform correlations and expects them to be unique. The database is considered corrupted when this situation occurs and this condition should be fixed as soon as possible.</P>
<P><FONT size=4><STRONG><U>Why does that happen?</U></STRONG></FONT></P>
<P>You&nbsp;installed one of the BAM sample&nbsp;or tutorial&nbsp;and caused BizTalk to process the same message more than once.&nbsp;Sample messages have&nbsp;hardcoded IDs, so if you process the same message twice, you'll end up with&nbsp;two activity instances with the same ID.&nbsp;</P>
<P>This can also happen if BAM was asked&nbsp;to insert data with duplicate activity instance IDs through the BAM APIs such as DirectEventStream or BufferedEventStream.</P>
<P>You may also extract activity IDs from incoming messages using a tracking profile and two messages came with the same ID.</P>
<P>For BAM, it is critical you ensure all activity instasnce IDs are unique.</P>
<P><STRONG><U><FONT size=4>So why does BAM allow me to insert duplicate IDs?</FONT></U></STRONG></P>
<P>If BAM cannot operate with duplicate activity instance IDs, why doesn't BAM refuse to insert them in the first place? Well, this is for performance reasons. Internally, BAM splits the data into partitions to make insertions faster. Checking for the uniqueness of a key would require to lock multiple tables in a transaction and scan for this ID into multiple partitions / tables. This would dramatically slow BAM down.</P>]]></content:encoded>
    </item>
    <item>
      <title>BAM is not supported when SQL Server is set to Mixed Authentication Mode</title>
      <link>https://docs.microsoft.com/archive/blogs/gzunino/bam-is-not-supported-when-sql-server-is-set-to-mixed-authentication-mode</link>
      <pubDate>Tue, 20 Jun 2006 12:53:00 GMT</pubDate>
      <dc:creator><![CDATA[Gilles Zunino]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/gzunino/2006/06/20/bam-is-not-supported-when-sql-server-is-set-to-mixed-authentication-mode/</guid>
      <description><![CDATA[Tiho has a good entry on why it is that way and how to fix it. He also explains how to diagnose the...]]></description>
      <content:encoded><![CDATA[<A href="https://blogs.msdn.com/tihot/archive/2006/06/13/630313.aspx">Tiho has a good entry</A> on why it is that way and how to fix it. He also explains how to diagnose the problem.]]></content:encoded>
    </item>
    <item>
      <title>BizTalk Addin for Reflector</title>
      <link>https://docs.microsoft.com/archive/blogs/gzunino/biztalk-addin-for-reflector</link>
      <pubDate>Fri, 09 Jun 2006 12:17:00 GMT</pubDate>
      <dc:creator><![CDATA[Gilles Zunino]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/gzunino/2006/06/09/biztalk-addin-for-reflector/</guid>
      <description><![CDATA[This is an addin for Reflector that allows you to list all BizTalk artifacts contained in an...]]></description>
      <content:encoded><![CDATA[<P>This is an addin for <A href="https://www.aisto.com/Roeder/dotnet/">Reflector</A> that allows you to list all BizTalk artifacts contained in an assembly and extract them.</P>
<P><FONT face=Arial color=#000080 size=5>Installation</FONT></P>
<P><FONT style="BACKGROUND-COLOR: #ffffff"><A href="https://blogs.msdn.com/gzunino/attachment/623391.ashx">Donwload the attached file</A></FONT> and extract <FONT face="Courier New">Reflector.BizTalkDecompiler.dll </FONT><FONT face="Times New Roman"><STRONG>into the same directory as Reflector</STRONG> (otherwise it won't work). Go to View|Add-Ins in Reflector, and Add <FONT face="Courier New">Reflector.BizTalkDecompiler.dll</FONT>.</FONT></P>
<P><FONT face=Arial color=#000080 size=5>Usage</FONT></P>
<P><FONT color=#000000>Using File|Open..., add the BizTalk assembly you'll like to decompile to Reflector's assemblies list. Right click on the BizTalk assembly and select "BizTalk Server 2006 Artifacts".</FONT></P>
<P>You should see a list of all artifacts, with their type, name and&nbsp;namespace they were compiled into. Click the "Decompile..." button to decompile all selected artifacts into source files. You can select / de-select artifacts by using the selection check box on the right.</P>
<P>In the decompile dialog, specify the path to the directory where files should be created and press "Decompile". The decompile dialog is multi-threaded for a more responsive user interface.</P>
<P><FONT style="BACKGROUND-COLOR: #ffffff" face=Arial color=#000080 size=5>Screenshot</FONT></P>
<P>
<CENTER><IMG src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Components.PostAttachments/00/00/62/39/50/Main.JPG" original-url="https://blogs.msdn.com/photos/gzunino/images/623950/original.aspx"></CENTER>
<P></P>
<P>
<CENTER><IMG src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Components.PostAttachments/00/00/62/39/51/Export.JPG" original-url="https://blogs.msdn.com/photos/gzunino/images/623951/original.aspx"></CENTER>
<P></P>
<P><FONT face=Verdana color=#000080></FONT><FONT face=Arial color=#000080 size=5>Limitations</FONT></P>
<P><STRONG><FONT color=#ff0000>[Update June 19, 2006 - 10:00]</FONT></STRONG> This addin was compiled for the .NET Fraework 2.0 and Reflector 4.2 (and above). It will not work&nbsp;with the .NET Framework 1.1: you will get an error&nbsp;comparable to:</P>
<P><SPAN class=047541117-15062006><FONT face="Courier New" size=1>System.BadImageFormatException: The format of the file 'Reflector.BizTalkDecompiler.dll' is invalid.<BR>File name: "Reflector.BizTalkDecompiler.dll"<BR>&nbsp;&nbsp; at System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Boolean isStringized, Evidence assemblySecurity, Boolean throwOnFileNotFound, Assembly locationHint, StackCrawlMark&amp; stackMark)<BR>&nbsp;&nbsp; at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Boolean stringized, Evidence assemblySecurity, StackCrawlMark&amp; stackMark)<BR>&nbsp;&nbsp; at System.Reflection.Assembly.LoadFrom(String assemblyFile, Evidence securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm)<BR>&nbsp;&nbsp; at ᜧ.ᜀ(String A_0)</FONT></SPAN></P>
<P>&nbsp;I am currently investigating a port to .NET 1.1 but I do not promise I'll do it. The addin was designed for BizTalk Server 2006 which requires the .NET Framework 2.0 so you should have any problem.</P>
<P>Most BizTalk artifacts can be decompiled back to their original source form (Pipelines, Schemas). Some artifacts cannot be decompiled to their original source (Maps). When decompiling a map, the addin will export the XSLT which was generated by the compiler, not the actual .btm file.</P>
<P><FONT color=#ff0000><STRONG>[Update June 9, 2006 - 13:00]</STRONG></FONT> Recovering the full source of orchestrations is possible but invovles a manual step. After exporting, open the .odx file in the BizTalk Orchestration Designer (in Visual Studio) and save it without making any change. The editor will rebuild missing information which cannot be infered from the compiled assembly. Once this is done, the resulting .odx file should behave as if it was the source of the orchestration.</P>
<P><FONT face=Arial color=#000080 size=5>Feedback welcome!</FONT></P>
<P><FONT color=#ff0000><STRONG>[</STRONG></FONT><FONT color=#ff0000><STRONG>Update June 9, 2006 - 12:20]</STRONG> This tool is handy but I'd like to make sure everyone understands&nbsp;that is is offered "AS IS" with no warranty.</FONT>&nbsp;I did not anticpate so much interest in the tool so I had to append this legal disclaimer.</P>
<P>This being said, if you found a bug, want a new feature or just want to say that you are using BizTalk decompiler and you love it, feel free to use the "Email" link above to drop me&nbsp;a note!</P>
<CENTER></CENTER>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Components.PostAttachments/00/00/62/33/91/Reflector.BizTalkDecompiler.zip" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-components-postattachments/00-00-62-33-91/Reflector.BizTalkDecompiler.zip">Reflector.BizTalkDecompiler.zip</a></p>]]></content:encoded>
    </item>
    <item>
      <title>BizTalk Server 2006 Best Practices Analyzer has shipped!</title>
      <link>https://docs.microsoft.com/archive/blogs/gzunino/biztalk-server-2006-best-practices-analyzer-has-shipped</link>
      <pubDate>Thu, 01 Jun 2006 20:42:00 GMT</pubDate>
      <dc:creator><![CDATA[Gilles Zunino]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/gzunino/2006/06/01/biztalk-server-2006-best-practices-analyzer-has-shipped/</guid>
      <description><![CDATA[The BizTalk Server 2006 Best Practices Analyzer automatically examines a BizTalk Server 2006...]]></description>
      <content:encoded><![CDATA[<P><A href="https://www.microsoft.com/technet/prodtechnol/biztalk/downloads/bpa.mspx">The BizTalk Server 2006 Best Practices Analyzer</A> automatically examines a BizTalk Server 2006 deployment and generate a list of issues pertaining to best practices standards for BizTalk Server deployments. The primary use of this tool is to examine BizTalk Server production and staging environments, though it will still be useful on Dev machines.</P>
<P>You can donwload it at <A title=https://www.microsoft.com/downloads/details.aspx?FamilyId=DDA047E3-408E-48BA-83F9-F397226CD6D4&amp;displaylang=en href="https://www.microsoft.com/downloads/details.aspx?FamilyId=DDA047E3-408E-48BA-83F9-F397226CD6D4&amp;displaylang=en">https://www.microsoft.com/downloads/details.aspx?FamilyId=DDA047E3-408E-48BA-83F9-F397226CD6D4&amp;displaylang=en</A>.</P>]]></content:encoded>
    </item>
    <item>
      <title>BAM Query Service: What is it and how can I use it?</title>
      <link>https://docs.microsoft.com/archive/blogs/gzunino/bam-query-service-what-is-it-and-how-can-i-use-it</link>
      <pubDate>Wed, 31 May 2006 17:48:00 GMT</pubDate>
      <dc:creator><![CDATA[Gilles Zunino]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/gzunino/2006/05/31/bam-query-service-what-is-it-and-how-can-i-use-it/</guid>
      <description><![CDATA[If you have installed BAM (BizTalk Server 2004 or BizTalk Server 2006), you may have noticed that a...]]></description>
      <content:encoded><![CDATA[<P>If you have installed BAM (BizTalk Server 2004 or BizTalk Server 2006), you may have noticed that a web service called the "BAM Query Service" got installed. </P>
<P>As its name hints, this web service allows the BAM Portal to retrieve BAM instance data without connecting directly to a SQL server.</P>
<P>This web service is intended to be called by the BAM Portal only. Therefore, it is not documented and Microsoft will not support code which makes direct calls to this web service.</P>
<P>A long time ago, when we designed BAM&nbsp;for&nbsp;BizTalk Server 2004, we knew we wanted to get data without connecting&nbsp;to SQL server directly. Unfortunately, we did not have the time to provide a robust, well designed, general purpose set of APIs to query BAM instance data so we settled for a private API which served our immediate needs. It was believed that we would have time in a next release to think about this again and perhaps expose well designed APIs for BAM instance data retrieval. Alas, it was on the list but did not make the cut for BizTalk 2006.</P>
<P>The supported way of <A class="" href="https://msdn2.microsoft.com/en-us/library/Aa578070.aspx" mce_href="https://msdn2.microsoft.com/en-us/library/Aa578070.aspx"><STRONG>retrieving BAM instance data is documented on MSDN</STRONG></A>&nbsp;(<FONT color=#ff0000><STRONG>link updated 09/18/2007</STRONG></FONT>). Essentially, you need to connect to the SQL server hosting BAM and query the following view (available within the BAM Primary Import Database):</P>
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
<P><STRONG>bam_&lt;</STRONG><I>ViewName</I><B>&gt;_&lt;</B><I>ActivityName</I><B>&gt;_View<BR></B></P></BLOCKQUOTE>]]></content:encoded>
    </item>
  </channel>
</rss>