Skip to content

Microsoft.TypeScript.MSBuild.2.1.4 error #12739

@shawng

Description

@shawng

TypeScript Version: 2.1.4

After upgrading to TypeScript 2.1.4 and updating to Microsoft.TypeScript.MSBuild.2.1.4 via Nuget, we're getting the following error on our TeamCity build server when attempting to build a .csproj project targeting .NET 4.5 on a server with .NET Framework 4.5.2 installed:

C:\TeamCity\buildAgent\work\127334233d38d231\packages\Microsoft.TypeScript.MSBuild.2.1.4\tools\microsoft.TypeScript.targets(195, 5): error MSB4018: The "VsTsc" task failed unexpectedly.
System.MissingMethodException: Method not found: 'System.String System.String.Format(System.IFormatProvider, System.String, System.Object)'.
at TypeScript.Tasks.VsTsc.GenerateResponseFileCommands()
at Microsoft.Build.Utilities.ToolTask.Execute()
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.d__26.MoveNext()

This worked fine on TypeScript 2.0.3, the only change was moving from Microsoft.TypeScript.MSBuild.2.0.3 to Microsoft.TypeScript.MSBuild.2.1.4 and changing the TypeScriptToolsVersion in the .csproj project file from 2.0 to 2.1.

The error seems to be related to using a String.Format overload that only exists in .NET 4.6:

http://stackoverflow.com/a/30559657

https://msdn.microsoft.com/en-us/library/dn906224(v=vs.110).aspx

Is it possible this is a bug with the Microsoft.TypeScript.MSBuild.2.1.4 build target on .NET 4.5? Ideally we could run this on .NET 4.5 without modification. Any suggested fixes/workarounds?

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptFixedA PR has been merged for this issue

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions