Can anyone give any insight. Couldn't find any information about this. -Asp.net 5 project- Visual studio 2015 Encountered the below error
Error MSB6006 "tsc.exe" exited with code 2. C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\TypeScript\Microsoft.TypeScript.targets 213
EDIT: This is line 213 of the Microsoft.TypeScript.targets file
<VsTsc
ToolPath="$(TscToolPath)"
ToolExe="$(TscToolExe)"
TSConfigFile="%(ConfigFiles.Identity)"
YieldDuringToolExecution="$(TscYieldDuringToolExecution)"
ProjectDir="$(ProjectDir)"
ToolsVersion="$(TypeScriptToolsVersion)"
TypeScriptCompileBlocked="$(TypeScriptCompileBlocked)"
ComputeOutputOnly="false">
I have succeded to compile with gulp-typescript library.
[16:27:47] Starting 'build-ts'... Process terminated with code 0.
[16:27:50] TypeScript: 4 semantic errors.
[16:27:50] TypeScript: emit succeeded (with errors)
[16:27:50] Finished 'build-ts' after 3.49 s
There may be multiple reasons behind this error. The problem is VS does not show exact error returned by TypeScript compiler.
I wrote a blog post that explains small trick to get detailed error message, I hope it will be useful for someone: http://the-coderok.azurewebsites.net/2016/07/13/Resolve-the-Error-MSB6006-tsc-exe-exited-with-code-2-build-error-in-Visual-Studio-2015/
If you are having problems with ASP.NET Core xproj compilation and don't have any .ts file, you could disable Typescript compilation modifying .xproj file and adding:
<TypeScriptCompileBlocked>true</TypeScriptCompileBlocked>
Inside the first
<PropertyGroup>
<TypeScriptCompileBlocked>true</TypeScriptCompileBlocked>
...
</PropertyGroup>
After updating TypescriptToolsVersion to 1.8
<TypeScriptToolsVersion>1.8</TypeScriptToolsVersion>
Change Typescript Targets paths to include TypeScriptionVersion location. like below.
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\TypeScript\$(TypeScriptToolsVersion)\Microsoft.TypeScript.targets" Condition="Exists('$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\TypeScript\$(TypeScriptToolsVersion)\Microsoft.TypeScript.targets')" />
Changing my tsconfig.json fixed that for me. it looks like:
{
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"sourceMap": false,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"outDir": "wwwroot/app/",
"noImplicitAny": true,
"suppressImplicitAnyIndexErrors": true
},
"filesGlob": [
"node_modules/**",
"wwwroot/**/*",
"typings/**/*"
],
"compileOnSave": false
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With