[英]How to ensure exactly which TypeScript compiler Visual Studio is using during build?
Context 上下文
Recently TypeScript compiler (1.8.x) became available as Nuget Package too. 最近,TypeScript编译器(1.8.x)也可以作为Nuget Package使用。 However here is a bit cloudy fact that there are two packages
然而这里有一个有点混乱的事实,有两个包
In my project (.csproj) TypeScript version was set to 1.7 originally 在我的项目(.csproj)中,TypeScript版本最初设置为1.7
<TypeScriptToolsVersion>1.7</TypeScriptToolsVersion>
I wanted to know what happens after installing a) or b) 我想知道安装a)或b)后会发生什么
Issue/Question 问题/问题
I do not know simple way how to diagnose what is exactly happening during the Visual Studio 2015 build about TypeScript compile. 我不知道如何诊断Visual Studio 2015构建期间关于TypeScript编译的确切情况的简单方法。
Diganostic results (optional reading, if anyone is interested) Diganostic结果 (可选阅读,如果有人有兴趣)
Because of my lack of knowledge I had to use Mark Russinovich's ProcessMonitor to make sure what is happening. 由于我缺乏知识,我不得不使用Mark Russinovich的ProcessMonitor来确保发生了什么。 This is the question: How to do this more simple?
这是一个问题:如何做到这一点更简单?
Installing a) does nothing except coping a working instance of tsc to your project's /packages folder. 安装a)除了将tsc的工作实例复制到项目的/ packages文件夹之外什么都不做。 The .csproj file was not touched.
没有触及.csproj文件。 Consequently the originally configured MSBuild task will apply to .ts files and original installed tsc 1.7 is running from Program Files
因此,最初配置的MSBuild任务将应用于.ts文件,并且原始安装的tsc 1.7正在从Program Files运行
Uninstalling a) Correctly "restores" the original state. 卸载a)正确“恢复”原始状态。 (Well, this is nothing else than deleting the package from the /packages folder
(嗯,这只是从/ packages文件夹中删除包
Installing b) The same as a) + changes the MSBuild task entry in .csproj. 安装b)与a)相同+更改.csproj中的MSBuild任务条目。 As a result the new tsc 1.8 will run from the /package folder.
因此,新的tsc 1.8将从/ package文件夹运行。
Uninstalling b) Removes all, including all TypeScript related MSBuild task from the .csproj file. 卸载b)从.csproj文件中删除所有,包括所有与TypeScript相关的MSBuild任务。 This is silently disables all ts file compilation (with no warnings and errors).
这是静默禁用所有ts文件编译(没有警告和错误)。 The simple way to restore the default behaviour is to add a dummy .ts file to your project, which will insert the default MSBuild task back to your .csproj file.
恢复默认行为的简单方法是向项目添加一个虚拟.ts文件,该文件将默认的 MSBuild任务插回到.csproj文件中。
Either install was touched the setting: 安装被触及设置:
<TypeScriptToolsVersion>1.7</TypeScriptToolsVersion>
Back to the question 回到问题
Is there a simpler way to see what is exactly happening about TypeScript during VS 2015 build, than using ProcessMonitor? 有没有比使用ProcessMonitor更简单的方法来查看VS 2015构建过程中TypeScript的确切情况?
This is probably a little late but if you run msbuild with msbuild /verbosity:Detailed or msbuild /v:Detailed it will give you much more detailed information as to what is going on with the typescript compilers. 这可能有点晚了,但是如果你使用msbuild / verbosity运行msbuild :详细或msbuild / v:详细它会为你提供更详细的信息,说明打字稿编译器发生了什么。
Just search for tsc.exe in the build output and you will see the version of typescript it is using 只需在构建输出中搜索tsc.exe,您将看到它正在使用的typescript版本
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.