Question Rollup for Type script in Visual Studio 2013 (continuous update ...)

Source: Internet
Author: User


Typescript under the vs2012 problem


Typescript has a low VS2012 support level, it is recommended to upgrade to VS2013 version.





Unable to create typescript project in VS2013


VS2013 does not support typescript by default.



You need to install typescript in Tools-extensions and updates, so far (September 16, 2015) The latest version of TS for VS2013 is version 1.5, but there are some problems with the test, it is recommended to install a more stable version 1.4








Compile prompt "Typescript\1.4\1.4\tsc.exe invalid" issue


Workaround:



1. Enter directory C:\Program Files (x86) \msbuild\microsoft\visualstudio\v12.0\typescript



2. Copy the Microsoft.TypeScript.targets file to a different path, open the edit



3, the third Tsctoolpath this line to block out, save, copy back to the original path, overwriting can (or need administrator privileges).


 
<PropertyGroup>
     <TypeScriptToolsVersion Condition="‘$(TypeScriptToolsVersion)‘==‘‘">1.4</TypeScriptToolsVersion>
     <TscToolPath Condition="‘$(TscToolPath)‘ == ‘‘">$(MSBuildProgramFiles32)\Microsoft SDKs\TypeScript</TscToolPath>
     <TscToolPath Condition="‘$(TypeScriptToolsVersion)‘ != ‘‘">$(TscToolPath)\</TscToolPath>
     <!-- <TscToolPath Condition="‘$(TypeScriptToolsVersion)‘ != ‘‘">$(TscToolPath)\$(TypeScriptToolsVersion)</TscToolPath>-->
     <TscToolExe Condition="‘$(TscToolExe)‘ == ‘‘">tsc.exe</TscToolExe>
     <TscYieldDuringToolExecution Condition="‘$(TscYieldDuringToolExecution)‘ == ‘‘">true</TscYieldDuringToolExecution>
   </PropertyGroup>


See: Bad path when installing TypeScript 1.4 for Visual Studio #3493





How to adjust the compilation target version of Typescript


Workaround:



vs-"Project"-"Properties"-"typescript Generation"-"general"-"ECMAScript Version"-Select the appropriate ECMA version (currently only -3,-5,-6 supported)








Change the compilation target to ECMAScript 6 "... lib.es6.d.ts not found" error


Workaround:



1, go here to download the latest version of the definition file, address: https://github.com/Microsoft/TypeScript/blob/release-1.4/bin/lib.es6.d.ts



2, download and paste into C:\program files (x86) \microsoft sdks\typescript\1.4 folder can (or need administrator rights)



For more details, please use lib.es6.d.ts. I try to use some method of ES6? But it just go error! #1582





Cannot use new features of Typescript 1.4 (such as union type, type keyword, etc.)





Workaround:



1. Uninstall all other versions of typescript. Reinstall the version you want to use (the 1.4 stable version I'm using here)



2. Go to the cmd command line and execute tsc-v to see if the result is the version number of the current installation






3. If the version is not currently installed, restart the computer to view the version again



4, if it is still not the current version of the CMD execution set%PATH% view the current system environment variables, whether there are other typescript version of the path, if any, modify the environment variable



5, modify the environment variable method: "Computer"-"Right-click Properties"-"Advanced system Settings"-"Advanced"-"Environment variables ..."-"System Variables"-"PATH"-"edit" modify save, or may restart effective



6, if the current installation version and VS installed the ReSharper plug-in case.



7. vs-"ReSharper"-"Option"-"Code Inspection"-"Settings"-"File masks to skip"-"Add"-Enter *.ts-Save






8, the new features of TypeScript1.4 can be used normally.






9, cause the above reasons for ReSharper9 at present the highest only support TypeScript1.3 grammar, thus only temporarily shielding ReSharper provided only perceptual function.






10, if still can not use, or do not install ReSharper plug-in, please leave a message



See: Typescript 1.4:wrong Syntax highlighting in Visual Studio





An issue with the latest version of TS still unavailable for new features is installed



The problem is exactly the same as the one above, but the problem is caused by a bug in the currently known Microsoft TS installation package that does not uninstall cleanly after uninstallation, resulting in all subsequent versions being installed.



You can detect this problem in the following ways:



1. Have you ever installed other versions of typescript for VS?



If you have installed only one TS so far, there is no problem



2. Have you uninstalled the lower version of TS?



If not, uninstall all low-version TS, leaving only the highest version of TS that you installed.



3. Go to "Control Panel"-"Programs and features" view to ensure that only one TS is currently retained (installed)






4. Go to the cmd command line and execute tsc-v to see if the result is the version number of the current installation






5. If the version number displayed does not match the version number shown in your Control panel,



If the version number I installed here is 1.0.3, then I installed TS1.0 not uninstalled cleanly



6. Go to "computer"-"Right-click Properties"-"Advanced system Settings"-"Advanced"-"Environment variables ..."-"System Variables"-"PATH"-"edit"



Copy all, paste into Notepad:






You can see that there are two TS environment variable paths, the previous one is Microsoft did not uninstall clean environment variables, if you ask why only to the old version of the TS compiler can also run? I can only regret to tell you, in fact, the old version of TS All files are not uninstalled.



The old version of the file, the compiler is still in the C disk, so there will be a use but unable to use the new features of the issue.






7, delete the old version of the environment variables, only the version of your installation of the path can be, select paste back to the system environment variable settings






8. Restart cmd, re-execute TSC--v command, view version






The current compiler is already the version I have installed.



Back to VS, open the TS Project, the syntax of those new features is no longer an error, it can be compiled properly.









Welcome to feedback Other questions, continue to update in ...



Original Address-http://www.cnblogs.com/xxcanghai/p/4978754.html



Question Rollup for Type script in Visual Studio 2013 (continuous update ...)


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.