Monday 24 August 2015

Visual Studio 2015 Typescript 1.5.4 problems

Hello there, I encountered something very weird with visual studio 2015 community edition today. I have become so interested in cross platform development on mobile and have been looking at Cordova and visual studio 2015. Been doing a lot of reading on it so I decided to try and see what I get out of the box from VS. As soon as I ran it..boom!!! It spits an error at me about my typescript version being wrong. I was confused as I had not even touched anything and I get this. I started googling to see what I would find and I saw a lot of articles about all sorts of typescript errors that range from the strange to the ridiculous and I didn't find anything that looked like the problem I was having. Specifically the error said:


"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\1.5\tsc.exe. You may be able to fix this problem by changing the <TypeScriptToolsVersion> element in your project file. <ProjectName>".


That was it!! All the complaints I was seeing on different sites had to do with VS 2013 and not for 2015 (though if it was 2015, it had to do with typescript development but nothing specific to Cordova and this error I was getting). So I wasn't sure where to start looking and what to start doing. Following complaints on github about VS and typescript, I got a clue to check the folder 


C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\(versionnumber)\typescript\ 


to see the typescript target files for VS 2015. It was strangely looking for typescript version 1.4. I was confused and wasn't sure what to think as I know VS 2015 doesn't come
with typescript 1.4. So I checked and I had 1.5.4 installed. Long story short, it turns out that 1.5.4 is very troublesome and was causing my issues and problems. so I had to uninstall 1.5.4 (In case you are wondering, I uninstalled typescript tools for visual studio with version 1.5.4). I downloaded 1.5.3 which I think is what comes with VS and voila, everything worked. The visual studio team and TSTFVS (TypeScript tools
for VisualStudio) should look into this and help fix this. As wonderful as VS is, it still has a few issues.
Hope this helps someone.