title: ASP.NET MVC and HTML TypeScript Projects Difference
body: <p>I have a problem that I suppose comes from my ASP.NET MVC project using Type Script. For testing I have created a project using the HTML TypeScript template. I could perfectly create two modules and use one of them in the other like this:</p>
  
  <pre><code>import authModule = module("Authenticate");
  import testModule = module("TestModule");
  
  export module SiteMaster {
    authModule.Authenticate.run();
    testModule.TestModule.run();
  }
  </code></pre>
  
  <p>It is generating correctly the JavaScript like this:</p>
  
  <pre><code>define(["require", "exports", "Authenticate", "TestModule"], function(require, exports, __authModule__, __testModule__) {
    var authModule = __authModule__;
    var testModule = __testModule__;
  
    (function (SiteMaster) {
      authModule.Authenticate.run();
      testModule.TestModule.run();
    })(exports.SiteMaster || (exports.SiteMaster = {}));
  })
  </code></pre>
  
  <p>Then I have copied to my ASP.NET MVC 4.5 the compiler command from my Typescript project. </p>
  
  <pre><code>  &lt;Target Name="BeforeBuild"&gt;
  &lt;Exec Command="&amp;quot;$(PROGRAMFILES)\Microsoft SDKs\TypeScript\0.8.0.0\tsc&amp;quot; --module amd @(TypeScriptCompile -&gt;'&amp;quot;%(fullpath)&amp;quot;', ' ')" /&gt;
  </code></pre>
  
  <p></p>
  
  <p>It is compiling correctly. Apparently is compiling correctly.</p>
  
  <p>But there is a problem: when I create the same modules in my ASP.NET MVC application I receive the compilation errors in the import line:</p>
  
  <pre><code>The name '"Authenticate"' does not exist in the current scope
  A module cannot be aliased to a non-module
  </code></pre>
  
  <p>Ths same for TestModule.</p>
  
  <p>I have included a reference below to the module and the error remains, and look in the Typescript template the reference was not necessary.</p>
  
  <pre><code>/// &lt;reference path='Authenticate.ts'/&gt;
  </code></pre>
  
  <p>What is wrong here?</p>