Msbuild 类型脚本生成错误(TS5007)

Msbuild 类型脚本生成错误(TS5007),msbuild,typescript,Msbuild,Typescript,我一直在尝试通过visualstudio.com上的构建服务器构建typescript,我已经完成了将typescript引入源代码管理的正常工作。但我有以下问题: VSTSC:错误TS5007:生成: 无法解析引用的文件: “仅计算路径”。 [C:\a\src\Main\recruitecloud\recruitecloud.csproj] 我知道编码问题,但在我所看到的所有示例中,错误消息中都指定了罪犯文件 我开始认为这可能与我在项目中编译的typescript文件的数量有关 有什么想法吗?

我一直在尝试通过visualstudio.com上的构建服务器构建typescript,我已经完成了将typescript引入源代码管理的正常工作。但我有以下问题:

VSTSC:错误TS5007:生成: 无法解析引用的文件: “仅计算路径”。 [C:\a\src\Main\recruitecloud\recruitecloud.csproj]

我知道编码问题,但在我所看到的所有示例中,错误消息中都指定了罪犯文件

我开始认为这可能与我在项目中编译的typescript文件的数量有关


有什么想法吗?

你最好的办法是简单地用Unicode编码重新保存所有文件。您可以通过快速powershell脚本()


这是运行编译器的VsTsc任务的配置选项。它用于
预计算CompileTypeScript
目标。其目的是使VsTsc任务完成除运行编译器之外的所有动作。这并没有在你的机器上实现,它实际上运行了编译器。由于找不到名为COMPUTE\u PATHS\u ONLY的文件,因此引发了一个问题

VsTsc任务存储在C:\Program Files(x86)\MSBuild\Microsoft\VisualStudio\v12.0\TypeScript\TypeScript.Tasks.dll中。使用反编译器查看程序集:

protected override int ExecuteTool(string pathToTool, string responseFileCommands, string commandLineCommands)
{
    if (this.Configurations.Contains("--sourcemap"))
    {
        this.generateSourceMaps = true;
    }
    else
    {
        this.generateSourceMaps = false;
    }
    if (this.Configurations.Contains("--declaration"))
    {
        this.generateDeclarations = true;
    }
    else
    {
        this.generateDeclarations = false;
    }
    this.GenerateOutputPaths();
    if (!responseFileCommands.Contains("COMPUTE_PATHS_ONLY"))
    {
        return base.ExecuteTool(pathToTool, responseFileCommands, commandLineCommands);
    }
    return 0;
}
注意
!responseFileCommand.Contains()
test以绕过base.ExecuteTool()调用


我所能猜到的是,这个方法在你的机器上看起来不像这样。最可能的原因是您的TypeScript.Tasks.dll版本过时。在安装了VS2013 Update 4的我的机器上,它的日期为2014年11月11日,大小为27816字节。

升级到visual studio Update 3do后出现相同错误。是否安装了.net demon?在我禁用它之后,错误消失了。不,我不知道,构建服务器是托管的azure构建代理,所以我相当确定这不是问题所在。嗯,对我来说,它是在更新到VS 2013 update 3时开始的。类似的问题:我反编译了我的
TypeScript.Tasks.dll
,它确实与你的相匹配。我对Visual Studio进行了全面修复安装,问题仍然存在。我有点困惑,因为症状表明你是对的。可怜虫,我认为这是一个令人沮丧的解释。我需要查看详细的msbuild跟踪才能得出另一个理论。详细显示它正在从project加载文件“C:\Program Files(x86)\msbuild\Microsoft\VisualStudio\v12.0\TypeScript\Microsoft.TypeScript.targets”中的v11/TypeScript.Task.dll
Target“PreComputerCompileTypeScript”“C:\Users\jayt\Documents\Visual Studio 2013\Projects\taglich.fix\AdminMVC\AdminMVC.csproj”(目标“CompileTypeScript”取决于它):使用程序集“C:\Program Files(x86)\MSBuild\Microsoft\VisualStudio\v11.0\TypeScript\TypeScript.tasks.dll”中的“VsTsc”任务。“
我仍然需要找出原因。我使用的是vs2012,我也遇到了同样的错误”生成:无法解析引用的文件:“COMPUTE\u PATHS\u ONLY”,我反编译了dll,发现我缺少!responseFileCommand.Contains(“COMPUTE\u PATHS\u ONLY”),是否有此验证的vs2012 dll版本可供下载?
protected override int ExecuteTool(string pathToTool, string responseFileCommands, string commandLineCommands)
{
    if (this.Configurations.Contains("--sourcemap"))
    {
        this.generateSourceMaps = true;
    }
    else
    {
        this.generateSourceMaps = false;
    }
    if (this.Configurations.Contains("--declaration"))
    {
        this.generateDeclarations = true;
    }
    else
    {
        this.generateDeclarations = false;
    }
    this.GenerateOutputPaths();
    if (!responseFileCommands.Contains("COMPUTE_PATHS_ONLY"))
    {
        return base.ExecuteTool(pathToTool, responseFileCommands, commandLineCommands);
    }
    return 0;
}