title: Cannot compile modules unless the --module flag is provided
body: <p>UPDATE:<em>The issue I had at the time was due to a bug in VS/Typescript.  This issue is now resolved. Currently, the only reason for this error to occur is that no module type has been selected in Typescript properties. See accepted answer.</em></p>
  
  <p>VS 15: asp.net MVC project.</p>
  
  <p>I add a typescript file.  I then set the Module system to System.</p>
  
  <p>I then build the project.</p>
  
  <p>The error occurs: Cannot compile modules unless the --module flag is provided.</p>
  
  <p>I then check the properties of the ts file.  I set the build action to none.  The error goes away.</p>
  
  <p>However, if I start with a fresh Typescript project using the template with the Greeter class, then all works as expected.</p>
  
  <p>But I have looked at the project settings carefully, and there are no differences that I can see.</p>
  
  <p>I have read all other stack overflow answers on this error and none of them have resolved the error.</p>
  
  <p>The only workaround I have found is setting "Compile On Save" to true, and then setting the build action to "None"</p>