我正在使用Visual Studio 2013中的TypeScript 1.4做一些简单的教程,当我在 debug 中进行编译时,一切正常。一旦我尝试在发布中编译,我得到:
The command "tsctrue "C:\Users\dluther\Downloads\typescript\materials\2-typescript-m2-exercise-files\Code\Before\TypeScriptTypes\TypeScriptTypes\app.ts" "C:\Users\dluther\Downloads\typescript\materials\2-typescript-m2-exercise-files\Code\Before\TypeScriptTypes\TypeScriptTypes\Scripts\02-05-primitives.ts"" exited with code 9009.
在我的.csproj文件中,我有这个:
<Target Name="BeforeBuild"> <Message Text="Compiling TypeScript files" /> <Message Text="Executing tsc$(TypeScriptSourceMap) @(TypeScriptCompile ->'"%(fullpath)"', ' ')" /> <Exec Command="tsc$(TypeScriptSourceMap) @(TypeScriptCompile ->'"%(fullpath)"', ' ')" /> </Target>
答案 0 :(得分:1)
Turns out I didn't have this in my project file (I had to add it manually):
<PropertyGroup Condition="'$(Configuration)' == 'Release'"> <TypeScriptSourceMap> --sourcemap</TypeScriptSourceMap> </PropertyGroup>