As soon as I add a tsconfig.json file to my Visual Studio 2015 web solution I get the above error.
Also this stops the compiler from re-generating js files even when I set "compileOnSave": true.
When I double click the error it takes me into the Microsoft.Typescript.Targets file which contains a lot of issues such as Unknown Item Group "TypeScriptCompile". In the error list these appear as warnings but they are there whether I have a tsconfig.json file or not.
Is there any way of solving it or getting more information on what the problem is?
The easiest way to find out is to enable detailed output in Visual Studio -> Tools -> Options -> Projects and Solutions -> Build and Run -> MSBuild project build output verbosity . Change this to Detailed . After compiling, find tsc.exe in the output window to see the actual error tsc was throwing.
right-click the project node and choose Manage NuGet Packages. In the Browse tab, search for Microsoft. TypeScript. MSBuild, and then click Install on the right to install the package.
Install these 2 NuGet packages:
Microsoft.TypeScript.MSBuild and Microsoft.TypeScript.Compiler
It updates your project with MSBuild task definition and TS compiler and solves the compilation issue
For me installing TypeScript for Visual Studio fixed it, although TypeScript was already installed globally on my machine via npm
I am using a .NET Core 1.0 project and ran into the same situation of getting a tsc.exe
return code of 1. My problem was an invalid tsconfig.json
. However, msbuild does not provide those details.
The easiest way to find out is to enable detailed output in Visual Studio -> Tools -> Options -> Projects and Solutions -> Build and Run -> MSBuild project build output verbosity
. Change this to Detailed
. After compiling, find tsc.exe
in the output window to see the actual error tsc was throwing.
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