简体   繁体   English

在Visual Studio 2012中构建TypeScript

[英]TypeScript Build in visual studio 2012

I just built my typescript in visual studio 2012, on the first day, after I built the .ts file, the .js file is modified/adjusted according to the typescript .ts file that I made. 在构建.ts文件后的第一天,我才在Visual Studio 2012中构建了我的打字稿,然后根据我制作的打字稿.ts文件对.js文件进行了修改/调整。

The strange thing is the next day, I open the project, and I modify many code in the .ts file, after I compile it, the .js file is not updated and not modified, the worse is that I got the following error: 奇怪的是第二天,我打开项目,并修改了.ts文件中的许多代码,编译之后,.js文件未更新且未修改,更糟糕的是我得到了以下错误:

  1. Permission Denied EXEC File 权限被拒绝的EXEC文件

  2. The Command .... exited with code 1 Command ....以代码1退出

in the Build output the error: 在生成输出中的错误:

------ Rebuild All started: Project: HTML5Viewer, Configuration: Release Any CPU ------ 1> Couldn't write to file 'C:/DevProject/PADS 4.x/Release 2/Source/PADS HTML5/PADS HTML5 Viewer/HTML5Viewer/methods.js' 1>EXEC : tsc.js(21005, 21) Microsoft JScript runtime error : Permission denied 1>C:\\DevProject\\PADS 4.x\\Release 2\\Source\\PADS HTML5\\PADS HTML5 Viewer\\HTML5Viewer\\HTML5Viewer.csproj(73,5): error MSB3073: The command ""C:\\Program Files (x86)\\Microsoft SDKs\\TypeScript\\0.8.0.0\\tsc" "C:\\DevProject\\PADS 4.x\\Release 2\\Source\\PADS HTML5\\PADS HTML5 Viewer\\HTML5Viewer\\Viewer.ts" "C:\\DevProject\\PADS 4.x\\Release 2\\Source\\PADS HTML5\\PADS HTML5 Viewer\\HTML5Viewer\\methods.ts" "C:\\DevProject\\PADS 4.x\\Release 2\\Source\\PADS HTML5\\PADS HTML5 Viewer\\HTML5Viewer\\app.ts"" exited with code 1. ========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ========== ------重建所有已开始:项目:HTML5Viewer,配置:释放任何CPU ------ 1>无法写入文件'C:/ DevProject / PADS 4.x / Release 2 / Source / PADS HTML5 / PADS HTML5 Viewer / HTML5Viewer / methods.js'1> EXEC:tsc.js(21005,21)Microsoft JScript运行时错误:权限被拒绝1> C:\\ DevProject \\ PADS 4.x \\ Release 2 \\ Source \\ PADS HTML5 \\ PADS HTML5 Viewer \\ HTML5Viewer \\ HTML5Viewer.csproj(73,5):错误MSB3073:命令““ C:\\ Program Files(x86)\\ Microsoft SDKs \\ TypeScript \\ 0.8.0.0 \\ tsc”“ C:\\ DevProject \\ PADS 4.x \\ Release 2 \\ Source \\ PADS HTML5 \\ PADS HTML5 Viewer \\ HTML5Viewer \\ Viewer.ts“”“ C:\\ DevProject \\ PADS 4.x \\ Release 2 \\ Source \\ PADS HTML5 \\ PADS HTML5 Viewer \\ HTML5Viewer \\ methods.ts “” C:\\ DevProject \\ PADS 4.x \\ Release 2 \\ Source \\ PADS HTML5 \\ PADS HTML5 Viewer \\ HTML5Viewer \\ app.ts“”用代码1退出。==========全部重建:0成功,1个失败,0个被跳过===========

any solution to this? 有什么解决办法吗?

I can just create a new project and move all my .ts files to the new ones but that will be a pain 我可以创建一个新项目,然后将所有.ts文件移动到新文件中,但这会很麻烦

I don't know what source control system you are using, but if you have checked in the .js file and the build process isn't able to check it out to change it, this would cause an error such as the one you have. 我不知道您使用的是哪种源代码控制系统,但是如果您已签入.js文件,并且构建过程无法将其签出以进行更改,则可能会导致错误,例如您所拥有的。

You can either exclude the file entirely from source control or allow your build process to check out the file to edit it. 您可以将文件完全从源代码管理中排除,也可以让您的构建过程签出文件进行编辑。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM