Upgrade TypeScript project from 0.8.0 to version 0.8.1.1

If you created a TypeScript HTML project in Visual Studio 2012 using the old version (e.g., 0.8.0 which is the first preview release) and later you upgraded TypeScript to version 0.8.1.1, you would get this compile error like this.

Error    1    The command “C:\Program Files (x86)\Microsoft SDKs\TypeScript.8.0.0\tsc” …exited with code 3.

Although it is better to just recreate your project using a newer version of TypeScript, you could just modify the csproj file by right-click at the project to unload and edit the file in text mode.

image

image

The TypeScript HTML project template in the 0.8.0 version just adds a “BeforeBuild” target and hard-coded the path to the TypeScript compiler. You should see the target element at the bottom of the file.

  <Target Name="BeforeBuild">
    <Exec Command="&quot;$(PROGRAMFILES)\Microsoft SDKs\TypeScript\0.8.0.0\tsc&quot; @(TypeScriptCompile ->'&quot;%(fullpath)&quot;', ' ')" />
  </Target>

So what you need to do is to change “0.8.0.0” to “0.8.1.1” and everything should work.

However, I would recommend you to recreate your project using the new version, so you could also debug your TypeScript code as well as getting rid of hard-coded version in the project file altogether (the project file generated by 0.8.1.1 is quite different from what 0.8.0 generates).

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s