Fixing the "your project file uses a different version of TypeScript compiler" error in Visual Studio 2013

Posted on Friday, 4th April 2014

Last night, after downloading and installing the Visual Studio 2013 Update 2 Release Candidate update which included TypeScript 1.0, I loaded up a TypeScript project that I’d been playing around with and started to code. Soon after starting I clicked save, expecting Visual Studio to compile the Javascript but quickly encountered the following build failure error:

“Your project file uses a different version of the TypeScript compiler and tools than is currently installed on this machine. No compiler was found at C:\Program Files (x86)\Microsoft SDKs\TypeScript\0.9\tsc.exe. You may be able to fix this problem by changing the element in your project file.

Scratching my head I wondered where I needed to go to reference the new Type Script 1.0 compiler that had installed along with Visual Studio 2013 Update 2 Release Candidate. After having a quick look around the project options such as the TypeScript Build panel within project properties I was still stumped.

It turns out that you specify the TypeScript version number within the project’s .csproj file itself. Simple right click the project that requires TypeScript compilation, click “Unload Project” and then right click the unloaded project again and click “Edit ¬†.csprok” to view the project’s project configuration. From here you should see a TypeScript version property that you need to update to your desired version (in my case 1.0).

Once you’ve updated this, simple reload the project and you’re good to go!