title: When using Visual Studio custom templates with parameters, how can you get the actual root namespace?
body: <p>I am attempting to set up a template to create a unit test class with some basic structure and default using statements. I have created a VS2010 custom template to do this and almost everything works correctly.</p>
  
  <p>The issue I have encountered is that I am attempting to reference my project's base namespace in my using statements, and am unable to determine whether there is a parameter that will let me do this.</p>
  
  <p>An example of what I want, assuming my project is called MyProduct.Test:</p>
  
  <pre><code>using NUnit.Framework;
  using MyProduct.Test.Base;
  
  namespace MyProduct.Test.BLL.Services.MyService
  {
      [TestFixture]
      public class MyServiceTest : TestBase
      {
          [SetUp]
          public void Setup()
          etc...
  </code></pre>
  
  <p>I can generate everything except for <code>using MyProduct.Test.Base</code> with the template below:</p>
  
  <pre><code>using NUnit.Framework;
  using $safeprojectname$.Base;
  
  namespace $rootnamespace$
  {
      [TestFixture]
      public class $safeitemname$ : TestBase
      {
          [SetUp]
          public void Setup()
          etc...
  </code></pre>
  
  <p>Unfortunately, $safeprojectname$ is only available for Project templates, not Item templates.</p>
  
  <p>This template results in the following output:</p>
  
  <pre><code>using NUnit.Framework;
  using $safeprojectname$.Base;
  
  namespace MyProduct.Test.BLL.Services.MyService
  {
      [TestFixture]
      public class MyServiceTest : TestBase
      {
          [SetUp]
          public void Setup()
          etc...
  </code></pre>
  
  <p>Is there any way for me to get the <em>actual</em> root namespace of my project (since $rootnamespace$ actually outputs the namespace for the file being added based on its location)?</p>
  
  <p>Note: Obviously I can set this up to work fine for one project, but it would be much more useful to have a template that works for all projects.</p>