C# extension methods in a "site.master" template thats wrapped in a namespace quandary
<p>The question is this, why do I need to add an "import" directive on my <strong>Site.Master</strong> file to get Intellisense when the html helpers work without it.</p>

<p>Using a simple C# string extension method without a namespace == no problem. However, I wanted to put this extension in a namespace to be a good programmer.</p>

<p>If I wrap it in a <strong>namespace</strong>, you have to do a couple of things. Here is my extension:</p>

<pre><code>namespace MySystemCore
{
    public static class StringExtensions
    {
        public static string F(this string s, params object[] args)
        {
            return string.Format(s, args);
        }
    }
}
</code></pre>

<p>So through trial and error, I have it working, but wanted to share my observations. Hopefully it may help someone else in the future.</p>

<p>NOTE: I am using the extension method in <strong>Site.Master</strong></p>

<ol>
<li><p>Add "using MySystemCore;" to <strong>Site.Master.cs</strong> file (codebehind file)</p>

<ul>
<li>Runtime error, no extension method found</li>
</ul></li>
<li><p>Add "<code>&lt;add namespace="MySystemCore"&gt;</code>" to <code>&lt;namespaces&gt;</code> configuration block in <strong>web.config</strong></p>

<ul>
<li>Works, no intellisense</li>
</ul></li>
<li><p>Combine #1 and #2</p>

<ul>
<li>Works, no intellisense</li>
</ul></li>
<li><p>Add "<code>&lt;%@ Import Namespace="MySystemCore" %&gt;</code>" to <strong>Site.Master</strong> file</p>

<ul>
<li>Works, with intellisense</li>
</ul></li>
</ol>
