<?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>Daniel Vasquez Lopez's Blog</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/danielvl/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/danielvl/feed.xml</link>
    <description />
    <lastBuildDate>Fri, 24 Jul 2015 07:48:27 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>How to allow self-signed client certificates in IIS</title>
      <link>https://docs.microsoft.com/archive/blogs/danielvl/how-to-allow-self-signed-client-certificates-in-iis</link>
      <pubDate>Wed, 25 Jul 2012 10:36:01 GMT</pubDate>
      <dc:creator><![CDATA[aractnido]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/danielvl/2012/07/25/how-to-allow-self-signed-client-certificates-in-iis/</guid>
      <description><![CDATA[IIS allows you to use client certificates but it may give you hard time if your certificate is wacky...]]></description>
      <content:encoded><![CDATA[<p>IIS allows you to use client certificates but it may give you hard time if your certificate is wacky (e.g. self-signed). In the client-side, if you have a .NET application that wants to be more permissible on accepting server certificates, you can hook the event <a href="https://msdn.microsoft.com/en-us/library/system.net.servicepointmanager.servercertificatevalidationcallback.aspx">ServerCertificateValidationCallback</a> and decide weather or not you want to accept the server certificate; the callback provides you the certificate, the chain and the <a href="https://msdn.microsoft.com/en-us/library/ms145055.aspx">SslPolicyErrors</a> (as flags) found during validation.</p>  <p>IIS don’t have such abstraction for validating client certificates, but it does provide the raw mechanism for performing the validation yourself. By default, IIS will do the validation for you during the BeginRequest pipeline event and will fail if any error is found. To perform the validation yourself you need listen the PreBeginRequest global event, stream the certificate from client and finally ignore the SSL Policy Errors (Flags) that you want.</p>  <p>&#160;</p>  <p>The PreBeginRequest global event is not available (yet) for .NET code, you have to bring your C++ skills and write an IIS global module, no worries, there no too much code to write.</p>  <p>&#160;</p>  <p>High level, you need:</p>  <ol>   <li>Create a Visual C++ project following the walkthrough <a href="https://technet.microsoft.com/en-us/library/ms690697(v=vs.90).aspx">Creating a Global-Level HTTP Module By Using Native Code</a></li>    <li>Once you have the RegisterModule function that describes the walkthrough above, create Global-Level Module class as described in <a href="https://technet.microsoft.com/en-us/library/ms692648(v=vs.90).aspx">Designing Native-Code HTTP Modules</a>. Override the virtual method <a href="https://technet.microsoft.com/en-us/library/ms689353(v=vs.90).aspx">OnGlobalPreBeginRequest</a> and register for GL_PRE_BEGIN_REQUEST.</li>    <li>In the OnGlboalPreBeginRequest method, get a pointer to the IHttpRequest interface and call <a href="https://technet.microsoft.com/en-us/library/ms693646(v=vs.90).aspx">NegotiateClientCertificate</a> synchronously. This method will ask the client to present its certificate.</li>    <li>Once you have the client certificate negotiated, get it by calling <a href="https://technet.microsoft.com/en-us/library/ms694103(v=vs.90).aspx">GetClientCertificate</a>. The client certificate is represented by the structure <a href="https://technet.microsoft.com/en-us/query/aa364658(v=vs.85).aspx">HTTP_SSL_CLIENT_CERT_INFO</a>.</li>    <li>Finally, just remove the SSL Policy error flags that you don’t care about from the field CertFlags. Set it to zero to ignore everything, including expired certificates.</li> </ol>  <p>&#160;</p>  <p>The code that you need (at your own risk) is something like:</p>  <div class="code"><font color="blue">class</font><font color="#808080">&#160;</font><font color="black">CClientCertificateGlobalModule</font><font color="#808080">&#160;</font><font color="black">:</font><font color="#808080">&#160;</font><font color="blue">public</font><font color="#808080">&#160;</font><font color="black">CGlobalModule</font><font color="#808080">&#160; <br /></font><font color="black">{</font><font color="#808080">&#160; <br /></font><font color="blue">public</font><font color="black">:</font><font color="#808080">&#160; <br />      <br />&#160;&#160;&#160;&#160;&#160; </font><font color="black">GLOBAL_NOTIFICATION_STATUS</font><font color="#808080">&#160;</font><font color="black">OnGlobalPreBeginRequest(IPreBeginRequestProvider*</font><font color="#808080">&#160;</font><font color="black">pProvider)</font><font color="#808080">&#160; <br />&#160;&#160;&#160;&#160;&#160; </font><font color="black">{</font><font color="#808080">      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font><font color="black">IHttpContext*</font><font color="#808080">&#160;</font><font color="black">pContext</font><font color="#808080">&#160;</font><font color="blue">=</font><font color="#808080">&#160;</font><font color="black">pProvider-&gt;GetHttpContext()</font><font color="blue">;</font><font color="#808080">      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font><font color="black">IHttpRequest*</font><font color="#808080">&#160;</font><font color="black">pRequest</font><font color="#808080">&#160;</font><font color="blue">=</font><font color="#808080">&#160;</font><font color="black">pContext-&gt;GetRequest()</font><font color="blue">;</font><font color="#808080">&#160; <br />      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font><font color="blue">if</font><font color="#808080">&#160;</font><font color="black">(pRequest-&gt;GetRawHttpRequest()-&gt;pSslInfo</font><font color="#808080">&#160;</font><font color="blue">==</font><font color="#808080">&#160;</font><font color="blue">NULL</font><font color="black">)</font><font color="#808080">&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font><font color="black">{</font><font color="#808080">&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font><font color="blue">return</font><font color="#808080">&#160;</font><font color="black">GL_NOTIFICATION_CONTINUE</font><font color="blue">;</font><font color="#808080">&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font><font color="black">}</font><font color="#808080">      <br />      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font><font color="black">HRESULT</font><font color="#808080">&#160;</font><font color="black">hr</font><font color="blue">;</font><font color="#808080">&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font><font color="black">HTTP_SSL_CLIENT_CERT_INFO*</font><font color="#808080">&#160;</font><font color="black">pClientCertificate</font><font color="blue">;</font><font color="#808080">&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font><font color="black">BOOL</font><font color="#808080">&#160;</font><font color="black">fNegotiated</font><font color="blue">;</font><font color="#808080">&#160; <br />      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font><font color="black">hr</font><font color="#808080">&#160;</font><font color="blue">=</font><font color="#808080">&#160;</font><font color="black">pRequest-&gt;GetClientCertificate(&amp;pClientCertificate,</font><font color="#808080">&#160;</font><font color="black">&amp;fNegotiated)</font><font color="blue">;</font><font color="#808080">&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font><font color="blue">if</font><font color="#808080">&#160;</font><font color="black">(FAILED(hr))</font><font color="#808080">&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font><font color="black">{</font><font color="#808080">&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font><font color="black">pProvider-&gt;SetErrorStatus(hr)</font><font color="blue">;</font><font color="#808080">&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font><font color="blue">return</font><font color="#808080">&#160;</font><font color="black">GL_NOTIFICATION_CONTINUE</font><font color="blue">;</font><font color="#808080">&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font><font color="black">}</font><font color="#808080">      <br />      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font><font color="blue">if</font><font color="#808080">&#160;</font><font color="black">(fNegotiated)</font><font color="#808080">&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font><font color="black">{</font><font color="#808080">&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font><font color="blue">return</font><font color="#808080">&#160;</font><font color="black">GL_NOTIFICATION_CONTINUE</font><font color="blue">;</font><font color="#808080">&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font><font color="black">}</font><font color="#808080">      <br />      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font><font color="black">hr</font><font color="#808080">&#160;</font><font color="blue">=</font><font color="#808080">&#160;</font><font color="black">pRequest-&gt;NegotiateClientCertificate(</font><font color="blue">FALSE</font><font color="black">)</font><font color="blue">;</font><font color="#808080">&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font><font color="blue">if</font><font color="#808080">&#160;</font><font color="black">(FAILED(hr))</font><font color="#808080">&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font><font color="black">{</font><font color="#808080">&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font><font color="black">pProvider-&gt;SetErrorStatus(hr)</font><font color="blue">;</font><font color="#808080">&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font><font color="blue">return</font><font color="#808080">&#160;</font><font color="black">GL_NOTIFICATION_CONTINUE</font><font color="blue">;</font><font color="#808080">&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font><font color="black">}</font><font color="#808080">      <br />      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font><font color="black">hr</font><font color="#808080">&#160;</font><font color="blue">=</font><font color="#808080">&#160;</font><font color="black">pRequest-&gt;GetClientCertificate(&amp;pClientCertificate,</font><font color="#808080">&#160;</font><font color="black">&amp;fNegotiated)</font><font color="blue">;</font><font color="#808080">&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font><font color="blue">if</font><font color="#808080">&#160;</font><font color="black">(FAILED(hr))</font><font color="#808080">&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font><font color="black">{</font><font color="#808080">&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font><font color="black">pProvider-&gt;SetErrorStatus(hr)</font><font color="blue">;</font><font color="#808080">&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font><font color="blue">return</font><font color="#808080">&#160;</font><font color="black">GL_NOTIFICATION_CONTINUE</font><font color="blue">;</font><font color="#808080">&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font><font color="black">}</font><font color="#808080">&#160;&#160;&#160; <br />      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font><font color="darkgreen">// No longer a candidate for caching.      <br /></font><font color="#808080">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font><font color="black">pContext-&gt;GetResponse()-&gt;DisableKernelCache(</font><font color="maroon">14</font><font color="#808080">&#160;</font><font color="darkgreen">/*SSL*/</font><font color="black">)</font><font color="blue">;</font><font color="#808080">      <br />      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font><font color="blue">switch</font><font color="#808080">&#160;</font><font color="black">(pClientCertificate-&gt;CertFlags)</font><font color="#808080">      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font><font color="black">{</font><font color="#808080">      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font><font color="blue">case</font><font color="#808080">&#160;</font><font color="black">CERT_E_UNTRUSTEDCA:</font><font color="#808080">      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font><font color="blue">case</font><font color="#808080">&#160;</font><font color="black">CERT_E_CN_NO_MATCH:</font><font color="#808080">      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font><font color="black">pClientCertificate-&gt;CertFlags</font><font color="#808080">&#160;</font><font color="blue">=</font><font color="#808080">&#160;</font><font color="maroon">0</font><font color="blue">;</font><font color="#808080">      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font><font color="blue">break;</font><font color="#808080">      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font><font color="black">}</font><font color="#808080">      <br />      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font><font color="blue">return</font><font color="#808080">&#160;</font><font color="black">GL_NOTIFICATION_CONTINUE</font><font color="blue">;</font><font color="#808080">&#160; <br />&#160;&#160;&#160;&#160;&#160; </font><font color="black">}</font><font color="#808080">      <br />      <br />&#160;&#160;&#160;&#160;&#160; </font><font color="blue">void</font><font color="#808080">&#160;</font><font color="black">Terminate()</font><font color="#808080">&#160; <br />&#160;&#160;&#160;&#160;&#160; </font><font color="black">{</font><font color="#808080">&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font><font color="darkgreen">// Don't do anything since it is used as a global variable.&#160; <br /></font><font color="#808080">&#160;&#160;&#160; </font><font color="black">}</font><font color="#808080">      <br /></font><font color="black">}</font><font color="blue">;</font><font color="#808080">&#160; <br />      <br /></font><font color="darkgreen">// Global variable is fine because we assume we don't&#160;&#160; <br /> // need to do anything on Terminate method.&#160; <br /></font><font color="black">CClientCertificateGlobalModule</font><font color="#808080">&#160;</font><font color="black">g_ClientCertificateGlobalModule</font><font color="blue">;</font><font color="#808080">&#160; <br />      <br /></font><font color="black">HRESULT</font><font color="#808080">&#160;</font><font color="black">RegisterModule(DWORD,</font><font color="#808080">&#160;</font><font color="black">IHttpModuleRegistrationInfo*</font><font color="#808080">&#160;</font><font color="black">pModuleInfo,</font><font color="#808080">&#160;</font><font color="black">IHttpServer*)</font><font color="#808080">&#160; <br /></font><font color="black">{</font><font color="#808080">&#160; <br />&#160;&#160;&#160;&#160;&#160; </font><font color="blue">return</font><font color="#808080">&#160;</font><font color="black">pModuleInfo-&gt;SetGlobalNotifications(&amp;g_ClientCertificateGlobalModule,</font></div>  <div class="code"><font color="#000000">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; GL_PRE_BEGIN_REQUEST)</font><font color="blue">;</font><font color="#808080">&#160;&#160;&#160;&#160;&#160; <br /></font><font color="black">}</font> </div>  <p>A small deployment suggestion, in the Visual C++ project, change the settings to statically link to all libraries, like STL/CRT/MFC so you don’t require to install the Microsoft Visual C++ Redistributable Package.</p>]]></content:encoded>
    </item>
    <item>
      <title>How to escape {curly brackets} in URL Rewrite rule</title>
      <link>https://docs.microsoft.com/archive/blogs/danielvl/how-to-escape-curly-brackets-in-url-rewrite-rule</link>
      <pubDate>Fri, 29 Jul 2011 10:55:28 GMT</pubDate>
      <dc:creator><![CDATA[aractnido]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/danielvl/2011/07/29/how-to-escape-curly-brackets-in-url-rewrite-rule/</guid>
      <description><![CDATA[There is no escaping character in an URL Rewrite expression, but here is how you include curly...]]></description>
      <content:encoded><![CDATA[<p>There is no escaping character in an URL Rewrite expression, but here is how you include curly bracket within an URL Rewrite expression.</p>  <p>For opening <strong><font size="3">{</font></strong> curly bracket you will always require to use the UrlDecode function to generate the { character from its encoded value %7B, that is:</p>  <p>{UrlDecode:%7B}</p>  <p>For closing <strong><font size="3">}</font></strong> curly bracket you don’t have do anything if the character is not nested in a another URL Rewrite expression; otherwise you need to use UrlDecode with %7D.</p>  <p>{UrlDecode:%7D}</p>  <h2>Examples</h2>  <p>For generating “Products.aspx?Id={Guid}”, where the Guid comes from a map expression:</p>  <p>“Products.aspx?Id=<font size="2"><font style="background-color: #ffc000">{UrlDecode:%7B}</font><font style="background-color: #a5b592">{GuidMap:{R:0}}</font><font style="background-color: #ffc000">}</font></font>”</p>  <p>Note that the last closing curly bracket is written as it is, it doesn’t require to be encoded because there is no opening <strong><font size="3">{</font></strong> bracket that matches, so it is handled as a regular character.</p>  <ul>   <li><font size="2"><font style="background-color: #ffc000">{UrlDecode:</font><font style="background-color: #ffc000">%7B}</font></font></li>    <li><font size="2"><font style="background-color: #a5b592">{</font></font></li>    <ul>     <li><font size="2"><font style="background-color: #a5b592">GuidMap:</font></font><font size="2"><font style="background-color: #a5b592">{R:0}</font></font></li>   </ul>    <li><font size="2"><font style="background-color: #a5b592">}</font></font></li>    <li><font style="background-color: #ffc000" size="2">}</font></li> </ul>  <p><font style="style">When a closing <strong><font size="3">{</font></strong> bracket is nested in another expression you will need to encode it. NameFromGuidMap is a map that requires the input to be formatted as “{GUID}”.</font></p>  <p>“Products.aspx?Name=<font size="2"><font style="background-color: #dd8484">{NameFromGuidMap:</font><font style="background-color: #ffc000">{UrlDecode:%7B}</font><font style="background-color: #809ec2">{R:0}</font><font style="background-color: #ffc000">{UrlDecode:%7D}</font><font style="background-color: #dd8484">}</font></font>”</p>  <ul>   <li><font size="2"><font style="background-color: #dd8484">{</font></font></li>    <ul>     <li><font size="2"><font style="background-color: #dd8484">NameFromGuidMap:</font></font></li>      <ul>       <li><font size="2"><font style="background-color: #ffc000">{UrlDecode:%7B}</font></font></li>        <li><font size="2"><font style="background-color: #809ec2">{R:0}</font></font></li>        <li><font size="2"><font style="background-color: #ffc000">{UrlDecode:%7D}</font></font></li>     </ul>   </ul>    <li><font size="2"><font style="background-color: #dd8484">}</font></font></li> </ul>]]></content:encoded>
    </item>
    <item>
      <title>Disposing System.Threading.Timer</title>
      <link>https://docs.microsoft.com/archive/blogs/danielvl/disposing-system-threading-timer</link>
      <pubDate>Fri, 18 Feb 2011 16:14:31 GMT</pubDate>
      <dc:creator><![CDATA[aractnido]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/danielvl/2011/02/18/disposing-system-threading-timer/</guid>
      <description><![CDATA[I guess there are many ways to dispose this a timer, I was looking for an efficient way of doing it...]]></description>
      <content:encoded><![CDATA[<p>I guess there are many ways to dispose this a timer, I was looking for an efficient way of doing it and making sure that after the Dispose method was called I had no outstanding timer notifications.</p>  <p>In Win32 there is the concept of timer-queue timers, and in that APi set, when a timer is deleted by using DeleteTimerQueueTimer API, if INVALID_HANDLE_VALUE is passed to the CompletionEvent, the API automatically wait for any pending notification.</p>  <p>So, applying the same concept, I pass an “invalid” wait handle to Timer.Dispose and it works. Here is the invalid wait handle class:</p>  <pre>internal sealed class InvalidWaitHandle : WaitHandle
{
    private readonly static InvalidWaitHandle instance = new InvalidWaitHandle();

    private InvalidWaitHandle() {}

    public static WaitHandle Instance {
        get {
            return instance;
        }
    }

    public override IntPtr Handle {
        get {
            return WaitHandle.InvalidHandle;
        }
        set {
            throw new InvalidOperationException();
        }
    }
}</pre>

<p>And for disposing the Timer, just write:</p>

<pre>this.timer.Dispose(InvalidWaitHandle.Instance);</pre>]]></content:encoded>
    </item>
    <item>
      <title>NPR in Windows Phone</title>
      <link>https://docs.microsoft.com/archive/blogs/danielvl/npr-in-windows-phone</link>
      <pubDate>Fri, 07 Jan 2011 23:07:35 GMT</pubDate>
      <dc:creator><![CDATA[aractnido]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/danielvl/2011/01/07/npr-in-windows-phone/</guid>
      <description><![CDATA[I just realized that forgot to use “NPR” as keyword for my “Tiny Radio” app; so here is this blog...]]></description>
      <content:encoded><![CDATA[<p>I just realized that forgot to use “NPR” as keyword for my “Tiny Radio” app; so here is this blog entry <img style="border-bottom-style: none; border-left-style: none; border-top-style: none; border-right-style: none" class="wlEmoticon wlEmoticon-winkingsmile" alt="Winking smile" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/45/72/metablogapi/3124.wlEmoticon-winkingsmile_1F7B16C5.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-45-72-metablogapi/3124.wlEmoticon_2D00_winkingsmile_5F00_1F7B16C5.png" /></p>  <p>My first Windows Phone 7 app is “Tiny Radio” and what it does is to simply tune the closest NPR (National Public Radio) station based on your geographical location. All Windows Phone devices have a built-in FM Radio, to use it, you need to plug your headphones as antenna.</p>  <p>I didn’t want to named “Tiny Radio” as “NPR Finder” or “Public Radio” because I saw those names were used somewhere else, so I decided to use the Tiny word because the app contains all NPR stations in the app itself, that is, <strong>it doesn’t require an Internet connection</strong> for listening NPR, it detects your location and quickly displays the available stations and the name gives me room if I want to extend it in the future.</p>  <p>To install it, search for “Tiny Radio” in the Marketplace hub in your phone (remember to use the physical Search button). It is free for Windows Phone users.</p>  <p>If you have Zune software, you can click the link <a href="https://social.zune.net/redirect?type=phoneApp&amp;id=9dba32a4-fb13-e011-9264-00237de2db9e">https://social.zune.net/redirect?type=phoneApp&amp;id=9dba32a4-fb13-e011-9264-00237de2db9e</a></p>  <p>It is handy if you are a <a href="https://www.npr.org">www.npr.org</a> fan and travel; or just if you want to listen NPR with one single tap.</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/45/72/metablogapi/8154.Background_05C9A48F.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-45-72-metablogapi/8154.Background_5F00_05C9A48F.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: ; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="Background" border="0" alt="Background" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/45/72/metablogapi/7571.Background_thumb_45938B14.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-45-72-metablogapi/7571.Background_5F00_thumb_5F00_45938B14.png" width="177" height="177" /></a></p>]]></content:encoded>
    </item>
    <item>
      <title>You placed a large amount of data on the Clipboard</title>
      <link>https://docs.microsoft.com/archive/blogs/danielvl/you-placed-a-large-amount-of-data-on-the-clipboard</link>
      <pubDate>Thu, 29 Apr 2010 16:09:00 GMT</pubDate>
      <dc:creator><![CDATA[aractnido]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/danielvl/2010/04/29/you-placed-a-large-amount-of-data-on-the-clipboard/</guid>
      <description><![CDATA[I don’t really like this dialog, it is confusing and really hard to read for me. I just simply don’t...]]></description>
      <content:encoded><![CDATA[<P>I don’t really like this dialog, it is confusing and really hard to read for me. I just simply don’t like it:</P>
<P><A href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/danielvl/WindowsLiveWriter/YouplacedalargeamountofdataontheClipboar_E34C/image_2.png" original-url="https://blogs.msdn.com/blogfiles/danielvl/WindowsLiveWriter/YouplacedalargeamountofdataontheClipboar_E34C/image_2.png" mce_href="https://blogs.msdn.com/blogfiles/danielvl/WindowsLiveWriter/YouplacedalargeamountofdataontheClipboar_E34C/image_2.png"><IMG style="BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; DISPLAY: inline; BORDER-TOP: 0px; BORDER-RIGHT: 0px" title=image border=0 alt=image src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/danielvl/WindowsLiveWriter/YouplacedalargeamountofdataontheClipboar_E34C/image_thumb.png" original-url="https://blogs.msdn.com/blogfiles/danielvl/WindowsLiveWriter/YouplacedalargeamountofdataontheClipboar_E34C/image_thumb.png" width=465 height=73 mce_src="https://blogs.msdn.com/blogfiles/danielvl/WindowsLiveWriter/YouplacedalargeamountofdataontheClipboar_E34C/image_thumb.png"></A> </P>
<P>No further comment.</P>]]></content:encoded>
    </item>
    <item>
      <title>URL Rewrite 2.0 Performance</title>
      <link>https://docs.microsoft.com/archive/blogs/danielvl/url-rewrite-2-0-performance</link>
      <pubDate>Thu, 18 Mar 2010 08:42:18 GMT</pubDate>
      <dc:creator><![CDATA[aractnido]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/danielvl/2010/03/18/url-rewrite-2-0-performance/</guid>
      <description><![CDATA[Do performance work it is easy when you have the right tools for measuring gains or lost. I will...]]></description>
      <content:encoded><![CDATA[<p>Do performance work it is easy when you have the right tools for measuring gains or lost. I will share some thoughts about how to improve performance during rewriting, but please keep in mind that any change you do must be well thought and with performance numbers in hand. If you need advice, please use the IIS forums: <a title="https://forums.iis.net/1152.aspx" href="https://forums.iis.net/1152.aspx">https://forums.iis.net/1152.aspx</a></p>  <h1>Inbound Rules</h1>  <p>URL Rewrite 1.1. and 2.0 implement an internal cache of rewritten URLs to avoid evaluating the rules every request. </p>  <p>For inbound rules, performance work is more about understanding the rewrite cache and how it works. There are many cache levels in IIS: Output User Mode Cache, Kernel Mode Cache and Rewrite Cache. Please note that application frameworks (e.g. ASP.NET and PHP) can use other caches.</p>  <h2>Rewrite Cache Policy</h2>  <p>The rewrite cache policy is based on how frequently an URL is hit. If the URL is requested once in a while, the Rewrite Engine will execute all the rules, otherwise it will take the final action from the rewrite cache. One easy way to know if a particular request was served from the cache, is by <a href="https://learn.iis.net/page.aspx/467/using-failed-request-tracing-to-trace-rewrite-rules/">enabling tracing</a>. For rules resolved from the rewrite cache, you will find events like REWRITE_FROM_CACHE_ACTION, REDIRECT_FROM_CACHE_ACTION, NO_ACTION_FROM_CACHE and NO_MATCH_FROM_CACHE.</p>  <p>IIS determinates if an URL is frequently hit by querying the properties <a href="https://www.iis.net/ConfigReference/system.webServer/serverRuntime">frequentHitThreshold and frequentHitTimePeriod</a>. If the values are 2 and 10 seconds it means that “if the URL is hit 2 times within 10 seconds” it will be marked as frequent hit and the Rewrite Engine will use the rewrite cache. If the <strike>time</strike> period is increased, the Rewrite Engine will cache more often, that could mean more memory usage, but probably less CPU cycles.</p>  <h2>Kernel Mode Cache</h2>  <p>The Kernel Mode Cache was introduced a while ago and it allows the Windows Operating System to cache objects without even reaching IIS. You can learn more at <a title="https://learn.iis.net/page.aspx/154/walkthrough-iis-70-output-caching/" href="https://learn.iis.net/page.aspx/154/walkthrough-iis-70-output-caching/">https://learn.iis.net/page.aspx/154/walkthrough-iis-70-output-caching/</a></p>  <p>If your application leverage the kernel mode cache, it is very important to be aware that the Rewrite Engine can potentially disable it and affect throughput. Take a moment to read the section “Interaction with IIS Output Caching” at <a title="https://learn.iis.net/page.aspx/465/url-rewrite-module-configuration-reference/" href="https://learn.iis.net/page.aspx/465/url-rewrite-module-configuration-reference/">https://learn.iis.net/page.aspx/465/url-rewrite-module-configuration-reference/</a></p>  <p>Starting from URL Rewrite 2.0, you can enable tracing and look for the event REWRITE_DISABLE<strike>D</strike>_KERNEL_CACHE. If it is present, analyze the rules’ evaluation and avoid the use of headers and server variables that are not URL derived as described in the “Interaction with IIS Output Caching” section.</p>  <h2>Global Rules</h2>  <p>Global rules are executed in a very early stage, before the IIS Pipeline is executed indeed. Distributed rules (e.g. at Web Site level) are execute within the pipeline and if a rewrite action happens, it needs to create a child request to re-execute the pipeline with the new URL. Creating a child-request is an expensive operation by nature, thereby one benefit of global rules is that it do avoid the creation of a child request and can have better performance for some scenarios.</p>  <p>The downside of global rules is that they don’t have any rewrite cache at all and the cost of evaluating the rules will be paid every request. If you have just one rule that does a simple matching and rewrite or redirect, it is very likely that it will have better performance than a distributed rule, but if the rule or rules get more complex, it may be better to use distributed rules to leverage the rewrite cache.</p>  <p>For Global Rules is strongly recommended to use Wildcards matching instead of Regex (ECMAScript) since the matching will be done every request.</p>  <h2>Linear Evaluation O(N)</h2>  <p>Rewrite rules are evaluated linearly, that means that we can use some well known techniques for reducing the cost.</p>  <h3>Reorder rules</h3>  <p>When your rewrite rules don’t have any kind of workflow, or chaining between rules (i.e. output of Rule#1 is input of Rule#2), you can try to reorder the rules so the most likely to hit rule would be the first one. For example, if the URL “a” is most frequently hit than “x”, you could reorder the rules like:</p>  <p>Rule#1 match “a” rewrite “b” stopProcessing=true</p>  <p>Rule#2 match “x” rewrite “y” stopProcessing=true</p>  <h3>Use Rewrite Maps</h3>  <p>A rewrite map has almost a constant evaluation O(1). That can help to make quick matches for well known values or even partial values. Read more here: <a title="https://learn.iis.net/page.aspx/469/using-rewrite-maps-in-url-rewrite-module/" href="https://learn.iis.net/page.aspx/469/using-rewrite-maps-in-url-rewrite-module/">https://learn.iis.net/page.aspx/469/using-rewrite-maps-in-url-rewrite-module/</a></p>  <p>Using rewrite maps for some strings and substrings look ups can lead to have a really complex rule, make sure that you will have real benefits from it by testing it. For example, a rule set of 3-5 rules in distributed rules, will probably won’t benefit from rewrite maps, because distributed rules can use the rewrite cache that also has an efficient O(1) complexity, but if the rules are global, they may have a benefit.</p>  <p>In the other hand, if the cost of adding a new rule is higher than adding a rewrite map entry (like a rewrite map for user-agents or domain mapping), it may be better to use rewrite maps.</p>  <p>Keep in mind that URL Rewrite 2.0 supports .NET Extensibility in order to create new kind of map functions:</p>  <p><a title="https://code.msdn.microsoft.com/rewriteextensibility" href="https://code.msdn.microsoft.com/rewriteextensibility">https://code.msdn.microsoft.com/rewriteextensibility</a></p>  <h1>Outbound Rules</h1>  <p>Outbound rules can be very expensive because you will be matching and rewriting high volume of data.</p>  <h2>Reduce Regex use</h2>  <p>Use ExactMatch matching instead of Regex (ECMAScript) whenever is possible. Regex are expensive.</p>  <p>For rules with HTML filters (“a”, “img”, etc.) you can also use Wildcards. For rules that try to match the entire response body you cannot use wildcards because the matching is greedy, instead try to use a simple ExactMatch.</p>  <h2>Reduce Evaluation Groups</h2>  <p>Evaluation groups is a concept used by URL Rewrite to group rules with HTML filters and without HTML filters. Having the following outbound rule set:</p>  <table border="0" cellspacing="0" cellpadding="2" width="547"><tbody>     <tr>       <td valign="top" width="545">         <p>Rule#1 filter=”Img” match=”body.png” rewrite=”images/body.png”</p>          <p>Rule#2 filter=”A” match=”*.html” syntax=”Wildcards” rewrite=”pages/{R:1}.aspx”</p>          <p>Rule#3 filter=”None” match=”internal.contoso.com” rewrite=”contoso.com”</p>          <p>Rule#4 filter=”Script match=”*” syntax=”Wildcards” rewrite=”scripts/{R:1}”</p>       </td>     </tr>   </tbody></table>  <p>For that rule set, 3 evaluation groups will be created. The first one has both Rule#1 and Rule#2; the second one is just Rule#3 and the last one is Rule#4. </p>  <p>Each evaluation group is evaluated against the entire response and multiple evaluations require to buffer the entire response before sending it to the client. To minimize the number of evaluation groups, reorder the rules (if possible) to group the rules with and without filter:</p>  <table border="0" cellspacing="0" cellpadding="2" width="541"><tbody>     <tr>       <td valign="top" width="539">         <p>Rule#1 filter=”Img” match=”body.png” rewrite=”images/body.png”</p>          <p>Rule#2 filter=”A” match=”*.html” syntax=”Wildcards” rewrite=”pages/{R:1}.aspx”</p>          <p><strong>Rule#4</strong> filter=”Script match=”*” syntax=”Wildcards” rewrite=”scripts/{R:1}”</p>          <p><strong>Rule#3</strong> filter=”None” match=”internal.contoso.com” rewrite=”contoso.com”</p>       </td>     </tr>   </tbody></table>  <p>Rules with filters are by default chained. The output of the Rule#1 will be the input for the Rule#2 and the output of Rule#2 the input of Rule#4. If that is not what you need, set the stop processing property to true.</p>  <table border="0" cellspacing="0" cellpadding="2" width="640"><tbody>     <tr>       <td valign="top" width="638">         <p>Rule#1 filter=”Img” match=”body.png” rewrite=”images/body.png” <strong>stopProcessing=”true”</strong></p>          <p>Rule#2 filter=”A” match=”*.html” syntax=”Wildcards” rewrite=”pages/{R:1}.aspx” <strong>stopProcessing=”true”</strong></p>          <p>Rule#4 filter=”Script match=”*” syntax=”Wildcards” rewrite=”scripts/{R:1}” <strong>stopProcessing=”true”</strong></p>          <p>Rule#3 filter=”None” match=”internal.contoso.com” rewrite=”contoso.com”</p>       </td>     </tr>   </tbody></table>  <p>URL Rewrite 2.0 RTW supports tracing for outbound rules, <a href="https://learn.iis.net/page.aspx/467/using-failed-request-tracing-to-trace-rewrite-rules/">enable tracing</a> to learn more.</p>  <h2>Rewrite before do output caching</h2>  <p>Rewrite Module can perform the rewriting of the response body before the IIS Output User Mode Cache saves the response, so next time the rewritten response body can be served from the cache without evaluating any outbound rule. Look for the rewriteBeforeCache property at <a title="https://learn.iis.net/page.aspx/665/url-rewrite-module-20-configuration-reference/" href="https://learn.iis.net/page.aspx/665/url-rewrite-module-20-configuration-reference/">https://learn.iis.net/page.aspx/665/url-rewrite-module-20-configuration-reference/</a></p>  <p>This is a huge optimization, but it won’t work for <a href="https://en.wikipedia.org/wiki/Chunked_transfer_encoding">chunked-transfer encoding</a>. The reason is that the entire response body must be available for doing the matching with accuracy.</p>  <p>If you need to know if your application send these response, <a href="https://www.bing.com/search?q=download+wfetch">download wfetch</a> client and look if the response contains the Transfer-Encoding header set to chunked. You can also enable the “Raw View” checkbox to see how the actual response body is encoded.</p>  <h1>Conclusion</h1>  <p>Hope this information can give you a startup for improving performance of rewriting in high performance scenarios, remember that URL Rewrite is only one piece of your application and even with a highly optimized rewrite configuration, the gain could be marginal when you see the full picture.</p>]]></content:encoded>
    </item>
    <item>
      <title>Getting the line number for a Faulting Application Error</title>
      <link>https://docs.microsoft.com/archive/blogs/danielvl/getting-the-line-number-for-a-faulting-application-error</link>
      <pubDate>Wed, 03 Mar 2010 17:27:51 GMT</pubDate>
      <dc:creator><![CDATA[aractnido]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/danielvl/2010/03/03/getting-the-line-number-for-a-faulting-application-error/</guid>
      <description><![CDATA[It is possible to know the line where an application faulted even if it was not running under...]]></description>
      <content:encoded><![CDATA[<p>It is possible to know the line where an application faulted even if it was not running under debugger or memory dump is not available. It won’t probably tell you why it failed, but it will give you at least a point where to start investigating.</p>  <p>After the application failed, look at the Windows Event Logs for an entry like this:</p>  <p>&quot;Faulting application yourapp.exe, version 1.0.0.0, time stamp 0x49e0238, faulting module yourmodule.dll, version 1.1.0.0, time stamp 0x09ec5a57, exception code 0xc0000005, fault offset<strong> 0x000000000051000e</strong>, process id 0x00, application start time 0x00.&quot; </p>  <ol>   <li>Load the module that faulted using windbg.exe -z c:\yourmodule.dll (make sure you have symbols!) </li>    <li>List the modules loaded (yourmodule.dll in this case)     <br />0:000&gt; lm      <br />start&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; end&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; module name      <br /><strong>00000000`00300000</strong> 00000000`00425000&#160;&#160; yourmodule&#160;&#160;&#160; (private pdb symbols)&#160; c:\yourmodule.pdb</li>    <li>Find the line where it crashed by adding the 'fault offset' reported in the event viewer to the 'start' address of your module</li> 0:000&gt; ln 300000+5100e    <br />c:\sources\myclass.cpp(130)+0x14</ol> If your symbols don’t match exactly the module that is in production, you can try in windbg the command ‘.symopt +0x40’; it will make it less restrictive.]]></content:encoded>
    </item>
    <item>
      <title>Enable code coverage in Visual Studio</title>
      <link>https://docs.microsoft.com/archive/blogs/danielvl/enable-code-coverage-in-visual-studio</link>
      <pubDate>Tue, 16 Feb 2010 15:57:33 GMT</pubDate>
      <dc:creator><![CDATA[aractnido]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/danielvl/2010/02/16/enable-code-coverage-in-visual-studio/</guid>
      <description><![CDATA[For some reason, every time that I want to enable code coverage for a library that I’m unit testing,...]]></description>
      <content:encoded><![CDATA[<p>For some reason, every time that I want to enable code coverage for a library that I’m unit testing, I found hard to remember how to enable this fabulous feature.</p>  <p>Here are the steps (that work for me):</p>  <ol>   <li>Double click the [Local].testsettings file in the Solutions Items folder in the Solution Explorer window.</li>    <li>In the &quot;Test Settings&quot; dialog, choose the &quot;Data and Diagnostics&quot; item.</li>    <li>In the list of roles, select &quot;Code Coverage&quot; [Figure 1] and immediately click the '&quot;Configure&quot; button.</li>    <li>In the &quot;Code Coverage Detail&quot; [Figure 2] dialog select the assemblies to instrument for code coverage.</li>    <li>Run your test scenario and in the &quot;Test Tools&quot; toolbar, click the icon &quot;Code Coverage Results&quot;.</li>    <li>Done.</li> </ol>  <p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/danielvl/WindowsLiveWriter/EnablecodecoverageinVisualStudio_D06E/CodeCoverage1_2.png" original-url="https://blogs.msdn.com/blogfiles/danielvl/WindowsLiveWriter/EnablecodecoverageinVisualStudio_D06E/CodeCoverage1_2.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="CodeCoverage1" border="0" alt="CodeCoverage1" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/danielvl/WindowsLiveWriter/EnablecodecoverageinVisualStudio_D06E/CodeCoverage1_thumb.png" original-url="https://blogs.msdn.com/blogfiles/danielvl/WindowsLiveWriter/EnablecodecoverageinVisualStudio_D06E/CodeCoverage1_thumb.png" width="244" height="180" /></a> </p>  <p>Figure 1.</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/danielvl/WindowsLiveWriter/EnablecodecoverageinVisualStudio_D06E/CodeCoverage2_2.png" original-url="https://blogs.msdn.com/blogfiles/danielvl/WindowsLiveWriter/EnablecodecoverageinVisualStudio_D06E/CodeCoverage2_2.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="CodeCoverage2" border="0" alt="CodeCoverage2" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/danielvl/WindowsLiveWriter/EnablecodecoverageinVisualStudio_D06E/CodeCoverage2_thumb.png" original-url="https://blogs.msdn.com/blogfiles/danielvl/WindowsLiveWriter/EnablecodecoverageinVisualStudio_D06E/CodeCoverage2_thumb.png" width="244" height="168" /></a> </p>  <p></p>  <p>Figure 2.</p>]]></content:encoded>
    </item>
    <item>
      <title>Registry values for IIS URL Rewrite</title>
      <link>https://docs.microsoft.com/archive/blogs/danielvl/registry-values-for-iis-url-rewrite</link>
      <pubDate>Thu, 07 Jan 2010 15:48:23 GMT</pubDate>
      <dc:creator><![CDATA[aractnido]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/danielvl/2010/01/07/registry-values-for-iis-url-rewrite/</guid>
      <description><![CDATA[The following registry values can be set for the IIS URL Rewrite module and will affect the global...]]></description>
      <content:encoded><![CDATA[<p>The following registry values can be set for the <a href="https://www.iis.net/expand/urlrewrite">IIS URL Rewrite</a> module and will affect the global behavior of the module; use them at your own risk :)</p>  <p>All these values (DWORD) can be set under the registry key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\InetStp\Rewrite</p>  <p><strong>MaxBackReferences</strong> – By default 31 (maximum value). Defines the maximum number of back-references that can be used. For example, if you set it to 9, administrator won’t be able to use {R:10} in their rewrite expressions.</p>  <p><strong>RewriteCacheEnabled</strong> – By default 1 (true). Enables (1) or disables (0) the internal cache of rewritten URLs. Disabling it will have a negative performance impact.</p>  <p><strong>RewriteCacheThreshold</strong> – By default 512. Change it to something smaller if the query string in your URLs varies too much and you are seeing too much memory consumption. The value represents the maximum of cached items per URL path. For example, ‘/cars?drive=0’ and ‘/cars?drive=1’ is one URL path ‘/cars’ that has two different query strings, this registry setting control how many variants of ‘/cars’ can be cached; but it doesn’t control how may URL paths can be cached (e.g. ‘/cars’, ‘/bikes’); that is controlled by how frequently hit is the URL path. Read <a href="https://www.iis.net/ConfigReference/system.webServer/serverRuntime">frequentHitThreshold and frequentHitTimePeriod</a>.</p>  <p><strong>UrlDecodeAllowsDoubleEncoding</strong> – By default 1 (true). The module provides a UrlDecode built-in function that allows to decode strings like %25 into single characters. The function will fail by default if finds a double encoded string like %252E, where %25 is first decoded to (%) and in a second pass %2E is decoded to (.). Setting this registry value to 0 can be security problem.</p>  <p><strong>InboundRewriteEnabled</strong> – By default 1 (true). Setting this value to 0 (false) will make URL Rewrite to stop listening the IIS notifications, even if you have inbound rules, it won’t process them.</p>  <p><strong>OutboundRewriteEnabled</strong> – By default 1 (true). Setting this value to 0 (false) will make URL Rewrite to stop listening notifications for sending responses. This also affects the <a href="https://learn.iis.net/page.aspx/665/url-rewrite-module-20-configuration-reference/">logRewrittenUrl</a> feature, it will stop working because it relies on those IIS notifications.</p>  <p><strong>LogRewrittenUrlEnabled</strong> – By default 1 (true). It can be used to disable the <a href="https://learn.iis.net/page.aspx/665/url-rewrite-module-20-configuration-reference/">logRewrittenUrl</a> feature.</p>  <p>All these values are read during startup, so you need to recycle your worker process if you change the values and as I said, use them at your own risk.</p>]]></content:encoded>
    </item>
    <item>
      <title>System.ComponentModel.Composition Example</title>
      <link>https://docs.microsoft.com/archive/blogs/danielvl/system-componentmodel-composition-example</link>
      <pubDate>Fri, 06 Nov 2009 17:06:00 GMT</pubDate>
      <dc:creator><![CDATA[aractnido]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/danielvl/2009/11/06/system-componentmodel-composition-example/</guid>
      <description><![CDATA[I started playing with the .NET Framework 4.0 composition namespace (also known as MEF) and I want...]]></description>
      <content:encoded><![CDATA[<P>I started playing with the .NET Framework 4.0 composition namespace (also known as MEF) and I want to share the most simple example I could write. The program prints out the providerName field, but the actual value is provided by the ExternalProvider class. The CompositionContainer class is able to wire the ExternalProvider.Name property and the Program.providerName field using the Export and Import attributes.</P>
<P>Add the System.ComponentModel.Composition.dll assembly to your project’s references.</P>
<P>Really simple, I think.</P>
<DIV style="PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-LEFT: 0px; PADDING-RIGHT: 0px; DISPLAY: inline; FLOAT: none; PADDING-TOP: 0px" id=scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:143c6ab0-c533-456b-ab2a-3d94a4b36da3 class=wlWriterEditableSmartContent>
<DIV style="BORDER-BOTTOM: #000080 1px solid; BORDER-LEFT: #000080 1px solid; FONT-FAMILY: 'Courier New', Courier, Monospace; COLOR: #000; FONT-SIZE: 10pt; BORDER-TOP: #000080 1px solid; BORDER-RIGHT: #000080 1px solid">
<DIV style="BACKGROUND: #ddd; MAX-HEIGHT: 500px; OVERFLOW: auto">
<OL style="PADDING-BOTTOM: 0px; MARGIN: 0px 0px 0px 2.5em; PADDING-LEFT: 5px; PADDING-RIGHT: 0px; BACKGROUND: #ffffff; PADDING-TOP: 0px">
<LI><SPAN style="COLOR: #0000ff">using</SPAN> System;</LI>
<LI><SPAN style="COLOR: #0000ff">using</SPAN> System.ComponentModel.Composition;</LI>
<LI><SPAN style="COLOR: #0000ff">using</SPAN> System.ComponentModel.Composition.Hosting;</LI>
<LI><SPAN style="COLOR: #0000ff">using</SPAN> System.Reflection;</LI>
<LI></LI>
<LI><SPAN style="COLOR: #0000ff">class</SPAN> <SPAN style="COLOR: #2b91af">ExternalProvider</SPAN> {</LI>
<LI></LI>
<LI>&nbsp;&nbsp;&nbsp;&nbsp;[<SPAN style="COLOR: #2b91af">Export</SPAN>(<SPAN style="COLOR: #a31515">"ProviderName"</SPAN>)]</LI>
<LI>&nbsp;&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">public</SPAN> <SPAN style="COLOR: #0000ff">string</SPAN> Name {</LI>
<LI>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">get</SPAN> {</LI>
<LI>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">return</SPAN> <SPAN style="COLOR: #a31515">"Spider"</SPAN>;</LI>
<LI>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</LI>
<LI>&nbsp;&nbsp;&nbsp;&nbsp;}</LI>
<LI>}</LI>
<LI></LI>
<LI><SPAN style="COLOR: #0000ff">class</SPAN> <SPAN style="COLOR: #2b91af">Program</SPAN> {</LI>
<LI></LI>
<LI>&nbsp;&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">static</SPAN> <SPAN style="COLOR: #0000ff">void</SPAN> Main() {</LI>
<LI>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">new</SPAN> <SPAN style="COLOR: #2b91af">Program</SPAN>().Run();</LI>
<LI>&nbsp;&nbsp;&nbsp;&nbsp;}</LI>
<LI></LI>
<LI>&nbsp;&nbsp;&nbsp;&nbsp;[<SPAN style="COLOR: #2b91af">Import</SPAN>(<SPAN style="COLOR: #a31515">"ProviderName"</SPAN>)]</LI>
<LI>&nbsp;&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">string</SPAN> providerName;</LI>
<LI></LI>
<LI>&nbsp;&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">void</SPAN> Run() {</LI>
<LI>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">new</SPAN> <SPAN style="COLOR: #2b91af">CompositionContainer</SPAN>(<SPAN style="COLOR: #0000ff">new</SPAN> <SPAN style="COLOR: #2b91af">AssemblyCatalog</SPAN>(<SPAN style="COLOR: #2b91af">Assembly</SPAN>.GetExecutingAssembly())).ComposeParts(<SPAN style="COLOR: #0000ff">this</SPAN>);</LI>
<LI>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: #2b91af">Console</SPAN>.WriteLine(<SPAN style="COLOR: #0000ff">this</SPAN>.providerName);</LI>
<LI>&nbsp;&nbsp;&nbsp;&nbsp;}</LI>
<LI>}</LI></OL></DIV></DIV></DIV>]]></content:encoded>
    </item>
  </channel>
</rss>