3

I have a .NET website which includes some TypeScript files. I'm attempting to deploy it as an Azure website from GitHub, but I'm getting an error associated with TypeScript.

It appears to me that it may be related to my use of the newest version (1.0) whereas the kudu build only has 0.9 - but I'm new enough to this that I can't be sure that's the issue, nor how to fix it.

Here is the deployment log (sorry about the formatting):

Command: D:\home\site\deployments\tools\deploy.cmd Handling .NET Web Application deployment. All packages listed in packages.config are already installed. Restoring NuGet packages... To prevent NuGet from downloading packages during build, open the Visual Studio Options dialog, click on the Package Manager node and uncheck 'Allow NuGet to download missing packages'. All packages listed in packages.config are already installed. Shadow_findly -> D:\home\site\repository\Shadow_findly\bin\Release\Shadow_findly.dll D:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\TypeScript\Microsoft.TypeScript.targets(96,5): error : Your project file uses a different version of the TypeScript compiler and tools than is currently installed on this machine. No compiler was found at D:\Program Files (x86)\Microsoft SDKs\TypeScript\1.0\tsc.exe. You may be able to fix this problem by changing the element in your project file. [D:\home\site\repository\HiveAdmin\TheHive.Admin.csproj] D:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\TypeScript\Microsoft.TypeScript.targets(96,5): error MSB6004: The specified task executable location "D:\Program Files (x86)\Microsoft SDKs\TypeScript\1.0\tsc.exe" is invalid. [D:\home\site\repository\HiveAdmin\TheHive.Admin.csproj] Failed exitCode=1, command="D:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe" "D:\home\site\repository\HiveAdmin\TheHive.Admin.csproj" /nologo /verbosity:m /t:Build /t:pipelinePreDeployCopyAllFilesToOneFolder /p:_PackageTempDir="C:\DWASFiles\Sites\thehiveadmin\Temp\cab5b42e-19e1-435e-ae3a-b780b7bb6400";AutoParameterizationWebConfigConnectionStrings=false;Configuration=Release /p:SolutionDir="D:\home\site\repository.\" An error has occurred during web site deployment. Handling .NET Web Application deployment. All packages listed in packages.config are already installed. Restoring NuGet packages... To prevent NuGet from downloading packages during build, open the Visual Studio Options dialog, click on the Package Manager node and uncheck 'Allow NuGet to download missing packages'. All packages listed in packages.config are already installed. Shadow_findly -> D:\home\site\repository\Shadow_findly\bin\Release\Shadow_findly.dll D:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\TypeScript\Microsoft.TypeScript.targets(96,5): error : Your project file uses a different version of the TypeScript compiler and tools than is currently installed on this machine. No compiler was found at D:\Program Files (x86)\Microsoft SDKs\TypeScript\1.0\tsc.exe. You may be able to fix this problem by changing the element in your project file. [D:\home\site\repository\HiveAdmin\TheHive.Admin.csproj] D:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\TypeScript\Microsoft.TypeScript.targets(96,5): error MSB6004: The specified task executable location "D:\Program Files (x86)\Microsoft SDKs\TypeScript\1.0\tsc.exe" is invalid. [D:\home\site\repository\HiveAdmin\TheHive.Admin.csproj] Failed exitCode=1, command="D:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe" "D:\home\site\repository\HiveAdmin\TheHive.Admin.csproj" /nologo /verbosity:m /t:Build /t:pipelinePreDeployCopyAllFilesToOneFolder /p:_PackageTempDir="C:\DWASFiles\Sites\thehiveadmin\Temp\cab5b42e-19e1-435e-ae3a-b780b7bb6400";AutoParameterizationWebConfigConnectionStrings=false;Configuration=Release /p:SolutionDir="D:\home\site\repository.\" An error has occurred during web site deployment. D:\Program Files (x86)\SiteExtensions\Kudu\1.26.30329.722\bin\scripts\starter.cmd D:\home\site\deployments\tools\deploy.cmd

Any ideas how to fix this?

Michael
  • 4,010
  • 4
  • 28
  • 49

1 Answers1

3

The relevant part of the error message is

Your project file uses a different version of the TypeScript compiler and tools than is currently installed on this machine. No compiler was found at D:\Program Files (x86)\Microsoft SDKs\TypeScript\1.0\tsc.exe. You may be able to fix this problem by changing the element in your project file.

There's a tag in your project file like this:

    <TypeScriptToolsVersion>1.0</TypeScriptToolsVersion>

You'll need to make this value conditional on the build environment if you have some parts of your build system on 0.9 and some on 1.0.

Ryan Cavanaugh
  • 209,514
  • 56
  • 272
  • 235
  • I'm very new to this - what would that look like, and where would I put it? – Michael Apr 22 '14 at 17:12
  • If you are using a .csproj for a project file, then that node would be located inside a `` node towards the beginning of the file. If you have any PreBuildEvents or PostBuildEvents, then the TypeScriptToolsVersion node would be a sibling node to either of them. – Bishop May 12 '17 at 18:56