How to disable building of TypeScript files in Visual Studio 2015

If you would like to disable building TypeScript files in your solution for some reason (you want different build workflow, you just work on .cs files and don’t touch .ts files), you had to search for some kind of ifs or comments out to the project file in previous version of Visual Studio.

The problem as such is not new and solution was requested for some time from TypeScript team.

After digging in some articles I found this not much hyped solution :
add node

[xml]
<TypeScriptCompileBlocked>true</TypeScriptCompileBlocked>
[/xml]

to the first

[xml]
<PropertyGroup>
[/xml]

element in .csproj file.

For me, it worked.

More on the problem here :
https://github.com/Microsoft/TypeScript/issues/2326
https://github.com/Microsoft/TypeScript/issues/2294

One small note : if you have an error in the .ts files and compilation is disabled, build will not fail in Visual Studio 2015. But you can still see all errors in Error list tab. And you will still have IntelliSense.

14 comments

This site uses Akismet to reduce spam. Learn how your comment data is processed.

  1. Cody Mullins · August 14, 2015

    Thanks, this helped. Build server was throwing an error and we didn’t realize that this Typescript compilation started with the latest update to VS 2015.

    • dusan · August 14, 2015

      glad to hear this helped sir 🙂

  2. Christiaan Rakowski · August 14, 2015

    This is exactly what I was looking for!
    Thanks for finding and sharing this!

  3. Sipke Schoorstra · August 14, 2015

    Thanks a lot, this helped!

  4. Mohan · August 14, 2015

    thanks. exactly what i needed

  5. Mike · August 14, 2015

    Excellent find! We have an MVC app that bootstraps our angular app and the build of the solution was blocked by the angular components not being able to build correctly.

    • dusan · August 14, 2015

      glad it helped 🙂

  6. Pingback: Converting the ASP.NET Core MVC template to an Aurelia SPA – keeping the Razor views – deap on programming
  7. Jhoel Arias · August 14, 2015

    I would kiss you if I could, thanks a lot

  8. Sun · August 14, 2015

    It worked. Thanks!

  9. kieran · August 14, 2015

    to remove errors removed all .ts entries with this one item group

  10. Neil · August 14

    It worked! Thanks so much for posting this.

    • admindusan · August 14

      my pleasure 🙂