Note that there are some explanatory texts on larger screens.

plurals
  1. POWhy does a Build of my TypeScript project in Visual Studio ignore the TypeScriptTarget parameter?
    text
    copied!<p>I have an existing TypeScript project in Visual Studio (Express 2012 for Web). This project was created with TypeScript 0.8.1.</p> <p>Some of the classes make use of properties and so require the <code>--target ES5</code> compiler parameter. </p> <p>I have just now updated the plugin to TypeScript 0.8.2, and followed the steps defined <a href="http://typescript.codeplex.com/wikipage?title=Compile-on-Save" rel="nofollow">here</a> to enable "compile on save". This works as described, including compiling classes that use properties.</p> <p>When I try to build the project, however, I get errors such as: <code>Config.ts (32,6): Property accessors are only available when targeting ES5 or greater</code></p> <p>Here is the relevant section from my .csproj file:</p> <pre><code>&lt;Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\TypeScript\Microsoft.TypeScript.targets" /&gt; &lt;PropertyGroup Condition="'$(Configuration)' == 'Debug'"&gt; &lt;TypeScriptTarget&gt;ES5&lt;/TypeScriptTarget&gt; &lt;TypeScriptIncludeComments&gt;true&lt;/TypeScriptIncludeComments&gt; &lt;TypeScriptSourceMap&gt;true&lt;/TypeScriptSourceMap&gt; &lt;/PropertyGroup&gt; </code></pre> <p>The complete file can be seen <a href="https://gist.github.com/sykesd/5033772" rel="nofollow">here</a>.</p> <p>Why does it work for compiling individual files, but not if I build or rebuild the whole project?</p> <p>EDIT: updated snippet to show that the <code>&lt;Import&gt;</code> tag was also included.</p> <p>EDIT 2: added link to gist of complete project file.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload