Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Including "Microsoft.TypeScript.MSBuild" in a project breaks Typescript compile on save #27567

Closed
mperdeck opened this issue Oct 5, 2018 · 2 comments
Assignees
Labels
Bug A bug in TypeScript Visual Studio Integration with Visual Studio Working as Intended The behavior described is the intended behavior; this is not a bug

Comments

@mperdeck
Copy link

mperdeck commented Oct 5, 2018

TypeScript Version: 3.2.0-dev.201xxxxx
Tested, bug still present.

Search Terms:
Microsoft.TypeScript.MSBuild

Descriptions and Steps to reproduce

Including the latest version of the Nuget package "Microsoft.TypeScript.MSBuild" in a project breaks Typescript compile on save. However, it is required to have your Typescript files generated during a dotnet publish.

Reproduced in Visual Studio Professional 2017, Version 15.8.6.

  1. Create new "ASP.NET Core Web Application" project in Visual Studio 2017.
  2. Choose "Web Application (Model-View-Controller). Do not configure for HTTPS.
  3. In the wwwroot directory, create a new .tsx file - click wwwroot directory | add | new item | Web | Typescript JSX file.
  4. The properties of the new file show "Package Action" is "TypeScriptCompile".
  5. Enter some simple TypeScript in the new file, for example "var x: number = 5;". On save, the file is automatically compiled.

  1. Perform a "dotnet publish" on the command line in the root directory of the project. The .tsx does not get compiled as part of the publish.

  1. Add the line "" to an ItemGroup in the .csproj of the project.
  2. The properties of the .tsx file added earlier no longer show a "Package Action".
  3. Edit the .tsx file - it is no longer compiled on save. It is still compiled though when you build the project.

  1. Perform a "dotnet publish" on the command line in the root directory of the project. The .tsx now does get compiled as part of the publish.
// A *self-contained* demonstration of the problem follows...
// Test this by running `tsc` on the command-line, rather than through another build tool such as Gulp, Webpack, etc.

Expected behavior:
Including the Microsoft.TypeScript.MSBuild package should not break compile on save.

Actual behavior:
Including the Microsoft.TypeScript.MSBuild package breaks compile on save.

Playground Link:

Related Issues:

@weswigham weswigham added Bug A bug in TypeScript Visual Studio Integration with Visual Studio labels Oct 16, 2018
@minestarks
Copy link
Member

minestarks commented Dec 7, 2018

Currently, compile on save in VS requires a matching version of the TypeScript language service to be installed on the machine. Would you try installing it from https://www.microsoft.com/en-ca/download/details.aspx?id=55258 and see if that fixes the issue?

@minestarks
Copy link
Member

Closing this as my understanding is this is working as intended.

@minestarks minestarks added the Working as Intended The behavior described is the intended behavior; this is not a bug label Dec 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript Visual Studio Integration with Visual Studio Working as Intended The behavior described is the intended behavior; this is not a bug
Projects
None yet
Development

No branches or pull requests

5 participants