4

在按照此处的说明在 Visual Studio 2012 上启用 TypeScript 支持后,我开始在 Azure 部署中遇到异常。

它有什么问题?

命令:C:\DWASFiles\Sites\apolyon\VirtualDirectory0\site\deployments\tools\deploy.cmd 处理 .NET Web 应用程序部署。C:\DWASFiles\Sites\apolyon\VirtualDirectory0\site\repository\ApolyonRadio\ApolyonRadio.csproj(771,3):错误 MSB4019:导入的项目“D:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11. 0\TypeScript\Microsoft.TypeScript.targets" 未找到。确认声明中的路径正确,并且该文件存在于磁盘上。网站部署过程中发生错误。处理 .NET Web 应用程序部署。C:\DWASFiles\Sites\apolyon\VirtualDirectory0\site\repository\ApolyonRadio\ApolyonRadio.csproj(771,3):错误 MSB4019:导入的项目“D:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11. 0\TypeScript\Microsoft.TypeScript.targets" 没找到。确认声明中的路径正确,并且该文件存在于磁盘上。网站部署过程中发生错误。D:\kuduservice\wwwroot\bin\scripts\starter.cmd C:\DWASFiles\Sites\apolyon\VirtualDirectory0\site\deployments\tools\deploy.cmd

4

2 回答 2

3

正如我在对 Freshblood 的回答的评论中提到的,有一个更通用的解决方案:

<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersio‌​n)\TypeScript\Microsoft.TypeScript.targets" Condition="Exists('$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualSt‌​udioVersion)\TypeScript\Microsoft.TypeScript.targets')" />

于 2013-11-10T20:22:06.483 回答
2

I do TypeScript compilation on file saves locally so i don't need to import that setting in publish time.

So adding Condition="'$(Configuration)' == 'Debug'" attribute on import setting as below fixed problem. This is what i found best until for better solution.

<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\TypeScript\Microsoft.TypeScript.targets" Condition="'$(Configuration)' == 'Debug'" />
于 2013-09-07T02:09:49.927 回答